HanSolo / medusa

A JavaFX library for Gauges
Apache License 2.0
688 stars 129 forks source link

java.lang.RuntimeException #102

Closed claudio-rosati closed 7 years ago

claudio-rosati commented 7 years ago

I'm douing the following basic initialisation (using the Test program):

        gauge = GaugeBuilder.create()
                            .skinType(SkinType.MODERN)
                            .startFromZero(true)
                            .minValue(-20)
                            .maxValue(100)
                            .value(0)
                            .build();

and the following exception is thrown (actually I had to put a try/catch in the start method to catch and print the exception):

java.lang.RuntimeException: Gauge.value : A bound value cannot be set.
    at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:143)
    at eu.hansolo.medusa.Gauge$1.set(Gauge.java:457)
    at eu.hansolo.medusa.Gauge.setValue(Gauge.java:649)
    at eu.hansolo.medusa.Gauge.setMinValue(Gauge.java:704)
    at eu.hansolo.medusa.Gauge.calcAutoScale(Gauge.java:5141)
    at eu.hansolo.medusa.skins.ModernSkin.<init>(ModernSkin.java:118)
    at eu.hansolo.medusa.Gauge.createDefaultSkin(Gauge.java:5204)
    at javafx.scene.control.Control.impl_processCSS(Control.java:872)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1280)
    at javafx.scene.Node.processCSS(Node.java:9058)
    at javafx.scene.Node.applyCss(Node.java:9155)
    at javafx.scene.Scene$53.invalidated(Scene.java:6163)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
    at javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:82)
    at javafx.scene.Scene.setNodeOrientation(Scene.java:6137)
    at eu.hansolo.medusa.Test.start(Test.java:212)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

I've not understood why.

HanSolo commented 7 years ago

In the Test.java class you will find an entry "gauge.valueProperty().bind(value)" which you have to comment when you set the value from the builder.

claudio-rosati commented 7 years ago

Thank you vey much.