use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.
the class FormBuilder method addButton.
public static Button addButton(GridPane gridPane, int rowIndex, String title, double top) {
Button button = new AutoTooltipButton(title);
button.setDefaultButton(true);
GridPane.setRowIndex(button, rowIndex);
GridPane.setColumnIndex(button, 1);
gridPane.getChildren().add(button);
GridPane.setMargin(button, new Insets(top, 0, 0, 0));
return button;
}
use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.
the class FormBuilder method add2Buttons.
public static Tuple2<Button, Button> add2Buttons(GridPane gridPane, int rowIndex, String title1, String title2, double top) {
HBox hBox = new HBox();
hBox.setSpacing(10);
Button button1 = new AutoTooltipButton(title1);
button1.setDefaultButton(true);
Button button2 = new AutoTooltipButton(title2);
hBox.getChildren().addAll(button1, button2);
GridPane.setRowIndex(hBox, rowIndex);
GridPane.setColumnIndex(hBox, 1);
GridPane.setMargin(hBox, new Insets(top, 10, 0, 0));
gridPane.getChildren().add(hBox);
return new Tuple2<>(button1, button2);
}
use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.
the class MainView method createSplashScreen.
private VBox createSplashScreen() {
VBox vBox = new VBox();
vBox.setAlignment(Pos.CENTER);
vBox.setSpacing(0);
vBox.setId("splash");
ImageView logo = new ImageView();
logo.setId("image-splash-logo");
// createBitcoinInfoBox
btcSplashInfo = new AutoTooltipLabel();
btcSplashInfo.textProperty().bind(model.btcInfo);
walletServiceErrorMsgListener = (ov, oldValue, newValue) -> {
btcSplashInfo.setId("splash-error-state-msg");
btcSplashInfo.getStyleClass().add("error-text");
};
model.walletServiceErrorMsg.addListener(walletServiceErrorMsgListener);
btcSyncIndicator = new ProgressBar();
btcSyncIndicator.setPrefWidth(120);
btcSyncIndicator.progressProperty().bind(model.btcSyncProgress);
ImageView btcSyncIcon = new ImageView();
btcSyncIcon.setVisible(false);
btcSyncIcon.setManaged(false);
btcSyncIconIdListener = (ov, oldValue, newValue) -> {
btcSyncIcon.setId(newValue);
btcSyncIcon.setVisible(true);
btcSyncIcon.setManaged(true);
btcSyncIndicator.setVisible(false);
btcSyncIndicator.setManaged(false);
};
model.btcSplashSyncIconId.addListener(btcSyncIconIdListener);
HBox blockchainSyncBox = new HBox();
blockchainSyncBox.setSpacing(10);
blockchainSyncBox.setAlignment(Pos.CENTER);
blockchainSyncBox.setPadding(new Insets(40, 0, 0, 0));
blockchainSyncBox.setPrefHeight(50);
blockchainSyncBox.getChildren().addAll(btcSplashInfo, btcSyncIndicator, btcSyncIcon);
// create P2PNetworkBox
splashP2PNetworkLabel = new AutoTooltipLabel();
splashP2PNetworkLabel.setWrapText(true);
splashP2PNetworkLabel.setMaxWidth(500);
splashP2PNetworkLabel.setTextAlignment(TextAlignment.CENTER);
splashP2PNetworkLabel.textProperty().bind(model.p2PNetworkInfo);
splashP2PNetworkBusyAnimation = new BusyAnimation();
splashP2PNetworkErrorMsgListener = (ov, oldValue, newValue) -> {
if (newValue != null) {
splashP2PNetworkLabel.setId("splash-error-state-msg");
splashP2PNetworkLabel.getStyleClass().add("error-text");
splashP2PNetworkBusyAnimation.stop();
} else if (model.splashP2PNetworkAnimationVisible.get()) {
splashP2PNetworkBusyAnimation.play();
}
};
model.p2pNetworkWarnMsg.addListener(splashP2PNetworkErrorMsgListener);
Button showTorNetworkSettingsButton = new AutoTooltipButton(Res.get("settings.net.openTorSettingsButton"));
showTorNetworkSettingsButton.setVisible(false);
showTorNetworkSettingsButton.setManaged(false);
showTorNetworkSettingsButton.setOnAction(e -> {
model.torNetworkSettingsWindow.show();
});
ImageView splashP2PNetworkIcon = new ImageView();
splashP2PNetworkIcon.setId("image-connection-tor");
splashP2PNetworkIcon.setVisible(false);
splashP2PNetworkIcon.setManaged(false);
HBox.setMargin(splashP2PNetworkIcon, new Insets(0, 0, 5, 0));
Timer showTorNetworkSettingsTimer = UserThread.runAfter(() -> {
showTorNetworkSettingsButton.setVisible(true);
showTorNetworkSettingsButton.setManaged(true);
}, SHOW_TOR_SETTINGS_DELAY_SEC);
splashP2PNetworkIconIdListener = (ov, oldValue, newValue) -> {
splashP2PNetworkIcon.setId(newValue);
splashP2PNetworkIcon.setVisible(true);
splashP2PNetworkIcon.setManaged(true);
// if we can connect in 10 sec. we know that tor is working
showTorNetworkSettingsTimer.stop();
};
model.p2PNetworkIconId.addListener(splashP2PNetworkIconIdListener);
splashP2PNetworkVisibleListener = (ov, oldValue, newValue) -> splashP2PNetworkBusyAnimation.setIsRunning(newValue);
model.splashP2PNetworkAnimationVisible.addListener(splashP2PNetworkVisibleListener);
HBox splashP2PNetworkBox = new HBox();
splashP2PNetworkBox.setSpacing(10);
splashP2PNetworkBox.setAlignment(Pos.CENTER);
splashP2PNetworkBox.setPrefHeight(50);
splashP2PNetworkBox.getChildren().addAll(splashP2PNetworkLabel, splashP2PNetworkBusyAnimation, splashP2PNetworkIcon, showTorNetworkSettingsButton);
vBox.getChildren().addAll(logo, blockchainSyncBox, splashP2PNetworkBox);
return vBox;
}
use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.
the class MainView method getMarketPriceBox.
private Tuple2<ComboBox<PriceFeedComboBoxItem>, VBox> getMarketPriceBox() {
ComboBox<PriceFeedComboBoxItem> priceComboBox = new ComboBox<>();
priceComboBox.setVisibleRowCount(20);
priceComboBox.setMaxWidth(220);
priceComboBox.setMinWidth(220);
priceComboBox.setFocusTraversable(false);
priceComboBox.setId("price-feed-combo");
priceComboBox.setCellFactory(p -> getPriceFeedComboBoxListCell());
ListCell<PriceFeedComboBoxItem> buttonCell = getPriceFeedComboBoxListCell();
buttonCell.setId("price-feed-combo");
priceComboBox.setButtonCell(buttonCell);
final ImageView btcAverageIcon = new ImageView();
btcAverageIcon.setId("btcaverage");
final Button btcAverageIconButton = new AutoTooltipButton("", btcAverageIcon);
btcAverageIconButton.setPadding(new Insets(-1, 0, -1, 0));
btcAverageIconButton.setFocusTraversable(false);
btcAverageIconButton.getStyleClass().add("hidden-icon-button");
HBox.setMargin(btcAverageIconButton, new Insets(0, 5, 0, 0));
btcAverageIconButton.setOnAction(e -> GUIUtil.openWebPage("https://bitcoinaverage.com"));
btcAverageIconButton.setVisible(model.isFiatCurrencyPriceFeedSelected.get());
btcAverageIconButton.setManaged(btcAverageIconButton.isVisible());
btcAverageIconButton.visibleProperty().bind(model.isFiatCurrencyPriceFeedSelected);
btcAverageIconButton.managedProperty().bind(model.isFiatCurrencyPriceFeedSelected);
btcAverageIconButton.setOnMouseEntered(e -> {
String res = Res.get("mainView.marketPrice.tooltip", "https://bitcoinaverage.com", "", formatter.formatTime(model.priceFeedService.getLastRequestTimeStampBtcAverage()), model.priceFeedService.getProviderNodeAddress());
btcAverageIconButton.setTooltip(new Tooltip(res));
});
final ImageView poloniexIcon = new ImageView();
poloniexIcon.setId("poloniex");
final Button poloniexIconButton = new AutoTooltipButton("", poloniexIcon);
poloniexIconButton.setPadding(new Insets(-3, 0, -3, 0));
poloniexIconButton.setFocusTraversable(false);
poloniexIconButton.getStyleClass().add("hidden-icon-button");
HBox.setMargin(poloniexIconButton, new Insets(2, 3, 0, 0));
poloniexIconButton.setOnAction(e -> GUIUtil.openWebPage("https://poloniex.com"));
poloniexIconButton.setVisible(model.isCryptoCurrencyPriceFeedSelected.get());
poloniexIconButton.setManaged(poloniexIconButton.isVisible());
poloniexIconButton.visibleProperty().bind(model.isCryptoCurrencyPriceFeedSelected);
poloniexIconButton.managedProperty().bind(model.isCryptoCurrencyPriceFeedSelected);
poloniexIconButton.setOnMouseEntered(e -> {
String altcoinExtra = "\n" + Res.get("mainView.marketPrice.tooltip.altcoinExtra");
String res = Res.get("mainView.marketPrice.tooltip", "https://poloniex.com", altcoinExtra, formatter.formatTime(model.priceFeedService.getLastRequestTimeStampPoloniex()), model.priceFeedService.getProviderNodeAddress());
poloniexIconButton.setTooltip(new Tooltip(res));
});
Label label = new AutoTooltipLabel(Res.get("mainView.marketPrice.provider"));
label.setId("nav-balance-label");
label.setPadding(new Insets(0, 5, 0, 2));
model.marketPriceUpdated.addListener((observable, oldValue, newValue) -> {
updateMarketPriceLabel(label);
});
HBox hBox2 = new HBox();
hBox2.getChildren().setAll(label, btcAverageIconButton, poloniexIconButton);
VBox vBox = new VBox();
vBox.setSpacing(3);
vBox.setPadding(new Insets(11, 0, 0, 0));
vBox.getChildren().addAll(priceComboBox, hBox2);
return new Tuple2<>(priceComboBox, vBox);
}
use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.
the class FiatAccountsView method buildForm.
// /////////////////////////////////////////////////////////////////////////////////////////
// Base form
// /////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
addTitledGroupBg(root, gridRow, 1, Res.get("shared.manageAccounts"));
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, Res.get("account.fiat.yourFiatAccounts"), Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
tuple.first.setTextAlignment(TextAlignment.RIGHT);
// noinspection unchecked
paymentAccountsListView = tuple.second;
paymentAccountsListView.setPrefHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
paymentAccountsListView.setCellFactory(new Callback<ListView<PaymentAccount>, ListCell<PaymentAccount>>() {
@Override
public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) {
return new ListCell<PaymentAccount>() {
final Label label = new AutoTooltipLabel();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new AutoTooltipButton("", icon);
final AnchorPane pane = new AnchorPane(label, removeButton);
{
label.setLayoutY(5);
removeButton.setId("icon-button");
AnchorPane.setRightAnchor(removeButton, 0d);
}
@Override
public void updateItem(final PaymentAccount item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
label.setText(item.getAccountName());
removeButton.setOnAction(e -> onDeleteAccount(item));
setGraphic(pane);
} else {
setGraphic(null);
}
}
};
}
});
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"), Res.get("shared.ExportAccounts"), Res.get("shared.importAccounts"));
addAccountButton = tuple3.first;
exportButton = tuple3.second;
importButton = tuple3.third;
}
Aggregations