Search in sources :

Example 51 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class TradesChartsView method activate.

@Override
protected void activate() {
    // root.getParent() is null at initialize
    tabPaneSelectionModel = GUIUtil.getParentOfType(root, TabPane.class).getSelectionModel();
    selectedTabIndexListener = (observable, oldValue, newValue) -> model.setSelectedTabIndex((int) newValue);
    model.setSelectedTabIndex(tabPaneSelectionModel.getSelectedIndex());
    tabPaneSelectionModel.selectedIndexProperty().addListener(selectedTabIndexListener);
    currencyComboBox.setItems(model.getCurrencyListItems());
    currencyComboBox.setVisibleRowCount(25);
    if (model.showAllTradeCurrenciesProperty.get())
        currencyComboBox.getSelectionModel().select(0);
    else if (model.getSelectedCurrencyListItem().isPresent())
        currencyComboBox.getSelectionModel().select(model.getSelectedCurrencyListItem().get());
    currencyComboBox.setOnAction(e -> {
        CurrencyListItem selectedItem = currencyComboBox.getSelectionModel().getSelectedItem();
        if (selectedItem != null)
            model.onSetTradeCurrency(selectedItem.tradeCurrency);
    });
    toggleGroup.getToggles().get(model.tickUnit.ordinal()).setSelected(true);
    model.priceItems.addListener(itemsChangeListener);
    toggleGroup.selectedToggleProperty().addListener(timeUnitChangeListener);
    priceAxisY.widthProperty().addListener(priceAxisYWidthListener);
    volumeAxisY.widthProperty().addListener(volumeAxisYWidthListener);
    model.tradeStatisticsByCurrency.addListener(tradeStatisticsByCurrencyListener);
    priceAxisY.labelProperty().bind(priceColumnLabel);
    priceColumnLabel.addListener(priceColumnLabelListener);
    currencySelectionBinding = EasyBind.combine(model.showAllTradeCurrenciesProperty, model.selectedTradeCurrencyProperty, (showAll, selectedTradeCurrency) -> {
        priceChart.setVisible(!showAll);
        priceChart.setManaged(!showAll);
        priceColumn.setSortable(!showAll);
        if (showAll) {
            volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amount")));
            priceColumnLabel.set(Res.get("shared.price"));
            if (!tableView.getColumns().contains(marketColumn))
                tableView.getColumns().add(1, marketColumn);
            volumeChart.setPrefHeight(volumeChart.getMaxHeight());
        } else {
            volumeChart.setPrefHeight(volumeChart.getMinHeight());
            priceSeries.setName(selectedTradeCurrency.getName());
            String code = selectedTradeCurrency.getCode();
            volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountWithCur", code)));
            priceColumnLabel.set(formatter.getPriceWithCurrencyCode(code));
            if (tableView.getColumns().contains(marketColumn))
                tableView.getColumns().remove(marketColumn);
        }
        layout();
        return null;
    });
    currencySelectionSubscriber = currencySelectionBinding.subscribe((observable, oldValue, newValue) -> {
    });
    sortedList = new SortedList<>(model.tradeStatisticsByCurrency);
    sortedList.comparatorProperty().bind(tableView.comparatorProperty());
    tableView.setItems(sortedList);
    priceChart.setAnimated(model.preferences.isUseAnimations());
    volumeChart.setAnimated(model.preferences.isUseAnimations());
    priceAxisX.setTickLabelFormatter(getTimeAxisStringConverter());
    volumeAxisX.setTickLabelFormatter(getTimeAxisStringConverter());
    nrOfTradeStatisticsLabel.setText(Res.get("market.trades.nrOfTrades", model.tradeStatisticsByCurrency.size()));
    UserThread.runAfter(this::updateChartData, 100, TimeUnit.MILLISECONDS);
    if (root.getParent() instanceof Pane) {
        rootParent = (Pane) root.getParent();
        rootParent.heightProperty().addListener(parentHeightListener);
    }
    layout();
}
Also used : Pos(javafx.geometry.Pos) VolumeChart(bisq.desktop.main.market.trades.charts.volume.VolumeChart) Coin(org.bitcoinj.core.Coin) Date(java.util.Date) LoggerFactory(org.slf4j.LoggerFactory) XYChart(javafx.scene.chart.XYChart) VBox(javafx.scene.layout.VBox) BSFormatter(bisq.desktop.util.BSFormatter) TabPane(javafx.scene.control.TabPane) ComboBox(javafx.scene.control.ComboBox) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) Res(bisq.core.locale.Res) MonadicBinding(org.fxmisc.easybind.monadic.MonadicBinding) TableView(javafx.scene.control.TableView) Pane(javafx.scene.layout.Pane) SortedList(javafx.collections.transformation.SortedList) HBox(javafx.scene.layout.HBox) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) SingleSelectionModel(javafx.scene.control.SingleSelectionModel) Subscription(org.fxmisc.easybind.Subscription) MathUtils(bisq.common.util.MathUtils) Priority(javafx.scene.layout.Priority) ToggleButton(javafx.scene.control.ToggleButton) UserThread(bisq.common.UserThread) Toggle(javafx.scene.control.Toggle) NumberAxis(javafx.scene.chart.NumberAxis) StringProperty(javafx.beans.property.StringProperty) NotNull(org.jetbrains.annotations.NotNull) GUIUtil(bisq.desktop.util.GUIUtil) CurrencyListItem(bisq.desktop.util.CurrencyListItem) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) FXCollections(javafx.collections.FXCollections) Volume(bisq.core.monetary.Volume) FxmlView(bisq.desktop.common.view.FxmlView) AutoTooltipToggleButton(bisq.desktop.components.AutoTooltipToggleButton) TableColumn(javafx.scene.control.TableColumn) Inject(javax.inject.Inject) TableCell(javafx.scene.control.TableCell) OfferPayload(bisq.core.offer.OfferPayload) Insets(javafx.geometry.Insets) CurrencyUtil(bisq.core.locale.CurrencyUtil) ColoredDecimalPlacesWithZerosText(bisq.desktop.components.ColoredDecimalPlacesWithZerosText) Callback(javafx.util.Callback) Label(javafx.scene.control.Label) Logger(org.slf4j.Logger) TradeStatistics2(bisq.core.trade.statistics.TradeStatistics2) StringConverter(javafx.util.StringConverter) CandleStickChart(bisq.desktop.main.market.trades.charts.price.CandleStickChart) TimeUnit(java.util.concurrent.TimeUnit) ToggleGroup(javafx.scene.control.ToggleGroup) EasyBind(org.fxmisc.easybind.EasyBind) Tab(javafx.scene.control.Tab) Price(bisq.core.monetary.Price) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) ChangeListener(javafx.beans.value.ChangeListener) CurrencyListItem(bisq.desktop.util.CurrencyListItem) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) TabPane(javafx.scene.control.TabPane) Pane(javafx.scene.layout.Pane)

Example 52 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class TradesChartsView method getToolBox.

// /////////////////////////////////////////////////////////////////////////////////////////
// CurrencyComboBox
// /////////////////////////////////////////////////////////////////////////////////////////
private HBox getToolBox() {
    Label currencyLabel = new AutoTooltipLabel(Res.getWithCol("shared.currency"));
    currencyLabel.setPadding(new Insets(0, 4, 0, 0));
    currencyComboBox = new ComboBox<>();
    currencyComboBox.setPromptText(Res.get("list.currency.select"));
    currencyComboBox.setConverter(GUIUtil.getCurrencyListItemConverter(Res.get("shared.trade"), Res.get("shared.trades"), model.preferences));
    Pane spacer = new Pane();
    HBox.setHgrow(spacer, Priority.ALWAYS);
    Label label = new AutoTooltipLabel("Interval:");
    label.setPadding(new Insets(0, 4, 0, 0));
    toggleGroup = new ToggleGroup();
    ToggleButton year = getToggleButton(Res.get("time.year"), TradesChartsViewModel.TickUnit.YEAR, toggleGroup, "toggle-left");
    ToggleButton month = getToggleButton(Res.get("time.month"), TradesChartsViewModel.TickUnit.MONTH, toggleGroup, "toggle-left");
    ToggleButton week = getToggleButton(Res.get("time.week"), TradesChartsViewModel.TickUnit.WEEK, toggleGroup, "toggle-center");
    ToggleButton day = getToggleButton(Res.get("time.day"), TradesChartsViewModel.TickUnit.DAY, toggleGroup, "toggle-center");
    ToggleButton hour = getToggleButton(Res.get("time.hour"), TradesChartsViewModel.TickUnit.HOUR, toggleGroup, "toggle-center");
    ToggleButton minute10 = getToggleButton(Res.get("time.minute10"), TradesChartsViewModel.TickUnit.MINUTE_10, toggleGroup, "toggle-center");
    HBox hBox = new HBox();
    hBox.setSpacing(0);
    hBox.setPadding(new Insets(5, 9, -10, 10));
    hBox.setAlignment(Pos.CENTER_LEFT);
    hBox.getChildren().addAll(currencyLabel, currencyComboBox, spacer, label, year, month, week, day, hour, minute10);
    return hBox;
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) AutoTooltipToggleButton(bisq.desktop.components.AutoTooltipToggleButton) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) ToggleGroup(javafx.scene.control.ToggleGroup) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) TabPane(javafx.scene.control.TabPane) Pane(javafx.scene.layout.Pane)

Example 53 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class TradesChartsView method createTable.

// /////////////////////////////////////////////////////////////////////////////////////////
// Table
// /////////////////////////////////////////////////////////////////////////////////////////
private void createTable() {
    tableView = new TableView<>();
    tableView.setMinHeight(140);
    tableView.setPrefHeight(140);
    VBox.setVgrow(tableView, Priority.ALWAYS);
    // date
    TableColumn<TradeStatistics2, TradeStatistics2> dateColumn = new AutoTooltipTableColumn<TradeStatistics2, TradeStatistics2>(Res.get("shared.dateTime")) {

        {
            setMinWidth(240);
            setMaxWidth(240);
        }
    };
    dateColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    dateColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setText(formatter.formatDateTime(item.getTradeDate()));
                    else
                        setText("");
                }
            };
        }
    });
    dateColumn.setComparator((o1, o2) -> o1.getTradeDate().compareTo(o2.getTradeDate()));
    tableView.getColumns().add(dateColumn);
    // market
    marketColumn = new AutoTooltipTableColumn<TradeStatistics2, TradeStatistics2>(Res.get("shared.market")) {

        {
            setMinWidth(130);
            setMaxWidth(130);
        }
    };
    marketColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    marketColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setText(formatter.getCurrencyPair(item.getCurrencyCode()));
                    else
                        setText("");
                }
            };
        }
    });
    marketColumn.setComparator((o1, o2) -> o1.getTradeDate().compareTo(o2.getTradeDate()));
    tableView.getColumns().add(marketColumn);
    // price
    priceColumn = new TableColumn<>();
    priceColumn.getStyleClass().add("number-column");
    priceColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    priceColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setText(formatter.formatPrice(item.getTradePrice()));
                    else
                        setText("");
                }
            };
        }
    });
    priceColumn.setComparator((o1, o2) -> o1.getTradePrice().compareTo(o2.getTradePrice()));
    tableView.getColumns().add(priceColumn);
    // amount
    TableColumn<TradeStatistics2, TradeStatistics2> amountColumn = new AutoTooltipTableColumn<>(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()));
    amountColumn.getStyleClass().add("number-column");
    amountColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    amountColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setGraphic(new ColoredDecimalPlacesWithZerosText(formatter.formatCoin(item.getTradeAmount(), 4), GUIUtil.AMOUNT_DECIMALS_WITH_ZEROS));
                    else
                        setText("");
                }
            };
        }
    });
    amountColumn.setComparator((o1, o2) -> o1.getTradeAmount().compareTo(o2.getTradeAmount()));
    tableView.getColumns().add(amountColumn);
    // volume
    volumeColumn = new TableColumn<>();
    volumeColumn.getStyleClass().add("number-column");
    volumeColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    volumeColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setText(model.showAllTradeCurrenciesProperty.get() ? formatter.formatVolumeWithCode(item.getTradeVolume()) : formatter.formatVolume(item.getTradeVolume()));
                    else
                        setText("");
                }
            };
        }
    });
    volumeColumn.setComparator((o1, o2) -> {
        final Volume tradeVolume1 = o1.getTradeVolume();
        final Volume tradeVolume2 = o2.getTradeVolume();
        return tradeVolume1 != null && tradeVolume2 != null ? tradeVolume1.compareTo(tradeVolume2) : 0;
    });
    tableView.getColumns().add(volumeColumn);
    // paymentMethod
    TableColumn<TradeStatistics2, TradeStatistics2> paymentMethodColumn = new AutoTooltipTableColumn<>(Res.get("shared.paymentMethod"));
    paymentMethodColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    paymentMethodColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setText(getPaymentMethodLabel(item));
                    else
                        setText("");
                }
            };
        }
    });
    paymentMethodColumn.setComparator((o1, o2) -> getPaymentMethodLabel(o1).compareTo(getPaymentMethodLabel(o2)));
    tableView.getColumns().add(paymentMethodColumn);
    // direction
    TableColumn<TradeStatistics2, TradeStatistics2> directionColumn = new AutoTooltipTableColumn<>(Res.get("shared.offerType"));
    directionColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue()));
    directionColumn.setCellFactory(new Callback<TableColumn<TradeStatistics2, TradeStatistics2>, TableCell<TradeStatistics2, TradeStatistics2>>() {

        @Override
        public TableCell<TradeStatistics2, TradeStatistics2> call(TableColumn<TradeStatistics2, TradeStatistics2> column) {
            return new TableCell<TradeStatistics2, TradeStatistics2>() {

                @Override
                public void updateItem(final TradeStatistics2 item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null)
                        setText(getDirectionLabel(item));
                    else
                        setText("");
                }
            };
        }
    });
    directionColumn.setComparator((o1, o2) -> getDirectionLabel(o1).compareTo(getDirectionLabel(o2)));
    tableView.getColumns().add(directionColumn);
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    Label placeholder = new AutoTooltipLabel(Res.get("table.placeholder.noData"));
    placeholder.setWrapText(true);
    tableView.setPlaceholder(placeholder);
    dateColumn.setSortType(TableColumn.SortType.DESCENDING);
    tableView.getSortOrder().add(dateColumn);
}
Also used : TradeStatistics2(bisq.core.trade.statistics.TradeStatistics2) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) TableColumn(javafx.scene.control.TableColumn) TableCell(javafx.scene.control.TableCell) Volume(bisq.core.monetary.Volume) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) ColoredDecimalPlacesWithZerosText(bisq.desktop.components.ColoredDecimalPlacesWithZerosText) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 54 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class CreateOfferView method addPayInfoEntry.

private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, String value) {
    Label label = new AutoTooltipLabel(labelText);
    TextField textField = new TextField(value);
    textField.setMinWidth(500);
    textField.setEditable(false);
    textField.setFocusTraversable(false);
    textField.setId("payment-info");
    GridPane.setConstraints(label, 0, row, 1, 1, HPos.RIGHT, VPos.CENTER);
    GridPane.setConstraints(textField, 1, row);
    infoGridPane.getChildren().addAll(label, textField);
}
Also used : AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) BalanceTextField(bisq.desktop.components.BalanceTextField) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) TextField(javafx.scene.control.TextField) FundsTextField(bisq.desktop.components.FundsTextField) AddressTextField(bisq.desktop.components.AddressTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 55 with AutoTooltipLabel

use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.

the class CreateOfferView method addFundingGroup.

private void addFundingGroup() {
    // don't increase gridRow as we removed button when this gets visible
    payFundsTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 3, Res.get("createOffer.fundsBox.title"), Layout.GROUP_DISTANCE);
    GridPane.setColumnSpan(payFundsTitledGroupBg, 3);
    payFundsTitledGroupBg.setVisible(false);
    Tuple2<Label, FundsTextField> fundsTuple = addLabelFundsTextfield(gridPane, gridRow, Res.get("shared.totalsNeeded"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    totalToPayLabel = fundsTuple.first;
    totalToPayLabel.setVisible(false);
    totalToPayTextField = fundsTuple.second;
    totalToPayTextField.setVisible(false);
    qrCodeImageView = new ImageView();
    qrCodeImageView.setVisible(false);
    qrCodeImageView.getStyleClass().add("qr-code");
    Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
    qrCodeImageView.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> UserThread.runAfter(() -> new QRCodeWindow(getBitcoinURI()).show(), 200, TimeUnit.MILLISECONDS)));
    GridPane.setRowIndex(qrCodeImageView, gridRow);
    GridPane.setColumnIndex(qrCodeImageView, 2);
    GridPane.setRowSpan(qrCodeImageView, 3);
    GridPane.setMargin(qrCodeImageView, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE - 9, 0, 0, 5));
    gridPane.getChildren().add(qrCodeImageView);
    Tuple2<Label, AddressTextField> addressTuple = addLabelAddressTextField(gridPane, ++gridRow, Res.get("shared.tradeWalletAddress"));
    addressLabel = addressTuple.first;
    addressLabel.setVisible(false);
    addressTextField = addressTuple.second;
    addressTextField.setVisible(false);
    Tuple2<Label, BalanceTextField> balanceTuple = addLabelBalanceTextField(gridPane, ++gridRow, Res.get("shared.tradeWalletBalance"));
    balanceLabel = balanceTuple.first;
    balanceLabel.setVisible(false);
    balanceTextField = balanceTuple.second;
    balanceTextField.setVisible(false);
    fundingHBox = new HBox();
    fundingHBox.setVisible(false);
    fundingHBox.setManaged(false);
    fundingHBox.setSpacing(10);
    Button fundFromSavingsWalletButton = new AutoTooltipButton(Res.get("shared.fundFromSavingsWalletButton"));
    fundFromSavingsWalletButton.setDefaultButton(false);
    fundFromSavingsWalletButton.setOnAction(e -> model.fundFromSavingsWallet());
    Label label = new AutoTooltipLabel(Res.get("shared.OR"));
    label.setPadding(new Insets(5, 0, 0, 0));
    Button fundFromExternalWalletButton = new AutoTooltipButton(Res.get("shared.fundFromExternalWalletButton"));
    fundFromExternalWalletButton.setDefaultButton(false);
    fundFromExternalWalletButton.setOnAction(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet));
    waitingForFundsBusyAnimation = new BusyAnimation();
    waitingForFundsLabel = new AutoTooltipLabel();
    waitingForFundsLabel.setPadding(new Insets(5, 0, 0, 0));
    fundingHBox.getChildren().addAll(fundFromSavingsWalletButton, label, fundFromExternalWalletButton, waitingForFundsBusyAnimation, waitingForFundsLabel);
    GridPane.setRowIndex(fundingHBox, ++gridRow);
    GridPane.setColumnIndex(fundingHBox, 1);
    GridPane.setMargin(fundingHBox, new Insets(15, 10, 0, 0));
    gridPane.getChildren().add(fundingHBox);
    placeOfferButton = addButtonAfterGroup(gridPane, gridRow, "");
    placeOfferButton.setOnAction(e -> onPlaceOffer());
    placeOfferButton.setMinHeight(40);
    placeOfferButton.setPadding(new Insets(0, 20, 0, 20));
    cancelButton2 = addButton(gridPane, ++gridRow, Res.get("shared.cancel"));
    cancelButton2.setOnAction(e -> {
        if (model.dataModel.getIsBtcWalletFunded().get()) {
            new Popup<>().warning(Res.get("createOffer.warnCancelOffer")).closeButtonText(Res.get("shared.no")).actionButtonText(Res.get("shared.yesCancel")).onAction(() -> {
                close();
                model.dataModel.swapTradeToSavings();
            }).show();
        } else {
            close();
            model.dataModel.swapTradeToSavings();
        }
    });
    cancelButton2.setDefaultButton(false);
    cancelButton2.setVisible(false);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) BusyAnimation(bisq.desktop.components.BusyAnimation) AddressTextField(bisq.desktop.components.AddressTextField) Tooltip(javafx.scene.control.Tooltip) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) QRCodeWindow(bisq.desktop.main.overlays.windows.QRCodeWindow) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) BalanceTextField(bisq.desktop.components.BalanceTextField) FundsTextField(bisq.desktop.components.FundsTextField) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Aggregations

AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)90 Label (javafx.scene.control.Label)55 Insets (javafx.geometry.Insets)45 HBox (javafx.scene.layout.HBox)29 TableCell (javafx.scene.control.TableCell)27 TableColumn (javafx.scene.control.TableColumn)27 VBox (javafx.scene.layout.VBox)23 AutoTooltipButton (bisq.desktop.components.AutoTooltipButton)22 Button (javafx.scene.control.Button)22 ImageView (javafx.scene.image.ImageView)19 Res (bisq.core.locale.Res)18 InputTextField (bisq.desktop.components.InputTextField)18 Popup (bisq.desktop.main.overlays.popups.Popup)17 FxmlView (bisq.desktop.common.view.FxmlView)16 Callback (javafx.util.Callback)16 Inject (javax.inject.Inject)16 Coin (org.bitcoinj.core.Coin)16 Tooltip (javafx.scene.control.Tooltip)15 TableView (javafx.scene.control.TableView)14 BSFormatter (bisq.desktop.util.BSFormatter)13