Search in sources :

Example 11 with AutoTooltipLabel

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

the class AltCoinAccountsView method initialize.

@Override
public void initialize() {
    buildForm();
    paymentAccountChangeListener = (observable, oldValue, newValue) -> {
        if (newValue != null)
            onSelectAccount(newValue);
    };
    Label placeholder = new AutoTooltipLabel(Res.get("shared.noAccountsSetupYet"));
    placeholder.setWrapText(true);
    paymentAccountsListView.setPlaceholder(placeholder);
}
Also used : Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 12 with AutoTooltipLabel

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

the class ArbitratorSelectionView method addLanguageGroup.

// /////////////////////////////////////////////////////////////////////////////////////////
// UI builder
// /////////////////////////////////////////////////////////////////////////////////////////
private void addLanguageGroup() {
    addTitledGroupBg(root, gridRow, 1, Res.get("account.arbitratorSelection.whichLanguages"));
    Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, Res.get("shared.yourLanguage"), Layout.FIRST_ROW_DISTANCE);
    GridPane.setValignment(tuple.first, VPos.TOP);
    // noinspection unchecked
    languagesListView = tuple.second;
    languagesListView.setMinHeight(3 * Layout.LIST_ROW_HEIGHT + 2);
    languagesListView.setMaxHeight(6 * Layout.LIST_ROW_HEIGHT + 2);
    languagesListView.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {

        @Override
        public ListCell<String> call(ListView<String> list) {
            return new ListCell<String>() {

                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 String item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        label.setText(LanguageUtil.getDisplayName(item));
                        removeButton.setOnAction(e -> onRemoveLanguage(item));
                        setGraphic(pane);
                    } else {
                        setGraphic(null);
                    }
                }
            };
        }
    });
    // noinspection unchecked
    languageComboBox = addLabelComboBox(root, ++gridRow, "", 15).second;
    languageComboBox.setPromptText(Res.get("shared.addLanguage"));
    languageComboBox.setConverter(new StringConverter<String>() {

        @Override
        public String toString(String code) {
            return LanguageUtil.getDisplayName(code);
        }

        @Override
        public String fromString(String s) {
            return null;
        }
    });
    languageComboBox.setOnAction(e -> onAddLanguage());
}
Also used : TableGroupHeadline(bisq.desktop.components.TableGroupHeadline) Button(javafx.scene.control.Button) HPos(javafx.geometry.HPos) ListView(javafx.scene.control.ListView) ListCell(javafx.scene.control.ListCell) Layout(bisq.desktop.util.Layout) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) Inject(javax.inject.Inject) Tuple2(bisq.common.util.Tuple2) TableCell(javafx.scene.control.TableCell) FormBuilder.addLabelComboBox(bisq.desktop.util.FormBuilder.addLabelComboBox) Insets(javafx.geometry.Insets) ComboBox(javafx.scene.control.ComboBox) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) VPos(javafx.geometry.VPos) Res(bisq.core.locale.Res) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) GridPane(javafx.scene.layout.GridPane) FormBuilder.addLabelListView(bisq.desktop.util.FormBuilder.addLabelListView) Popup(bisq.desktop.main.overlays.popups.Popup) Label(javafx.scene.control.Label) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) TableRow(javafx.scene.control.TableRow) FormBuilder.addTitledGroupBg(bisq.desktop.util.FormBuilder.addTitledGroupBg) CheckBox(javafx.scene.control.CheckBox) StringConverter(javafx.util.StringConverter) FormBuilder.addCheckBox(bisq.desktop.util.FormBuilder.addCheckBox) BooleanProperty(javafx.beans.property.BooleanProperty) ImageUtil(bisq.desktop.util.ImageUtil) AnchorPane(javafx.scene.layout.AnchorPane) ImageView(javafx.scene.image.ImageView) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) LanguageUtil(bisq.core.locale.LanguageUtil) UserThread(bisq.common.UserThread) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) ChangeListener(javafx.beans.value.ChangeListener) ListCell(javafx.scene.control.ListCell) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) ListView(javafx.scene.control.ListView) FormBuilder.addLabelListView(bisq.desktop.util.FormBuilder.addLabelListView) 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)

Example 13 with AutoTooltipLabel

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

the class BsqDashboardView method initialize.

@Override
public void initialize() {
    gridRow = bsqBalanceUtil.addGroup(root, gridRow);
    addTitledGroupBg(root, ++gridRow, 12, Res.get("dao.wallet.dashboard.statistics"), Layout.GROUP_DISTANCE);
    addLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"), String.valueOf(bsqBlockChain.getGenesisBlockHeight()), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    Label label = new AutoTooltipLabel(Res.get("dao.wallet.dashboard.genesisTxId"));
    GridPane.setRowIndex(label, ++gridRow);
    root.getChildren().add(label);
    hyperlinkWithIcon = new HyperlinkWithIcon(bsqBlockChain.getGenesisTxId(), AwesomeIcon.EXTERNAL_LINK);
    hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", bsqBlockChain.getGenesisTxId())));
    GridPane.setRowIndex(hyperlinkWithIcon, gridRow);
    GridPane.setColumnIndex(hyperlinkWithIcon, 1);
    GridPane.setMargin(hyperlinkWithIcon, new Insets(0, 0, 0, -4));
    root.getChildren().add(hyperlinkWithIcon);
    issuedAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.issuedAmount")).second;
    availableAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
    burntAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
    allTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second;
    utxoTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
    spentTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.spentTxo")).second;
    burntTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntTx")).second;
    priceTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.price")).second;
    marketCapTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.marketCap")).second;
    priceChangeListener = (observable, oldValue, newValue) -> updatePrice();
}
Also used : Insets(javafx.geometry.Insets) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Example 14 with AutoTooltipLabel

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

the class ReservedView method setDateColumnCellFactory.

// /////////////////////////////////////////////////////////////////////////////////////////
// ColumnCellFactories
// /////////////////////////////////////////////////////////////////////////////////////////
private void setDateColumnCellFactory() {
    dateColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    dateColumn.setCellFactory(new Callback<TableColumn<ReservedListItem, ReservedListItem>, TableCell<ReservedListItem, ReservedListItem>>() {

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

                @Override
                public void updateItem(final ReservedListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        if (getTradable(item).isPresent())
                            setGraphic(new AutoTooltipLabel(formatter.formatDateTime(getTradable(item).get().getDate())));
                        else
                            setGraphic(new AutoTooltipLabel(Res.get("shared.noDateAvailable")));
                    } else {
                        setGraphic(null);
                    }
                }
            };
        }
    });
}
Also used : TableCell(javafx.scene.control.TableCell) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) TableColumn(javafx.scene.control.TableColumn)

Example 15 with AutoTooltipLabel

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

the class CreateOfferView method addAmountPriceFields.

private void addAmountPriceFields() {
    // amountBox
    Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getEditableValueCurrencyBox(Res.get("createOffer.amount.prompt"));
    HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first;
    amountTextField = amountValueCurrencyBoxTuple.second;
    editOfferElements.add(amountTextField);
    Label amountBtcLabel = amountValueCurrencyBoxTuple.third;
    editOfferElements.add(amountBtcLabel);
    Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, model.getAmountDescription());
    amountDescriptionLabel = amountInputBoxTuple.first;
    editOfferElements.add(amountDescriptionLabel);
    VBox amountBox = amountInputBoxTuple.second;
    // x
    xLabel = new AutoTooltipLabel();
    xLabel.setFont(Font.font("Helvetica-Bold", 20));
    xLabel.setPadding(new Insets(14, 3, 0, 3));
    xLabel.setMinWidth(14);
    xLabel.setMaxWidth(14);
    // price as percent
    Tuple3<HBox, InfoInputTextField, Label> priceAsPercentageTuple = getEditableValueCurrencyBoxWithInfo(Res.get("createOffer.price.prompt"));
    HBox priceAsPercentageValueCurrencyBox = priceAsPercentageTuple.first;
    marketBasedPriceInfoInputTextField = priceAsPercentageTuple.second;
    marketBasedPriceTextField = marketBasedPriceInfoInputTextField.getTextField();
    marketBasedPriceTextField.setPrefWidth(200);
    editOfferElements.add(marketBasedPriceTextField);
    marketBasedPriceLabel = priceAsPercentageTuple.third;
    editOfferElements.add(marketBasedPriceLabel);
    Tuple2<Label, VBox> priceAsPercentageInputBoxTuple = getTradeInputBox(priceAsPercentageValueCurrencyBox, Res.get("shared.distanceInPercent"));
    percentagePriceDescription = priceAsPercentageInputBoxTuple.first;
    percentagePriceDescription.setPrefWidth(200);
    getSmallIconForLabel(MaterialDesignIcon.CHART_LINE, percentagePriceDescription);
    percentagePriceBox = priceAsPercentageInputBoxTuple.second;
    // Fixed/Percentage toggle
    priceTypeToggleButton = getIconButton(MaterialDesignIcon.SWAP_VERTICAL);
    editOfferElements.add(priceTypeToggleButton);
    priceTypeToggleButton.setOnAction((actionEvent) -> {
        updatePriceToggleButtons(model.dataModel.getUseMarketBasedPrice().getValue());
    });
    // =
    resultLabel = new AutoTooltipLabel("=");
    resultLabel.setFont(Font.font("Helvetica-Bold", 20));
    resultLabel.setPadding(new Insets(14, 2, 0, 2));
    // volume
    Tuple3<HBox, InputTextField, Label> volumeValueCurrencyBoxTuple = getEditableValueCurrencyBox(Res.get("createOffer.volume.prompt"));
    HBox volumeValueCurrencyBox = volumeValueCurrencyBoxTuple.first;
    volumeTextField = volumeValueCurrencyBoxTuple.second;
    editOfferElements.add(volumeTextField);
    volumeCurrencyLabel = volumeValueCurrencyBoxTuple.third;
    editOfferElements.add(volumeCurrencyLabel);
    Tuple2<Label, VBox> volumeInputBoxTuple = getTradeInputBox(volumeValueCurrencyBox, model.volumeDescriptionLabel.get());
    volumeDescriptionLabel = volumeInputBoxTuple.first;
    editOfferElements.add(volumeDescriptionLabel);
    VBox volumeBox = volumeInputBoxTuple.second;
    firstRowHBox = new HBox();
    firstRowHBox.setSpacing(5);
    firstRowHBox.setAlignment(Pos.CENTER_LEFT);
    firstRowHBox.getChildren().addAll(amountBox, xLabel, percentagePriceBox, priceTypeToggleButton, resultLabel, volumeBox);
    GridPane.setRowIndex(firstRowHBox, gridRow);
    GridPane.setColumnIndex(firstRowHBox, 1);
    GridPane.setMargin(firstRowHBox, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, 10, 0, 0));
    GridPane.setColumnSpan(firstRowHBox, 2);
    gridPane.getChildren().add(firstRowHBox);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) InfoInputTextField(bisq.desktop.components.InfoInputTextField) VBox(javafx.scene.layout.VBox)

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