Search in sources :

Example 36 with Dimension2D

use of javafx.geometry.Dimension2D in project Board-Instrumentation-Framework by intel.

the class RadialGaugeBuilder method build.

public final RadialGauge build() {
    final RadialGauge CONTROL = new RadialGauge();
    // Make sure that sections and markers will be added first
    if (properties.keySet().contains("sectionsArray")) {
        CONTROL.setSections(((ObjectProperty<Section[]>) properties.get("sectionsArray")).get());
    }
    if (properties.keySet().contains("sectionsList")) {
        CONTROL.setSections(((ObjectProperty<List<Section>>) properties.get("sectionsList")).get());
    }
    if (properties.keySet().contains("areasArray")) {
        CONTROL.setAreas(((ObjectProperty<Section[]>) properties.get("areasArray")).get());
    }
    if (properties.keySet().contains("areasList")) {
        CONTROL.setAreas(((ObjectProperty<List<Section>>) properties.get("areasList")).get());
    }
    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("minSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("maxSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if ("styleClass".equals(key)) {
            CONTROL.getStyleClass().setAll("gauge");
            CONTROL.getStyleClass().addAll(((ObjectProperty<String[]>) properties.get(key)).get());
        } else if ("minValue".equals(key)) {
            CONTROL.setMinValue(((DoubleProperty) properties.get(key)).get());
        } else if ("maxValue".equals(key)) {
            CONTROL.setMaxValue(((DoubleProperty) properties.get(key)).get());
        } else if ("value".equals(key)) {
            CONTROL.setValue(((DoubleProperty) properties.get(key)).get());
        } else if ("decimals".equals(key)) {
            CONTROL.setDecimals(((IntegerProperty) properties.get(key)).get());
        } else if ("title".equals(key)) {
            CONTROL.setTitle(((StringProperty) properties.get(key)).get());
        } else if ("unit".equals(key)) {
            CONTROL.setUnit(((StringProperty) properties.get(key)).get());
        } else if ("animated".equals(key)) {
            CONTROL.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if ("animationDuration".equals(key)) {
            CONTROL.setAnimationDuration(((DoubleProperty) properties.get(key)).get());
        } else if ("startAngle".equals(key)) {
            CONTROL.setStartAngle(((DoubleProperty) properties.get(key)).get());
        } else if ("angleRange".equals(key)) {
            CONTROL.setAngleRange(((DoubleProperty) properties.get(key)).get());
        } else if ("autoScale".equals(key)) {
            CONTROL.setAutoScale(((BooleanProperty) properties.get(key)).get());
        } else if ("needleColor".equals(key)) {
            CONTROL.setNeedleColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("tickLabelOrientation".equals(key)) {
            CONTROL.setTickLabelOrientation(((ObjectProperty<RadialGauge.TickLabelOrientation>) properties.get(key)).get());
        } else if ("numberFormat".equals(key)) {
            CONTROL.setNumberFormat(((ObjectProperty<RadialGauge.NumberFormat>) properties.get(key)).get());
        } else if ("majorTickSpace".equals(key)) {
            CONTROL.setMajorTickSpace(((DoubleProperty) properties.get(key)).get());
        } else if ("minorTickSpace".equals(key)) {
            CONTROL.setMinorTickSpace(((DoubleProperty) properties.get(key)).get());
        } else if ("dropShadowEnabled".equals(key)) {
            CONTROL.setDropShadowEnabled(((BooleanProperty) properties.get(key)).get());
        } else if ("tickLabelFill".equals(key)) {
            CONTROL.setTickLabelFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("tickMarkFill".equals(key)) {
            CONTROL.setTickMarkFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("style".equals(key)) {
            CONTROL.setStyle(((StringProperty) properties.get(key)).get());
        } else if ("ledColor".equals(key)) {
            CONTROL.setLedColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("ledVisible".equals(key)) {
            CONTROL.setLedVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("sectionsVisible".equals(key)) {
            CONTROL.setSectionsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("sectionFill0".equals(key)) {
            CONTROL.setSectionFill0(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill1".equals(key)) {
            CONTROL.setSectionFill1(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill2".equals(key)) {
            CONTROL.setSectionFill2(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill3".equals(key)) {
            CONTROL.setSectionFill3(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill4".equals(key)) {
            CONTROL.setSectionFill4(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill5".equals(key)) {
            CONTROL.setSectionFill5(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill6".equals(key)) {
            CONTROL.setSectionFill6(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill7".equals(key)) {
            CONTROL.setSectionFill7(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill8".equals(key)) {
            CONTROL.setSectionFill8(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill9".equals(key)) {
            CONTROL.setSectionFill9(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areasVisible".equals(key)) {
            CONTROL.setAreasVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("areaFill0".equals(key)) {
            CONTROL.setAreaFill0(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill1".equals(key)) {
            CONTROL.setAreaFill1(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill2".equals(key)) {
            CONTROL.setAreaFill2(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill3".equals(key)) {
            CONTROL.setAreaFill3(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill4".equals(key)) {
            CONTROL.setAreaFill4(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill5".equals(key)) {
            CONTROL.setAreaFill5(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill6".equals(key)) {
            CONTROL.setAreaFill6(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill7".equals(key)) {
            CONTROL.setAreaFill7(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill8".equals(key)) {
            CONTROL.setAreaFill8(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill9".equals(key)) {
            CONTROL.setAreaFill9(((ObjectProperty<Color>) properties.get(key)).get());
        }
    }
    return CONTROL;
}
Also used : Dimension2D(javafx.geometry.Dimension2D) Color(javafx.scene.paint.Color) List(java.util.List)

Example 37 with Dimension2D

use of javafx.geometry.Dimension2D in project Board-Instrumentation-Framework by intel.

the class SimpleGaugeBuilder method build.

public final SimpleGauge build() {
    final SimpleGauge CONTROL = new SimpleGauge();
    // Make sure that sections will be added first
    if (properties.keySet().contains("sectionsArray")) {
        CONTROL.setSections(((ObjectProperty<Section[]>) properties.get("sectionsArray")).get());
    } else if (properties.keySet().contains("sectionsList")) {
        CONTROL.setSections(((ObjectProperty<List<Section>>) properties.get("sectionsList")).get());
    }
    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("minSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("maxSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if ("styleClass".equals(key)) {
            CONTROL.getStyleClass().setAll("simple-gauge");
            CONTROL.getStyleClass().addAll(((ObjectProperty<String[]>) properties.get(key)).get());
        } else if ("maxValue".equals(key)) {
            CONTROL.setMaxValue(((DoubleProperty) properties.get(key)).get());
        } else if ("minValue".equals(key)) {
            CONTROL.setMinValue(((DoubleProperty) properties.get(key)).get());
        } else if ("value".equals(key)) {
            CONTROL.setValue(((DoubleProperty) properties.get(key)).get());
        } else if ("decimals".equals(key)) {
            CONTROL.setDecimals(((IntegerProperty) properties.get(key)).get());
        } else if ("title".equals(key)) {
            CONTROL.setTitle(((StringProperty) properties.get(key)).get());
        } else if ("unit".equals(key)) {
            CONTROL.setUnit(((StringProperty) properties.get(key)).get());
        } else if ("sectionTextVisible".equals(key)) {
            CONTROL.setSectionTextVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("sectionIconVisible".equals(key)) {
            CONTROL.setSectionIconVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("animated".equals(key)) {
            CONTROL.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if ("animationDuration".equals(key)) {
            CONTROL.setAnimationDuration(((DoubleProperty) properties.get(key)).get());
        } else if ("startAngle".equals(key)) {
            CONTROL.setStartAngle(((DoubleProperty) properties.get(key)).get());
        } else if ("angleRange".equals(key)) {
            CONTROL.setAngleRange(((DoubleProperty) properties.get(key)).get());
        } else if ("autoScale".equals(key)) {
            CONTROL.setAutoScale(((BooleanProperty) properties.get(key)).get());
        } else if ("needleColor".equals(key)) {
            CONTROL.setNeedleColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("borderColor".equals(key)) {
            CONTROL.setBorderColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("majorTickSpace".equals(key)) {
            CONTROL.setMajorTickSpace(((DoubleProperty) properties.get(key)).get());
        } else if ("minorTickSpace".equals(key)) {
            CONTROL.setMinorTickSpace(((DoubleProperty) properties.get(key)).get());
        } else if ("sectionFill0".equals(key)) {
            CONTROL.setSectionFill0(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill1".equals(key)) {
            CONTROL.setSectionFill1(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill2".equals(key)) {
            CONTROL.setSectionFill2(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill3".equals(key)) {
            CONTROL.setSectionFill3(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill4".equals(key)) {
            CONTROL.setSectionFill4(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill5".equals(key)) {
            CONTROL.setSectionFill5(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill6".equals(key)) {
            CONTROL.setSectionFill6(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill7".equals(key)) {
            CONTROL.setSectionFill7(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill8".equals(key)) {
            CONTROL.setSectionFill8(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill9".equals(key)) {
            CONTROL.setSectionFill9(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("valueTextColor".equals(key)) {
            CONTROL.setValueTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("titleTextColor".equals(key)) {
            CONTROL.setTitleTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionTextColor".equals(key)) {
            CONTROL.setSectionTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("measuredRangeVisible".equals(key)) {
            CONTROL.setMeasuredRangeVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("rangeFill".equals(key)) {
            CONTROL.setRangeFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("valueVisible".equals(key)) {
            CONTROL.setValueVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("titleVisible".equals(key)) {
            CONTROL.setTitleVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("customFontEnabled".equals(key)) {
            CONTROL.setCustomFontEnabled(((BooleanProperty) properties.get(key)).get());
        } else if ("customFont".equals(key)) {
            CONTROL.setCustomFont(((ObjectProperty<Font>) properties.get(key)).get());
        }
    }
    return CONTROL;
}
Also used : ObjectProperty(javafx.beans.property.ObjectProperty) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) IntegerProperty(javafx.beans.property.IntegerProperty) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Dimension2D(javafx.geometry.Dimension2D) Color(javafx.scene.paint.Color) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) Section(eu.hansolo.enzo.common.Section)

Example 38 with Dimension2D

use of javafx.geometry.Dimension2D in project Board-Instrumentation-Framework by intel.

the class FlatGaugeBuilder method build.

public final FlatGauge build() {
    final FlatGauge CONTROL = new FlatGauge();
    properties.forEach((key, property) -> {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("minSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("maxSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if ("opacity".equals(key)) {
            CONTROL.setOpacity(((DoubleProperty) properties.get(key)).get());
        } else if ("styleClass".equals(key)) {
            CONTROL.getStyleClass().setAll("flat-gauge");
            CONTROL.getStyleClass().addAll(((ObjectProperty<String[]>) properties.get(key)).get());
        } else if ("minValue".equals(key)) {
            CONTROL.setMinValue(((DoubleProperty) properties.get(key)).get());
        } else if ("maxValue".equals(key)) {
            CONTROL.setMaxValue(((DoubleProperty) properties.get(key)).get());
        } else if ("value".equals(key)) {
            CONTROL.setValue(((DoubleProperty) properties.get(key)).get());
        } else if ("decimals".equals(key)) {
            CONTROL.setDecimals(((IntegerProperty) properties.get(key)).get());
        } else if ("title".equals(key)) {
            CONTROL.setTitle(((StringProperty) properties.get(key)).get());
        } else if ("unit".equals(key)) {
            CONTROL.setUnit(((StringProperty) properties.get(key)).get());
        } else if ("animationDuration".equals(key)) {
            CONTROL.setAnimationDurationInMs(((IntegerProperty) properties.get(key)).get());
        } else if ("barColor".equals(key)) {
            CONTROL.setBarColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("backgroundColor".equals(key)) {
            CONTROL.setBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("titleTextColor".equals(key)) {
            CONTROL.setTitleTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("valueTextColor".equals(key)) {
            CONTROL.setValueTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("unitTextColor".equals(key)) {
            CONTROL.setUnitTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("separatorColor".equals(key)) {
            CONTROL.setSeparatorColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("multiColor".equals(key)) {
            CONTROL.setMultiColor(((BooleanProperty) properties.get(key)).get());
        } else if ("separatorVisible".equals(key)) {
            CONTROL.setSeparatorVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("colorRingVisible".equals(key)) {
            CONTROL.setColorRingVisible(((BooleanProperty) properties.get(key)).get());
        }
    });
    if (null != stops)
        CONTROL.setGradient(stops);
    return CONTROL;
}
Also used : Dimension2D(javafx.geometry.Dimension2D) Color(javafx.scene.paint.Color)

Example 39 with Dimension2D

use of javafx.geometry.Dimension2D in project Board-Instrumentation-Framework by intel.

the class OneEightyGaugeBuilder method build.

public final OneEightyGauge build() {
    final OneEightyGauge CONTROL = new OneEightyGauge();
    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("minSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("maxSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if ("styleClass".equals(key)) {
            CONTROL.getStyleClass().setAll("one-eighty-gauge");
            CONTROL.getStyleClass().addAll(((ObjectProperty<String[]>) properties.get(key)).get());
        } else if ("maxValue".equals(key)) {
            CONTROL.setMaxValue(((DoubleProperty) properties.get(key)).get());
        } else if ("minValue".equals(key)) {
            CONTROL.setMinValue(((DoubleProperty) properties.get(key)).get());
        } else if ("value".equals(key)) {
            CONTROL.setValue(((DoubleProperty) properties.get(key)).get());
        } else if ("decimals".equals(key)) {
            CONTROL.setDecimals(((IntegerProperty) properties.get(key)).get());
        } else if ("title".equals(key)) {
            CONTROL.setTitle(((StringProperty) properties.get(key)).get());
        } else if ("unit".equals(key)) {
            CONTROL.setUnit(((StringProperty) properties.get(key)).get());
        } else if ("shadowsEnabled".equals(key)) {
            CONTROL.setShadowsEnabled(((BooleanProperty) properties.get(key)).get());
        } else if ("animated".equals(key)) {
            CONTROL.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if ("animationDuration".equals(key)) {
            CONTROL.setAnimationDuration(((DoubleProperty) properties.get(key)).get());
        } else if ("barBackgroundColor".equals(key)) {
            CONTROL.setBarBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("barColor".equals(key)) {
            CONTROL.setBarColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("titleColor".equals(key)) {
            CONTROL.setTitleColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("valueColor".equals(key)) {
            CONTROL.setValueColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("unitColor".equals(key)) {
            CONTROL.setUnitColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("minTextColor".equals(key)) {
            CONTROL.setMinTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("maxTextColor".equals(key)) {
            CONTROL.setMaxTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("dynamicBarColor".equals(key)) {
            CONTROL.setDynamicBarColor(((BooleanProperty) properties.get(key)).get());
        } else if ("stopsArray".equals(key)) {
            CONTROL.setStops(((ObjectProperty<Stop[]>) properties.get(key)).get());
        } else if ("stopsList".equals(key)) {
            CONTROL.setStops(((ObjectProperty<List<Stop>>) properties.get(key)).get());
        } else if ("gradientLookup".equals(key)) {
            CONTROL.setGradientLookup(((ObjectProperty<GradientLookup>) properties.get(key)).get());
        }
    }
    return CONTROL;
}
Also used : ObjectProperty(javafx.beans.property.ObjectProperty) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) IntegerProperty(javafx.beans.property.IntegerProperty) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) Stop(javafx.scene.paint.Stop) BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Dimension2D(javafx.geometry.Dimension2D) Color(javafx.scene.paint.Color) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) List(java.util.List) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty)

Example 40 with Dimension2D

use of javafx.geometry.Dimension2D in project Board-Instrumentation-Framework by intel.

the class LedBargraphBuilder method build.

public final LedBargraph build() {
    final LedBargraph CONTROL = new LedBargraph();
    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("minSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("maxSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("prefWidth".equals(key)) {
            CONTROL.setPrefWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("prefHeight".equals(key)) {
            CONTROL.setPrefHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("minWidth".equals(key)) {
            CONTROL.setMinWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("minHeight".equals(key)) {
            CONTROL.setMinHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("maxWidth".equals(key)) {
            CONTROL.setMaxWidth(((DoubleProperty) properties.get(key)).get());
        } else if ("maxHeight".equals(key)) {
            CONTROL.setMaxHeight(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleX".equals(key)) {
            CONTROL.setScaleX(((DoubleProperty) properties.get(key)).get());
        } else if ("scaleY".equals(key)) {
            CONTROL.setScaleY(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutX".equals(key)) {
            CONTROL.setLayoutX(((DoubleProperty) properties.get(key)).get());
        } else if ("layoutY".equals(key)) {
            CONTROL.setLayoutY(((DoubleProperty) properties.get(key)).get());
        } else if ("translateX".equals(key)) {
            CONTROL.setTranslateX(((DoubleProperty) properties.get(key)).get());
        } else if ("translateY".equals(key)) {
            CONTROL.setTranslateY(((DoubleProperty) properties.get(key)).get());
        } else if ("noOfLeds".equals(key)) {
            CONTROL.setNoOfLeds(((IntegerProperty) properties.get(key)).get());
        } else if ("ledType".equals(key)) {
            CONTROL.setLedType(((ObjectProperty<Led.LedType>) properties.get(key)).get());
        } else if ("orientation".equals(key)) {
            CONTROL.setOrientation(((ObjectProperty<Orientation>) properties.get(key)).get());
        } else if ("peakValueVisible".equals(key)) {
            CONTROL.setPeakValueVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("ledSize".equals(key)) {
            CONTROL.setLedSize(((DoubleProperty) properties.get(key)).get());
        } else if ("ledColorsArray".equals(key)) {
            CONTROL.setLedColors(((ObjectProperty<Color[]>) properties.get(key)).get());
        } else if ("ledColorsList".equals(key)) {
            CONTROL.setLedColors(((ObjectProperty<LinkedList<Color>>) properties.get(key)).get());
        } else if ("ledColor".equals(key)) {
            CONTROL.setLedColor(((IntegerProperty) properties.get("ledColorIndex")).get(), ((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("value".equals(key)) {
            CONTROL.setValue(((DoubleProperty) properties.get(key)).get());
        }
    }
    return CONTROL;
}
Also used : ObjectProperty(javafx.beans.property.ObjectProperty) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) IntegerProperty(javafx.beans.property.IntegerProperty) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) Dimension2D(javafx.geometry.Dimension2D) Color(javafx.scene.paint.Color) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty)

Aggregations

Dimension2D (javafx.geometry.Dimension2D)43 DoubleProperty (javafx.beans.property.DoubleProperty)32 ObjectProperty (javafx.beans.property.ObjectProperty)32 SimpleDoubleProperty (javafx.beans.property.SimpleDoubleProperty)32 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)32 BooleanProperty (javafx.beans.property.BooleanProperty)24 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)24 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)23 StringProperty (javafx.beans.property.StringProperty)23 Color (javafx.scene.paint.Color)22 IntegerProperty (javafx.beans.property.IntegerProperty)12 SimpleIntegerProperty (javafx.beans.property.SimpleIntegerProperty)12 List (java.util.List)7 Section (eu.hansolo.enzo.common.Section)4 VisibleData (eu.hansolo.tilesfx.chart.SunburstChart.VisibleData)2 Orientation (javafx.geometry.Orientation)2 Point2D (javafx.geometry.Point2D)2 Image (javafx.scene.image.Image)2 Stop (javafx.scene.paint.Stop)2 ShapeType (com.almasb.fxgl.physics.box2d.collision.shapes.ShapeType)1