Search in sources :

Example 56 with AutoTooltipLabel

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

the class CreateOfferView method addAmountPriceGroup.

private void addAmountPriceGroup() {
    TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("createOffer.setAmountPrice"), Layout.GROUP_DISTANCE);
    GridPane.setColumnSpan(titledGroupBg, 3);
    imageView = new ImageView();
    imageView.setPickOnBounds(true);
    directionLabel = new AutoTooltipLabel();
    directionLabel.setAlignment(Pos.CENTER);
    directionLabel.setPadding(new Insets(-5, 0, 0, 0));
    directionLabel.setId("direction-icon-label");
    VBox imageVBox = new VBox();
    imageVBox.setAlignment(Pos.CENTER);
    imageVBox.setSpacing(12);
    imageVBox.getChildren().addAll(imageView, directionLabel);
    GridPane.setRowIndex(imageVBox, gridRow);
    GridPane.setRowSpan(imageVBox, 2);
    GridPane.setMargin(imageVBox, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, 10, 10, 10));
    gridPane.getChildren().add(imageVBox);
    addAmountPriceFields();
    addSecondRow();
}
Also used : Insets(javafx.geometry.Insets) TitledGroupBg(bisq.desktop.components.TitledGroupBg) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) VBox(javafx.scene.layout.VBox)

Example 57 with AutoTooltipLabel

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

the class CreateOfferView method addSecondRow.

private void addSecondRow() {
    // price as fiat
    Tuple3<HBox, InputTextField, Label> priceValueCurrencyBoxTuple = getEditableValueCurrencyBox(Res.get("createOffer.price.prompt"));
    HBox priceValueCurrencyBox = priceValueCurrencyBoxTuple.first;
    fixedPriceTextField = priceValueCurrencyBoxTuple.second;
    fixedPriceTextField.setPrefWidth(200);
    editOfferElements.add(fixedPriceTextField);
    priceCurrencyLabel = priceValueCurrencyBoxTuple.third;
    editOfferElements.add(priceCurrencyLabel);
    Tuple2<Label, VBox> priceInputBoxTuple = getTradeInputBox(priceValueCurrencyBox, "");
    priceDescriptionLabel = priceInputBoxTuple.first;
    priceDescriptionLabel.setPrefWidth(200);
    getSmallIconForLabel(MaterialDesignIcon.LOCK, priceDescriptionLabel);
    editOfferElements.add(priceDescriptionLabel);
    fixedPriceBox = priceInputBoxTuple.second;
    marketBasedPriceTextField.setPromptText(Res.get("shared.enterPercentageValue"));
    marketBasedPriceLabel.setText("%");
    marketBasedPriceLabel.getStyleClass().add("percentage-label");
    Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getEditableValueCurrencyBox(Res.get("createOffer.amount.prompt"));
    HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first;
    minAmountTextField = amountValueCurrencyBoxTuple.second;
    editOfferElements.add(minAmountTextField);
    Label minAmountBtcLabel = amountValueCurrencyBoxTuple.third;
    editOfferElements.add(minAmountBtcLabel);
    Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, Res.get("createOffer.amountPriceBox.minAmountDescription"));
    Label xLabel = new AutoTooltipLabel("x");
    xLabel.setFont(Font.font("Helvetica-Bold", 20));
    xLabel.setPadding(new Insets(14, 3, 0, 3));
    // we just use it to get the same layout as the upper row
    xLabel.setVisible(false);
    secondRowHBox = new HBox();
    secondRowHBox.setSpacing(5);
    secondRowHBox.setAlignment(Pos.CENTER_LEFT);
    secondRowHBox.getChildren().addAll(amountInputBoxTuple.second, xLabel, fixedPriceBox, priceTypeToggleButton);
    GridPane.setRowIndex(secondRowHBox, ++gridRow);
    GridPane.setColumnIndex(secondRowHBox, 1);
    GridPane.setMargin(secondRowHBox, new Insets(0, 10, 0, 0));
    GridPane.setColumnSpan(secondRowHBox, 2);
    gridPane.getChildren().add(secondRowHBox);
}
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) VBox(javafx.scene.layout.VBox)

Example 58 with AutoTooltipLabel

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

the class TakeOfferView method addOfferAvailabilityLabel.

private void addOfferAvailabilityLabel() {
    offerAvailabilityBusyAnimation = new BusyAnimation();
    offerAvailabilityLabel = new AutoTooltipLabel(Res.get("takeOffer.fundsBox.isOfferAvailable"));
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.setAlignment(Pos.CENTER_LEFT);
    hBox.getChildren().addAll(nextButton, cancelButton1, offerAvailabilityBusyAnimation, offerAvailabilityLabel);
    GridPane.setRowIndex(hBox, ++gridRow);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(-30, 0, 0, 0));
    gridPane.getChildren().add(hBox);
}
Also used : HBox(javafx.scene.layout.HBox) BusyAnimation(bisq.desktop.components.BusyAnimation) Insets(javafx.geometry.Insets) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 59 with AutoTooltipLabel

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

the class TakeOfferView 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) TextField(javafx.scene.control.TextField) FundsTextField(bisq.desktop.components.FundsTextField) AddressTextField(bisq.desktop.components.AddressTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 60 with AutoTooltipLabel

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

the class TransactionsView method setDetailsColumnCellFactory.

private void setDetailsColumnCellFactory() {
    detailsColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    detailsColumn.setCellFactory(new Callback<TableColumn<TransactionsListItem, TransactionsListItem>, TableCell<TransactionsListItem, TransactionsListItem>>() {

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

                private HyperlinkWithIcon field;

                @Override
                public void updateItem(final TransactionsListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        if (item.getDetailsAvailable()) {
                            field = new HyperlinkWithIcon(item.getDetails(), AwesomeIcon.INFO_SIGN);
                            field.setOnAction(event -> openDetailPopup(item));
                            field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails")));
                            setGraphic(field);
                        } else {
                            setGraphic(new AutoTooltipLabel(item.getDetails()));
                        }
                    } else {
                        setGraphic(null);
                        if (field != null)
                            field.setOnAction(null);
                    }
                }
            };
        }
    });
}
Also used : Button(javafx.scene.control.Button) EventHandler(javafx.event.EventHandler) Transaction(org.bitcoinj.core.Transaction) OpenOffer(bisq.core.offer.OpenOffer) Utilities(bisq.common.util.Utilities) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) Coin(org.bitcoinj.core.Coin) Date(java.util.Date) CSVEntryConverter(com.googlecode.jcsv.writer.CSVEntryConverter) VBox(javafx.scene.layout.VBox) BSFormatter(bisq.desktop.util.BSFormatter) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) Res(bisq.core.locale.Res) Locale(java.util.Locale) Map(java.util.Map) TableView(javafx.scene.control.TableView) DateFormat(java.text.DateFormat) SortedList(javafx.collections.transformation.SortedList) Popup(bisq.desktop.main.overlays.popups.Popup) P2PService(bisq.network.p2p.P2PService) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) KeyEvent(javafx.scene.input.KeyEvent) Collectors(java.util.stream.Collectors) ECKey(org.bitcoinj.core.ECKey) FXML(javafx.fxml.FXML) List(java.util.List) Script(org.bitcoinj.script.Script) WalletsSetup(bisq.core.btc.wallet.WalletsSetup) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Preferences(bisq.core.user.Preferences) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) GUIUtil(bisq.desktop.util.GUIUtil) BtcWalletService(bisq.core.btc.wallet.BtcWalletService) Scene(javafx.scene.Scene) WalletEventListener(org.bitcoinj.wallet.listeners.WalletEventListener) ActivatableView(bisq.desktop.common.view.ActivatableView) TransactionConfidence(org.bitcoinj.core.TransactionConfidence) OfferDetailsWindow(bisq.desktop.main.overlays.windows.OfferDetailsWindow) Wallet(org.bitcoinj.wallet.Wallet) HashMap(java.util.HashMap) Tradable(bisq.core.trade.Tradable) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) Tuple4(bisq.common.util.Tuple4) Inject(javax.inject.Inject) Tuple2(bisq.common.util.Tuple2) TableCell(javafx.scene.control.TableCell) AddressWithIconAndDirection(bisq.desktop.components.AddressWithIconAndDirection) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) Nullable(javax.annotation.Nullable) KeyCode(javafx.scene.input.KeyCode) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) Trade(bisq.core.trade.Trade) Stage(javafx.stage.Stage) Comparator(java.util.Comparator) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) TableCell(javafx.scene.control.TableCell) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

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