Search in sources :

Example 1 with IntegerProperty

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

the class DoubleRadialGaugeBuilder method build.

public final DoubleRadialGauge build() {
    final DoubleRadialGauge CONTROL = new DoubleRadialGauge();
    // Make sure that sections and markers will be added first
    if (properties.keySet().contains("sectionsArrayOne")) {
        CONTROL.setSectionsOne(((ObjectProperty<Section[]>) properties.get("sectionsArrayOne")).get());
    }
    if (properties.keySet().contains("sectionsListOne")) {
        CONTROL.setSectionsOne(((ObjectProperty<List<Section>>) properties.get("sectionsListOne")).get());
    }
    if (properties.keySet().contains("areasArrayOne")) {
        CONTROL.setAreasOne(((ObjectProperty<Section[]>) properties.get("areasArrayOne")).get());
    }
    if (properties.keySet().contains("areasListOne")) {
        CONTROL.setAreasOne(((ObjectProperty<List<Section>>) properties.get("areasListOne")).get());
    }
    if (properties.keySet().contains("sectionsArrayTwo")) {
        CONTROL.setSectionsTwo(((ObjectProperty<Section[]>) properties.get("sectionsArrayTwo")).get());
    }
    if (properties.keySet().contains("sectionsListTwo")) {
        CONTROL.setSectionsTwo(((ObjectProperty<List<Section>>) properties.get("sectionsListTwo")).get());
    }
    if (properties.keySet().contains("areasArrayTwo")) {
        CONTROL.setAreasTwo(((ObjectProperty<Section[]>) properties.get("areasArrayTwo")).get());
    }
    if (properties.keySet().contains("areasListTwo")) {
        CONTROL.setAreasTwo(((ObjectProperty<List<Section>>) properties.get("areasListTwo")).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 ("animated".equals(key)) {
            CONTROL.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if ("dropShadowEnabled".equals(key)) {
            CONTROL.setDropShadowEnabled(((BooleanProperty) properties.get(key)).get());
        } else if ("animationDuration".equals(key)) {
            CONTROL.setAnimationDuration(((DoubleProperty) properties.get(key)).get());
        } else if ("style".equals(key)) {
            CONTROL.setStyle(((StringProperty) properties.get(key)).get());
        } else if ("minValueOne".equals(key)) {
            CONTROL.setMinValueOne(((DoubleProperty) properties.get(key)).get());
        } else if ("maxValueOne".equals(key)) {
            CONTROL.setMaxValueOne(((DoubleProperty) properties.get(key)).get());
        } else if ("valueOne".equals(key)) {
            CONTROL.setValueOne(((DoubleProperty) properties.get(key)).get());
        } else if ("decimalsOne".equals(key)) {
            CONTROL.setDecimalsOne(((IntegerProperty) properties.get(key)).get());
        } else if ("titleOne".equals(key)) {
            CONTROL.setTitleOne(((StringProperty) properties.get(key)).get());
        } else if ("unitOne".equals(key)) {
            CONTROL.setUnitOne(((StringProperty) properties.get(key)).get());
        } else if ("autoScaleOne".equals(key)) {
            CONTROL.setAutoScaleOne(((BooleanProperty) properties.get(key)).get());
        } else if ("needleColorOne".equals(key)) {
            CONTROL.setNeedleColorOne(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("tickLabelOrientationOne".equals(key)) {
            CONTROL.setTickLabelOrientationOne(((ObjectProperty<DoubleRadialGauge.TickLabelOrientation>) properties.get(key)).get());
        } else if ("numberFormatOne".equals(key)) {
            CONTROL.setNumberFormatOne(((ObjectProperty<DoubleRadialGauge.NumberFormat>) properties.get(key)).get());
        } else if ("majorTickSpaceOne".equals(key)) {
            CONTROL.setMajorTickSpaceOne(((DoubleProperty) properties.get(key)).get());
        } else if ("minorTickSpaceOne".equals(key)) {
            CONTROL.setMinorTickSpaceOne(((DoubleProperty) properties.get(key)).get());
        } else if ("tickLabelFill".equals(key)) {
            CONTROL.setTickLabelFillOne(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("tickMarkFillOne".equals(key)) {
            CONTROL.setTickMarkFillOne(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("ledColorOne".equals(key)) {
            CONTROL.setLedColorOne(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("ledVisibleOne".equals(key)) {
            CONTROL.setLedVisibleOne(((BooleanProperty) properties.get(key)).get());
        } else if ("valueVisibleOne".equals(key)) {
            CONTROL.setValueVisibleOne(((BooleanProperty) properties.get(key)).get());
        } else if ("sectionFill0One".equals(key)) {
            CONTROL.setSectionFill0One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill1One".equals(key)) {
            CONTROL.setSectionFill1One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill2One".equals(key)) {
            CONTROL.setSectionFill2One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill3One".equals(key)) {
            CONTROL.setSectionFill3One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill4One".equals(key)) {
            CONTROL.setSectionFill4One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill0One".equals(key)) {
            CONTROL.setAreaFill0One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill1One".equals(key)) {
            CONTROL.setAreaFill1One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill2One".equals(key)) {
            CONTROL.setAreaFill2One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill3One".equals(key)) {
            CONTROL.setAreaFill3One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill4One".equals(key)) {
            CONTROL.setAreaFill4One(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("minValueTwo".equals(key)) {
            CONTROL.setMinValueTwo(((DoubleProperty) properties.get(key)).get());
        } else if ("maxValueTwo".equals(key)) {
            CONTROL.setMaxValueTwo(((DoubleProperty) properties.get(key)).get());
        } else if ("valueTwo".equals(key)) {
            CONTROL.setValueTwo(((DoubleProperty) properties.get(key)).get());
        } else if ("decimalsTwo".equals(key)) {
            CONTROL.setDecimalsTwo(((IntegerProperty) properties.get(key)).get());
        } else if ("titleTwo".equals(key)) {
            CONTROL.setTitleTwo(((StringProperty) properties.get(key)).get());
        } else if ("unitTwo".equals(key)) {
            CONTROL.setUnitTwo(((StringProperty) properties.get(key)).get());
        } else if ("autoScaleTwo".equals(key)) {
            CONTROL.setAutoScaleTwo(((BooleanProperty) properties.get(key)).get());
        } else if ("needleColorTwo".equals(key)) {
            CONTROL.setNeedleColorTwo(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("tickLabelOrientationTwo".equals(key)) {
            CONTROL.setTickLabelOrientationTwo(((ObjectProperty<DoubleRadialGauge.TickLabelOrientation>) properties.get(key)).get());
        } else if ("numberFormatTwo".equals(key)) {
            CONTROL.setNumberFormatTwo(((ObjectProperty<DoubleRadialGauge.NumberFormat>) properties.get(key)).get());
        } else if ("majorTickSpaceTwo".equals(key)) {
            CONTROL.setMajorTickSpaceTwo(((DoubleProperty) properties.get(key)).get());
        } else if ("minorTickSpaceTwo".equals(key)) {
            CONTROL.setMinorTickSpaceTwo(((DoubleProperty) properties.get(key)).get());
        } else if ("tickLabelFill".equals(key)) {
            CONTROL.setTickLabelFillTwo(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("tickMarkFillTwo".equals(key)) {
            CONTROL.setTickMarkFillTwo(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("ledColorTwo".equals(key)) {
            CONTROL.setLedColorTwo(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("ledVisibleTwo".equals(key)) {
            CONTROL.setLedVisibleTwo(((BooleanProperty) properties.get(key)).get());
        } else if ("valueVisibleTwo".equals(key)) {
            CONTROL.setValueVisibleTwo(((BooleanProperty) properties.get(key)).get());
        } else if ("sectionFill0Two".equals(key)) {
            CONTROL.setSectionFill0Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill1Two".equals(key)) {
            CONTROL.setSectionFill1Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill2Two".equals(key)) {
            CONTROL.setSectionFill2Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill3Two".equals(key)) {
            CONTROL.setSectionFill3Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("sectionFill4Two".equals(key)) {
            CONTROL.setSectionFill4Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill0Two".equals(key)) {
            CONTROL.setAreaFill0Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill1Two".equals(key)) {
            CONTROL.setAreaFill1Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill2Two".equals(key)) {
            CONTROL.setAreaFill2Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill3Two".equals(key)) {
            CONTROL.setAreaFill3Two(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("areaFill4Two".equals(key)) {
            CONTROL.setAreaFill4Two(((ObjectProperty<Color>) 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) List(java.util.List) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty)

Example 2 with IntegerProperty

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

the class RectangularGaugeBuilder method build.

public final RectangularGauge build() {
    final RectangularGauge CONTROL = new RectangularGauge();
    // 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());
    }
    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 ("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<RectangularGauge.TickLabelOrientation>) properties.get(key)).get());
        } else if ("numberFormat".equals(key)) {
            CONTROL.setNumberFormat(((ObjectProperty<RectangularGauge.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());
        }
    }
    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) List(java.util.List) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty)

Example 3 with IntegerProperty

use of javafx.beans.property.IntegerProperty 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 4 with IntegerProperty

use of javafx.beans.property.IntegerProperty in project bisq-desktop by bisq-network.

the class TradeDetailsWindow method addContent.

private void addContent() {
    Offer offer = trade.getOffer();
    Contract contract = trade.getContract();
    int rows = 5;
    addTitledGroupBg(gridPane, ++rowIndex, rows, Res.get("tradeDetailsWindow.headline"));
    boolean myOffer = tradeManager.isMyOffer(offer);
    String fiatDirectionInfo;
    String btcDirectionInfo;
    String toReceive = " " + Res.get("shared.toReceive");
    String toSpend = " " + Res.get("shared.toSpend");
    String offerType = Res.getWithCol("shared.offerType");
    if (tradeManager.isBuyer(offer)) {
        addLabelTextField(gridPane, rowIndex, offerType, formatter.getDirectionForBuyer(myOffer, offer.getCurrencyCode()), Layout.FIRST_ROW_DISTANCE);
        fiatDirectionInfo = toSpend;
        btcDirectionInfo = toReceive;
    } else {
        addLabelTextField(gridPane, rowIndex, offerType, formatter.getDirectionForSeller(myOffer, offer.getCurrencyCode()), Layout.FIRST_ROW_DISTANCE);
        fiatDirectionInfo = toReceive;
        btcDirectionInfo = toSpend;
    }
    addLabelTextField(gridPane, ++rowIndex, Res.get("shared.btcAmount") + btcDirectionInfo, formatter.formatCoinWithCode(trade.getTradeAmount()));
    addLabelTextField(gridPane, ++rowIndex, formatter.formatVolumeLabel(offer.getCurrencyCode()) + fiatDirectionInfo, formatter.formatVolumeWithCode(trade.getTradeVolume()));
    addLabelTextField(gridPane, ++rowIndex, Res.get("shared.tradePrice"), formatter.formatPrice(trade.getTradePrice()));
    addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.paymentMethod"), Res.get(offer.getPaymentMethod().getId()));
    // second group
    rows = 6;
    PaymentAccountPayload buyerPaymentAccountPayload = null;
    PaymentAccountPayload sellerPaymentAccountPayload = null;
    if (contract != null) {
        rows++;
        buyerPaymentAccountPayload = contract.getBuyerPaymentAccountPayload();
        sellerPaymentAccountPayload = contract.getSellerPaymentAccountPayload();
        if (buyerPaymentAccountPayload != null)
            rows++;
        if (sellerPaymentAccountPayload != null)
            rows++;
        if (buyerPaymentAccountPayload == null && sellerPaymentAccountPayload == null)
            rows++;
    }
    if (trade.getTakerFeeTxId() != null)
        rows++;
    if (trade.getDepositTx() != null)
        rows++;
    if (trade.getPayoutTx() != null)
        rows++;
    boolean showDisputedTx = disputeManager.findOwnDispute(trade.getId()).isPresent() && disputeManager.findOwnDispute(trade.getId()).get().getDisputePayoutTxId() != null;
    if (showDisputedTx)
        rows++;
    if (trade.hasFailed())
        rows += 2;
    if (trade.getTradingPeerNodeAddress() != null)
        rows++;
    addTitledGroupBg(gridPane, ++rowIndex, rows, Res.get("shared.details"), Layout.GROUP_DISTANCE);
    addLabelTextFieldWithCopyIcon(gridPane, rowIndex, Res.get("shared.tradeId"), trade.getId(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(gridPane, ++rowIndex, Res.get("tradeDetailsWindow.tradeDate"), formatter.formatDateTime(trade.getDate()));
    String securityDeposit = Res.getWithColAndCap("shared.buyer") + " " + formatter.formatCoinWithCode(offer.getBuyerSecurityDeposit()) + " / " + Res.getWithColAndCap("shared.seller") + " " + formatter.formatCoinWithCode(offer.getSellerSecurityDeposit());
    addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.securityDeposit"), securityDeposit);
    String txFee = Res.get("shared.makerTxFee", formatter.formatCoinWithCode(offer.getTxFee())) + " / " + Res.get("shared.takerTxFee", formatter.formatCoinWithCode(offer.getTxFee().multiply(3L)));
    addLabelTextField(gridPane, ++rowIndex, Res.get("tradeDetailsWindow.txFee"), txFee);
    if (trade.getArbitratorNodeAddress() != null)
        addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.arbitrator"), trade.getArbitratorNodeAddress().getFullAddress());
    if (trade.getTradingPeerNodeAddress() != null)
        addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("tradeDetailsWindow.tradingPeersOnion"), trade.getTradingPeerNodeAddress().getFullAddress());
    if (contract != null) {
        if (buyerPaymentAccountPayload != null) {
            TextFieldWithCopyIcon tf = addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.paymentDetails", Res.get("shared.buyer")), buyerPaymentAccountPayload.getPaymentDetails()).second;
            tf.setTooltip(new Tooltip(tf.getText()));
        }
        if (sellerPaymentAccountPayload != null) {
            TextFieldWithCopyIcon tf = addLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.paymentDetails", Res.get("shared.seller")), sellerPaymentAccountPayload.getPaymentDetails()).second;
            tf.setTooltip(new Tooltip(tf.getText()));
        }
        if (buyerPaymentAccountPayload == null && sellerPaymentAccountPayload == null)
            addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.paymentMethod"), Res.get(contract.getPaymentMethodId()));
    }
    addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerFeeTxId"), offer.getOfferFeePaymentTxId());
    if (trade.getTakerFeeTxId() != null)
        addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerFeeTxId"), trade.getTakerFeeTxId());
    if (trade.getDepositTx() != null)
        addLabelTxIdTextField(gridPane, ++rowIndex, Res.getWithCol("shared.depositTransactionId"), trade.getDepositTx().getHashAsString());
    if (trade.getPayoutTx() != null)
        addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.payoutTxId"), trade.getPayoutTx().getHashAsString());
    if (showDisputedTx)
        addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("tradeDetailsWindow.disputedPayoutTxId"), disputeManager.findOwnDispute(trade.getId()).get().getDisputePayoutTxId());
    if (contract != null) {
        Button viewContractButton = addLabelButton(gridPane, ++rowIndex, Res.get("shared.contractAsJson"), Res.get("shared.viewContractAsJson"), 0).second;
        viewContractButton.setDefaultButton(false);
        viewContractButton.setOnAction(e -> {
            TextArea textArea = new TextArea();
            textArea.setText(trade.getContractAsJson());
            String contractAsJson = trade.getContractAsJson();
            contractAsJson += "\n\nBuyerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getBuyerMultiSigPubKey());
            contractAsJson += "\nSellerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getSellerMultiSigPubKey());
            textArea.setText(contractAsJson);
            textArea.setPrefHeight(50);
            textArea.setEditable(false);
            textArea.setWrapText(true);
            textArea.setPrefSize(800, 600);
            Scene viewContractScene = new Scene(textArea);
            Stage viewContractStage = new Stage();
            viewContractStage.setTitle(Res.get("shared.contract.title", trade.getShortId()));
            viewContractStage.setScene(viewContractScene);
            if (owner == null)
                owner = MainView.getRootContainer();
            Scene rootScene = owner.getScene();
            viewContractStage.initOwner(rootScene.getWindow());
            viewContractStage.initModality(Modality.NONE);
            viewContractStage.initStyle(StageStyle.UTILITY);
            viewContractStage.show();
            Window window = rootScene.getWindow();
            double titleBarHeight = window.getHeight() - rootScene.getHeight();
            viewContractStage.setX(Math.round(window.getX() + (owner.getWidth() - viewContractStage.getWidth()) / 2) + 200);
            viewContractStage.setY(Math.round(window.getY() + titleBarHeight + (owner.getHeight() - viewContractStage.getHeight()) / 2) + 50);
        });
    }
    if (trade.hasFailed()) {
        textArea = addLabelTextArea(gridPane, ++rowIndex, Res.get("shared.errorMessage"), "").second;
        textArea.setText(trade.getErrorMessage());
        textArea.setEditable(false);
        IntegerProperty count = new SimpleIntegerProperty(20);
        int rowHeight = 10;
        textArea.prefHeightProperty().bindBidirectional(count);
        changeListener = (ov, old, newVal) -> {
            if (newVal.intValue() > rowHeight)
                count.setValue(count.get() + newVal.intValue() + 10);
        };
        textArea.scrollTopProperty().addListener(changeListener);
        textArea.setScrollTop(30);
        TextField state = addLabelTextField(gridPane, ++rowIndex, Res.get("tradeDetailsWindow.tradeState")).second;
        state.setText(trade.getState().getPhase().name());
    }
    Button closeButton = addButtonAfterGroup(gridPane, ++rowIndex, Res.get("shared.close"));
    // TODO app wide focus
    // closeButton.requestFocus();
    closeButton.setOnAction(e -> {
        closeHandlerOptional.ifPresent(Runnable::run);
        hide();
    });
}
Also used : Window(javafx.stage.Window) IntegerProperty(javafx.beans.property.IntegerProperty) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) TextArea(javafx.scene.control.TextArea) TextFieldWithCopyIcon(bisq.desktop.components.TextFieldWithCopyIcon) Tooltip(javafx.scene.control.Tooltip) PaymentAccountPayload(bisq.core.payment.payload.PaymentAccountPayload) Scene(javafx.scene.Scene) Offer(bisq.core.offer.Offer) Button(javafx.scene.control.Button) Stage(javafx.stage.Stage) TextField(javafx.scene.control.TextField) Contract(bisq.core.trade.Contract) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty)

Example 5 with IntegerProperty

use of javafx.beans.property.IntegerProperty in project tilesfx by HanSolo.

the class PixelMatrixBuilder method build.

public final PixelMatrix build() {
    final PixelMatrix CONTROL;
    if (properties.keySet().contains("cols") && properties.keySet().contains("rows")) {
        int cols = ((IntegerProperty) properties.get("cols")).get();
        int rows = ((IntegerProperty) properties.get("rows")).get();
        CONTROL = new PixelMatrix(cols, rows);
    } else {
        CONTROL = new PixelMatrix();
    }
    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.setMinSize(dim.getWidth(), dim.getHeight());
        } else if ("maxSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setMaxSize(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 ("padding".equals(key)) {
            CONTROL.setPadding(((ObjectProperty<Insets>) properties.get(key)).get());
        } else if ("pixelOnColor".equals(key)) {
            CONTROL.setPixelOnColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("pixelOffColor".equals(key)) {
            CONTROL.setPixelOffColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("pixelShape".equals(key)) {
            CONTROL.setPixelShape(((ObjectProperty<PixelShape>) properties.get(key)).get());
        } else if ("matrixFont".equals(key)) {
            CONTROL.setMatrixFont(((ObjectProperty<MatrixFont>) properties.get(key)).get());
        } else if ("useSpacer".equals(key)) {
            CONTROL.setUseSpacer(((BooleanProperty) properties.get(key)).get());
        } else if ("spacerSizeFactor".equals(key)) {
            CONTROL.setSpacerSizeFactor(((DoubleProperty) properties.get(key)).get());
        } else if ("squarePixels".equals(key)) {
            CONTROL.setSquarePixels(((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) Color(javafx.scene.paint.Color) DoubleProperty(javafx.beans.property.DoubleProperty) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) PixelShape(eu.hansolo.tilesfx.chart.PixelMatrix.PixelShape)

Aggregations

IntegerProperty (javafx.beans.property.IntegerProperty)23 SimpleIntegerProperty (javafx.beans.property.SimpleIntegerProperty)22 DoubleProperty (javafx.beans.property.DoubleProperty)12 ObjectProperty (javafx.beans.property.ObjectProperty)12 SimpleDoubleProperty (javafx.beans.property.SimpleDoubleProperty)12 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)12 Dimension2D (javafx.geometry.Dimension2D)12 Color (javafx.scene.paint.Color)10 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)9 StringProperty (javafx.beans.property.StringProperty)9 BooleanProperty (javafx.beans.property.BooleanProperty)8 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)8 List (java.util.List)5 MockedProperty (com.canoo.dp.impl.remoting.MockedProperty)2 Binding (com.canoo.platform.core.functional.Binding)2 VisibleData (eu.hansolo.tilesfx.chart.SunburstChart.VisibleData)2 Scene (javafx.scene.Scene)2 Button (javafx.scene.control.Button)2 Test (org.testng.annotations.Test)2 Offer (bisq.core.offer.Offer)1