You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @formatter:off
Gauge g = GaugeBuilder.create()
.skinType(SkinType.SIMPLE_DIGITAL)
.foregroundBaseColor(Color.rgb(0, 222, 249))
.barColor(Color.rgb(0, 222, 249))
.title(text)
.minValue(0.0)
.maxValue(1.0)
.gradientBarEnabled(true)
.gradientBarStops(new Stop(0.00, Color.BLUE),
new Stop(0.25, Color.CYAN),
new Stop(0.50, Color.LIME),
new Stop(0.75, Color.YELLOW),
new Stop(1.00, Color.RED))
.decimals(3)
.build();
// @formatter:on
// Workaround, new skin set explicitly
g.getSkin().dispose();
g.setSkin(new SimpleDigitalSkin(g));
// Without workaround, throws exception
g.setValue(value.doubleValue());
After building the gauge calling setValue causes an exception:
Exception in thread "nioEventLoopGroup-3-1" java.lang.NullPointerException: Cannot invoke "eu.hansolo.medusa.tools.AngleConicalGradient.getImagePattern(javafx.scene.shape.Rectangle)" because "this.gradient" is null
at eu.hansolo.medusa.skins.SimpleDigitalSkin.setBar(SimpleDigitalSkin.java:207)
at eu.hansolo.medusa.skins.SimpleDigitalSkin.lambda$new$1(SimpleDigitalSkin.java:109)
The workaround is to set a new SimpleDigitalSkin explicitly
The text was updated successfully, but these errors were encountered:
// Code with workaround
After building the gauge calling setValue causes an exception:
Exception in thread "nioEventLoopGroup-3-1" java.lang.NullPointerException: Cannot invoke "eu.hansolo.medusa.tools.AngleConicalGradient.getImagePattern(javafx.scene.shape.Rectangle)" because "this.gradient" is null
at eu.hansolo.medusa.skins.SimpleDigitalSkin.setBar(SimpleDigitalSkin.java:207)
at eu.hansolo.medusa.skins.SimpleDigitalSkin.lambda$new$1(SimpleDigitalSkin.java:109)
The workaround is to set a new SimpleDigitalSkin explicitly
The text was updated successfully, but these errors were encountered: