Search in sources :

Example 1 with AutoTooltipButton

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;
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 2 with AutoTooltipButton

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);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Tuple2(bisq.common.util.Tuple2) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 3 with AutoTooltipButton

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;
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) BusyAnimation(bisq.desktop.components.BusyAnimation) Timer(bisq.common.Timer) Button(javafx.scene.control.Button) ToggleButton(javafx.scene.control.ToggleButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AutoTooltipToggleButton(bisq.desktop.components.AutoTooltipToggleButton) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) VBox(javafx.scene.layout.VBox) ProgressBar(javafx.scene.control.ProgressBar) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 4 with AutoTooltipButton

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);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) ComboBox(javafx.scene.control.ComboBox) Tooltip(javafx.scene.control.Tooltip) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Button(javafx.scene.control.Button) ToggleButton(javafx.scene.control.ToggleButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AutoTooltipToggleButton(bisq.desktop.components.AutoTooltipToggleButton) Tuple2(bisq.common.util.Tuple2) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) VBox(javafx.scene.layout.VBox)

Example 5 with AutoTooltipButton

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;
}
Also used : Button(javafx.scene.control.Button) PopmoneyValidator(bisq.desktop.util.validation.PopmoneyValidator) Coin(org.bitcoinj.core.Coin) ListCell(javafx.scene.control.ListCell) Layout(bisq.desktop.util.Layout) BSFormatter(bisq.desktop.util.BSFormatter) PaymentAccountFactory(bisq.core.payment.PaymentAccountFactory) WesternUnionAccount(bisq.core.payment.WesternUnionAccount) ComboBox(javafx.scene.control.ComboBox) Res(bisq.core.locale.Res) MoneyBeamValidator(bisq.desktop.util.validation.MoneyBeamValidator) BICValidator(bisq.desktop.util.validation.BICValidator) AliPayForm(bisq.desktop.components.paymentmethods.AliPayForm) PopmoneyForm(bisq.desktop.components.paymentmethods.PopmoneyForm) SwishForm(bisq.desktop.components.paymentmethods.SwishForm) VenmoForm(bisq.desktop.components.paymentmethods.VenmoForm) AliPayValidator(bisq.desktop.util.validation.AliPayValidator) SepaInstantForm(bisq.desktop.components.paymentmethods.SepaInstantForm) Popup(bisq.desktop.main.overlays.popups.Popup) ChaseQuickPayValidator(bisq.desktop.util.validation.ChaseQuickPayValidator) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FormBuilder(bisq.desktop.util.FormBuilder) ClearXchangeValidator(bisq.desktop.util.validation.ClearXchangeValidator) PaymentMethod(bisq.core.payment.payload.PaymentMethod) Collectors(java.util.stream.Collectors) AccountAgeWitnessService(bisq.core.payment.AccountAgeWitnessService) OKPayForm(bisq.desktop.components.paymentmethods.OKPayForm) OKPayValidator(bisq.desktop.util.validation.OKPayValidator) VenmoValidator(bisq.desktop.util.validation.VenmoValidator) PaymentAccount(bisq.core.payment.PaymentAccount) List(java.util.List) CashDepositForm(bisq.desktop.components.paymentmethods.CashDepositForm) RevolutValidator(bisq.desktop.util.validation.RevolutValidator) AnchorPane(javafx.scene.layout.AnchorPane) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) UpholdForm(bisq.desktop.components.paymentmethods.UpholdForm) UserThread(bisq.common.UserThread) SpecificBankForm(bisq.desktop.components.paymentmethods.SpecificBankForm) IBANValidator(bisq.desktop.util.validation.IBANValidator) FasterPaymentsForm(bisq.desktop.components.paymentmethods.FasterPaymentsForm) MoneyBeamForm(bisq.desktop.components.paymentmethods.MoneyBeamForm) SwishValidator(bisq.desktop.util.validation.SwishValidator) ClearXchangeForm(bisq.desktop.components.paymentmethods.ClearXchangeForm) ListView(javafx.scene.control.ListView) FXCollections(javafx.collections.FXCollections) FxmlView(bisq.desktop.common.view.FxmlView) Inject(javax.inject.Inject) ClearXchangeAccount(bisq.core.payment.ClearXchangeAccount) Tuple2(bisq.common.util.Tuple2) USPostalMoneyOrderValidator(bisq.desktop.util.validation.USPostalMoneyOrderValidator) Tuple3(bisq.common.util.Tuple3) VPos(javafx.geometry.VPos) UpholdValidator(bisq.desktop.util.validation.UpholdValidator) TextAlignment(javafx.scene.text.TextAlignment) Callback(javafx.util.Callback) RevolutForm(bisq.desktop.components.paymentmethods.RevolutForm) TitledGroupBg(bisq.desktop.components.TitledGroupBg) GridPane(javafx.scene.layout.GridPane) NationalBankForm(bisq.desktop.components.paymentmethods.NationalBankForm) SameBankForm(bisq.desktop.components.paymentmethods.SameBankForm) WesternUnionForm(bisq.desktop.components.paymentmethods.WesternUnionForm) Label(javafx.scene.control.Label) InteracETransferValidator(bisq.desktop.util.validation.InteracETransferValidator) PerfectMoneyForm(bisq.desktop.components.paymentmethods.PerfectMoneyForm) BisqEnvironment(bisq.core.app.BisqEnvironment) StringConverter(javafx.util.StringConverter) CashAppValidator(bisq.desktop.util.validation.CashAppValidator) USPostalMoneyOrderForm(bisq.desktop.components.paymentmethods.USPostalMoneyOrderForm) TimeUnit(java.util.concurrent.TimeUnit) PaymentMethodForm(bisq.desktop.components.paymentmethods.PaymentMethodForm) InputValidator(bisq.core.util.validation.InputValidator) ChaseQuickPayForm(bisq.desktop.components.paymentmethods.ChaseQuickPayForm) ImageUtil(bisq.desktop.util.ImageUtil) SepaForm(bisq.desktop.components.paymentmethods.SepaForm) ImageView(javafx.scene.image.ImageView) CashAppForm(bisq.desktop.components.paymentmethods.CashAppForm) InteracETransferForm(bisq.desktop.components.paymentmethods.InteracETransferForm) PerfectMoneyValidator(bisq.desktop.util.validation.PerfectMoneyValidator) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) ChangeListener(javafx.beans.value.ChangeListener) PaymentAccount(bisq.core.payment.PaymentAccount) ListCell(javafx.scene.control.ListCell) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) ListView(javafx.scene.control.ListView) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AnchorPane(javafx.scene.layout.AnchorPane)

Aggregations

AutoTooltipButton (bisq.desktop.components.AutoTooltipButton)43 Button (javafx.scene.control.Button)37 Insets (javafx.geometry.Insets)31 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)28 Label (javafx.scene.control.Label)27 HBox (javafx.scene.layout.HBox)26 Popup (bisq.desktop.main.overlays.popups.Popup)17 ImageView (javafx.scene.image.ImageView)17 Res (bisq.core.locale.Res)15 FxmlView (bisq.desktop.common.view.FxmlView)13 Callback (javafx.util.Callback)13 Inject (javax.inject.Inject)13 InputTextField (bisq.desktop.components.InputTextField)12 ChangeListener (javafx.beans.value.ChangeListener)12 Tooltip (javafx.scene.control.Tooltip)12 VBox (javafx.scene.layout.VBox)12 Tuple2 (bisq.common.util.Tuple2)11 GridPane (javafx.scene.layout.GridPane)11 TableCell (javafx.scene.control.TableCell)10 TableColumn (javafx.scene.control.TableColumn)10