Search in sources :

Example 11 with StringProperty

use of javafx.beans.property.StringProperty in project Board-Instrumentation-Framework by intel.

the class SimpleIndicatorBuilder method build.

public final SimpleIndicator build() {
    final SimpleIndicator CONTROL = new SimpleIndicator();
    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("indicator", ((StringProperty) properties.get(key)).get());
        } else if ("indicatorStyle".equals(key)) {
            CONTROL.setIndicatorStyle(((ObjectProperty<SimpleIndicator.IndicatorStyle>) properties.get(key)).get());
        }
    }
    return CONTROL;
}
Also used : ObjectProperty(javafx.beans.property.ObjectProperty) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) Dimension2D(javafx.geometry.Dimension2D) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) DoubleProperty(javafx.beans.property.DoubleProperty)

Example 12 with StringProperty

use of javafx.beans.property.StringProperty in project Board-Instrumentation-Framework by intel.

the class SevenSegmentBuilder method build.

public final SevenSegment build() {
    final SevenSegment CONTROL = new SevenSegment();
    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("seven-segment", ((StringProperty) properties.get(key)).get());
        } else if ("segmentStyle".equals(key)) {
            CONTROL.setSegmentStyle(((ObjectProperty<SevenSegment.SegmentStyle>) properties.get(key)).get());
        } else if ("characterString".equals(key)) {
            CONTROL.setCharacter(((StringProperty) properties.get(key)).get());
        } else if ("characterChar".equals(key)) {
            CONTROL.setCharacter(((ObjectProperty<Character>) properties.get(key)).get());
        } else if ("characterInt".equals(key)) {
            CONTROL.setCharacter(((IntegerProperty) properties.get(key)).get());
        } else if ("dotOn".equals(key)) {
            CONTROL.setDotOn(((BooleanProperty) 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) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty)

Example 13 with StringProperty

use of javafx.beans.property.StringProperty in project Board-Instrumentation-Framework by intel.

the class SplitFlapBuilder method build.

public final SplitFlap build() {
    final SplitFlap CONTROL;
    if (properties.containsKey("selection")) {
        if (properties.containsKey("text")) {
            CONTROL = new SplitFlap(((ObjectProperty<String[]>) properties.get("selection")).get(), ((StringProperty) properties.get("text")).get());
        } else {
            CONTROL = new SplitFlap(((ObjectProperty<String[]>) properties.get("selection")).get(), ((ObjectProperty<String[]>) properties.get("selection")).get()[0]);
        }
    } else {
        CONTROL = new SplitFlap();
    }
    for (String key : properties.keySet()) {
        if ("keepAspect".equals(key)) {
            CONTROL.setKeepAspect(((BooleanProperty) properties.get(key)).get());
        } else if ("flipTime".equals(key)) {
            CONTROL.setFlipTime(((DoubleProperty) properties.get(key)).get());
        } else if ("wordMode".equals(key)) {
            CONTROL.setWordMode(((BooleanProperty) properties.get(key)).get());
        } else if ("withFixture".equals(key)) {
            CONTROL.setWithFixture(((BooleanProperty) properties.get(key)).get());
        } else if ("darkFixture".equals(key)) {
            CONTROL.setDarkFixture(((BooleanProperty) properties.get(key)).get());
        } else if ("squareFlaps".equals(key)) {
            CONTROL.setSquareFlaps(((BooleanProperty) properties.get(key)).get());
        } else if ("flapColor".equals(key)) {
            CONTROL.setFlapColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("textColor".equals(key)) {
            CONTROL.setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("text".equals(key)) {
            CONTROL.setText(((StringProperty) properties.get(key)).get());
        } else if ("selection".equals(key)) {
            CONTROL.setSelection(((ObjectProperty<String[]>) properties.get(key)).get());
        } else 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());
        }
    }
    return CONTROL;
}
Also used : ObjectProperty(javafx.beans.property.ObjectProperty) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Color(javafx.scene.paint.Color) Dimension2D(javafx.geometry.Dimension2D) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) DoubleProperty(javafx.beans.property.DoubleProperty)

Example 14 with StringProperty

use of javafx.beans.property.StringProperty in project Board-Instrumentation-Framework by intel.

the class VuMeterBuilder method build.

public final VuMeter build() {
    final VuMeter CONTROL = new VuMeter();
    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("led", ((StringProperty) properties.get(key)).get());
        } else if ("noOfLeds".equals(key)) {
            CONTROL.setNoOfLeds(((IntegerProperty) 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 ("value".equals(key)) {
            CONTROL.setValue(((DoubleProperty) properties.get(key)).get());
        } else if ("sections".equals(key)) {
            CONTROL.setSections(((ListProperty<Section>) properties.get(key)).get());
        } else if ("interactive".equals(key)) {
            CONTROL.setInteractive(((BooleanProperty) properties.get(key)).get());
        }
    }
    return CONTROL;
}
Also used : ObjectProperty(javafx.beans.property.ObjectProperty) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Dimension2D(javafx.geometry.Dimension2D) 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 15 with StringProperty

use of javafx.beans.property.StringProperty in project dolphin-platform by canoo.

the class FXBinderTest method testJavaFXStringUnidirectional.

@Test
public void testJavaFXStringUnidirectional() {
    Property<String> stringDolphinProperty = new MockedProperty<>();
    StringProperty stringJavaFXProperty = new SimpleStringProperty();
    WritableStringValue writableStringValue = new SimpleStringProperty();
    stringDolphinProperty.set("Hello");
    assertNotEquals(stringJavaFXProperty.get(), "Hello");
    Binding binding = FXBinder.bind(stringJavaFXProperty).to(stringDolphinProperty);
    assertEquals(stringJavaFXProperty.get(), "Hello");
    stringDolphinProperty.set("Hello JavaFX");
    assertEquals(stringJavaFXProperty.get(), "Hello JavaFX");
    stringDolphinProperty.set(null);
    assertEquals(stringJavaFXProperty.get(), null);
    binding.unbind();
    stringDolphinProperty.set("Hello JavaFX");
    assertEquals(stringJavaFXProperty.get(), null);
    binding = FXBinder.bind(writableStringValue).to(stringDolphinProperty);
    assertEquals(writableStringValue.get(), "Hello JavaFX");
    stringDolphinProperty.set("Dolphin Platform");
    assertEquals(writableStringValue.get(), "Dolphin Platform");
    stringDolphinProperty.set(null);
    assertEquals(writableStringValue.get(), null);
    binding.unbind();
    stringDolphinProperty.set("Dolphin Platform");
    assertEquals(writableStringValue.get(), null);
}
Also used : Binding(com.canoo.platform.core.functional.Binding) MockedProperty(com.canoo.dp.impl.remoting.MockedProperty) WritableStringValue(javafx.beans.value.WritableStringValue) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) Test(org.testng.annotations.Test)

Aggregations

StringProperty (javafx.beans.property.StringProperty)40 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)37 DoubleProperty (javafx.beans.property.DoubleProperty)26 SimpleDoubleProperty (javafx.beans.property.SimpleDoubleProperty)25 ObjectProperty (javafx.beans.property.ObjectProperty)24 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)24 Dimension2D (javafx.geometry.Dimension2D)23 BooleanProperty (javafx.beans.property.BooleanProperty)20 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)20 SimpleIntegerProperty (javafx.beans.property.SimpleIntegerProperty)14 Color (javafx.scene.paint.Color)14 IntegerProperty (javafx.beans.property.IntegerProperty)11 List (java.util.List)8 MockedProperty (com.canoo.dp.impl.remoting.MockedProperty)4 Binding (com.canoo.platform.core.functional.Binding)4 Section (eu.hansolo.enzo.common.Section)4 IOException (java.io.IOException)4 Test (org.testng.annotations.Test)4 ChunkWrapper (com.kyj.fx.voeditor.visual.diff.ChunkWrapper)3 CompareResult (com.kyj.fx.voeditor.visual.diff.CompareResult)3