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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations