NullpointerException: Util#colorToCss / SimpleGaugeSkin
I am developing a Dashboard containing widgets, and SimpleGauge is one of the available widgets.. On Drag&Drop i receive multiple NullpointerExceptions:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at eu.hansolo.enzo.common.Util.colorToCss(Util.java:82)
at eu.hansolo.enzo.gauge.skin.SimpleGaugeSkin.handleControlPropertyChanged(SimpleGaugeSkin.java:231)
at eu.hansolo.enzo.gauge.skin.SimpleGaugeSkin.lambda$registerListeners$60(SimpleGaugeSkin.java:164)
at eu.hansolo.enzo.gauge.skin.SimpleGaugeSkin$$Lambda$32/92682911.invalidated(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:135)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:105)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:145)
at javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:82)
at javafx.css.StyleableObjectProperty.applyStyle(StyleableObjectProperty.java:68)
at javafx.scene.CssStyleHelper.resetToInitialValues(CssStyleHelper.java:442)
at javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:222)
at javafx.scene.Node.impl_processCSS(Node.java:8877)
at javafx.scene.Parent.impl_processCSS(Parent.java:1250)
at javafx.scene.control.Control.impl_processCSS(Control.java:872)
at javafx.scene.Parent.impl_processCSS(Parent.java:1281)
at javafx.scene.Parent.impl_processCSS(Parent.java:1281)
at javafx.scene.Parent.impl_processCSS(Parent.java:1281)
at javafx.scene.control.Control.impl_processCSS(Control.java:872)
at javafx.scene.Node.processCSS(Node.java:8732)
at javafx.scene.Node.processCSS(Node.java:8725)
at javafx.scene.Node.processCSS(Node.java:8725)
at javafx.scene.Node.processCSS(Node.java:8725)
at javafx.scene.Node.processCSS(Node.java:8725)
at javafx.scene.Scene.doCSSPass(Scene.java:561)
at javafx.scene.Scene.access$3500(Scene.java:198)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2366)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:330)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinDnDClipboard.push(Native Method)
at com.sun.glass.ui.win.WinSystemClipboard.pushToSystem(WinSystemClipboard.java:234)
at com.sun.glass.ui.SystemClipboard.flush(SystemClipboard.java:51)
at com.sun.glass.ui.ClipboardAssistance.flush(ClipboardAssistance.java:59)
at com.sun.javafx.tk.quantum.QuantumClipboard.flush(QuantumClipboard.java:274)
at com.sun.javafx.tk.quantum.QuantumToolkit.startDrag(QuantumToolkit.java:1149)
at javafx.scene.Scene$DnDGesture.dragDetectedProcessed(Scene.java:2911)
at javafx.scene.Scene$DnDGesture.process(Scene.java:2972)
at javafx.scene.Scene$DnDGesture.access$8400(Scene.java:2867)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3705)
at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3414)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1676)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2467)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:314)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:345)
at com.sun.glass.ui.View.handleMouseEvent(View.java:526)
at com.sun.glass.ui.View.notifyMouse(View.java:898)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
at java.lang.Thread.run(Thread.java:744)
Comments (8)
-
reporter -
repo owner Just on my iPad atm, when exactly does the exception occur?
-
repo owner oh I think I see the problem, could you try to set sections in the SimpleGaugeBuilder before you set the SectionColors? Guess I have to adjust the setter calling in the builder. Other solution might be to set the section colors after you called the SimpleGaugeBuilder.
-
reporter I am not at home, too ;-) But I will try that later on, thanks for the suggestion!
-
reporter Yes, reordering the Builder statements fixes the issue! Do you want to resolve the issue now or do you want to adjust the Builder first?
-
repo owner Okidoki, I won't find the time to fix it today but I will try to fix it tomorrow. Thanx for testing and merry christmas :)
-
reporter Thanks, do not rush anything and I wish you a merry christmas, too!
-
repo owner - changed status to resolved
Problem was related to method order in SimpleGaugeBuilder
- Log in to comment
And the SimpleGauge I use:
I use custom section fill colors instead of css style class because it prevents some caching issues in JavaFX.