Search in sources :

Example 31 with Section

use of eu.hansolo.enzo.common.Section in project Board-Instrumentation-Framework by intel.

the class DemoMulti method init.

@Override
public void init() {
    rnd = new Random();
    lastTimerCall = 0l;
    timer = new AnimationTimer() {

        @Override
        public void handle(long now) {
            if (now > lastTimerCall + 100_000_000l) {
                for (SimpleGauge gauge : gauges) {
                    gauge.setValue(rnd.nextDouble() * 100.0);
                }
                lastTimerCall = now;
            }
        }
    };
    gauges = new SimpleGauge[100];
    for (int i = 0; i < 100; i++) {
        SimpleGauge gauge = SimpleGaugeBuilder.create().prefSize(50, 50).animationDuration(80).animated(false).sections(new Section(0, 100)).styleClass(SimpleGauge.STYLE_CLASS_BLUE_TO_RED_6).build();
        gauges[i] = gauge;
    }
}
Also used : Random(java.util.Random) AnimationTimer(javafx.animation.AnimationTimer) Section(eu.hansolo.enzo.common.Section)

Aggregations

Section (eu.hansolo.enzo.common.Section)31 AnimationTimer (javafx.animation.AnimationTimer)10 DoubleProperty (javafx.beans.property.DoubleProperty)8 SimpleDoubleProperty (javafx.beans.property.SimpleDoubleProperty)8 Marker (eu.hansolo.enzo.common.Marker)6 IntStream (java.util.stream.IntStream)6 BooleanProperty (javafx.beans.property.BooleanProperty)6 ObjectProperty (javafx.beans.property.ObjectProperty)6 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)6 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)6 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)6 StringProperty (javafx.beans.property.StringProperty)6 ListChangeListener (javafx.collections.ListChangeListener)6 Skin (javafx.scene.control.Skin)6 Color (javafx.scene.paint.Color)6 ArrayList (java.util.ArrayList)5 FXCollections (javafx.collections.FXCollections)5 ObservableList (javafx.collections.ObservableList)5 List (java.util.List)4 Locale (java.util.Locale)4