use of javafx.beans.property.StringProperty in project Board-Instrumentation-Framework by intel.
the class RadialBuilder method build.
public final Radial build() {
final Radial CONTROL = new Radial();
// 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());
}
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 ("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 ("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 ("lcdVisible".equals(key)) {
CONTROL.setLcdVisible(((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<Radial.TickLabelOrientation>) properties.get(key)).get());
} else if ("numberFormat".equals(key)) {
CONTROL.setNumberFormat(((ObjectProperty<Radial.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 ("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 ("frameSizeFactor".equals(key)) {
CONTROL.setFrameSizeFactor(((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 ("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;
}
use of javafx.beans.property.StringProperty 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;
}
use of javafx.beans.property.StringProperty 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;
}
use of javafx.beans.property.StringProperty in project bisq-desktop by bisq-network.
the class BindingTest method start.
@Override
public void start(Stage primaryStage) {
VBox root = new VBox();
root.setSpacing(20);
Label label = new AutoTooltipLabel();
StringProperty txt = new SimpleStringProperty();
txt.set("-");
label.textProperty().bind(txt);
Button button = new AutoTooltipButton("count up");
button.setOnAction(e -> txt.set("counter " + counter++));
root.getChildren().addAll(label, button);
primaryStage.setScene(new Scene(root, 400, 400));
primaryStage.show();
}
use of javafx.beans.property.StringProperty in project bisq-desktop by bisq-network.
the class MainViewModel method initP2PNetwork.
// /////////////////////////////////////////////////////////////////////////////////////////
// Initialisation
// /////////////////////////////////////////////////////////////////////////////////////////
private BooleanProperty initP2PNetwork() {
log.info("initP2PNetwork");
StringProperty bootstrapState = new SimpleStringProperty();
StringProperty bootstrapWarning = new SimpleStringProperty();
BooleanProperty hiddenServicePublished = new SimpleBooleanProperty();
BooleanProperty initialP2PNetworkDataReceived = new SimpleBooleanProperty();
p2PNetworkInfoBinding = EasyBind.combine(bootstrapState, bootstrapWarning, p2PService.getNumConnectedPeers(), hiddenServicePublished, initialP2PNetworkDataReceived, (state, warning, numPeers, hiddenService, dataReceived) -> {
String result = "";
int peers = (int) numPeers;
if (warning != null && peers == 0) {
result = warning;
} else {
String p2pInfo = Res.get("mainView.footer.p2pInfo", numPeers);
if (dataReceived && hiddenService) {
result = p2pInfo;
} else if (peers == 0)
result = state;
else
result = state + " / " + p2pInfo;
}
return result;
});
p2PNetworkInfoBinding.subscribe((observable, oldValue, newValue) -> {
p2PNetworkInfo.set(newValue);
});
bootstrapState.set(Res.get("mainView.bootstrapState.connectionToTorNetwork"));
p2PService.getNetworkNode().addConnectionListener(new ConnectionListener() {
@Override
public void onConnection(Connection connection) {
}
@Override
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) {
// Other disconnects might be caused by peers running an older version
if (connection.getPeerType() == Connection.PeerType.SEED_NODE && closeConnectionReason == CloseConnectionReason.RULE_VIOLATION) {
log.warn("RULE_VIOLATION onDisconnect closeConnectionReason=" + closeConnectionReason);
log.warn("RULE_VIOLATION onDisconnect connection=" + connection);
}
}
@Override
public void onError(Throwable throwable) {
}
});
final BooleanProperty p2pNetworkInitialized = new SimpleBooleanProperty();
p2PService.start(new P2PServiceListener() {
@Override
public void onTorNodeReady() {
log.debug("onTorNodeReady");
bootstrapState.set(Res.get("mainView.bootstrapState.torNodeCreated"));
p2PNetworkIconId.set("image-connection-tor");
if (preferences.getUseTorForBitcoinJ())
initWalletService();
// We want to get early connected to the price relay so we call it already now
priceFeedService.setCurrencyCodeOnInit();
priceFeedService.initialRequestPriceFeed();
}
@Override
public void onHiddenServicePublished() {
log.debug("onHiddenServicePublished");
hiddenServicePublished.set(true);
bootstrapState.set(Res.get("mainView.bootstrapState.hiddenServicePublished"));
}
@Override
public void onDataReceived() {
log.debug("onRequestingDataCompleted");
initialP2PNetworkDataReceived.set(true);
bootstrapState.set(Res.get("mainView.bootstrapState.initialDataReceived"));
splashP2PNetworkAnimationVisible.set(false);
p2pNetworkInitialized.set(true);
}
@Override
public void onNoSeedNodeAvailable() {
log.warn("onNoSeedNodeAvailable");
if (p2PService.getNumConnectedPeers().get() == 0)
bootstrapWarning.set(Res.get("mainView.bootstrapWarning.noSeedNodesAvailable"));
else
bootstrapWarning.set(null);
splashP2PNetworkAnimationVisible.set(false);
p2pNetworkInitialized.set(true);
}
@Override
public void onNoPeersAvailable() {
log.warn("onNoPeersAvailable");
if (p2PService.getNumConnectedPeers().get() == 0) {
p2pNetworkWarnMsg.set(Res.get("mainView.p2pNetworkWarnMsg.noNodesAvailable"));
bootstrapWarning.set(Res.get("mainView.bootstrapWarning.noNodesAvailable"));
p2pNetworkLabelId.set("splash-error-state-msg");
} else {
bootstrapWarning.set(null);
p2pNetworkLabelId.set("footer-pane");
}
splashP2PNetworkAnimationVisible.set(false);
p2pNetworkInitialized.set(true);
}
@Override
public void onUpdatedDataReceived() {
log.debug("onBootstrapComplete");
splashP2PNetworkAnimationVisible.set(false);
bootstrapComplete.set(true);
}
@Override
public void onSetupFailed(Throwable throwable) {
log.warn("onSetupFailed");
p2pNetworkWarnMsg.set(Res.get("mainView.p2pNetworkWarnMsg.connectionToP2PFailed", throwable.getMessage()));
splashP2PNetworkAnimationVisible.set(false);
bootstrapWarning.set(Res.get("mainView.bootstrapWarning.bootstrappingToP2PFailed"));
p2pNetworkLabelId.set("splash-error-state-msg");
}
@Override
public void onRequestCustomBridges() {
showTorNetworkSettingsWindow();
}
});
return p2pNetworkInitialized;
}
Aggregations