Java Code Examples for javafx.scene.layout.GridPane#setColumnSpan()

The following examples show how to use javafx.scene.layout.GridPane#setColumnSpan() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MutableOfferView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void updateOfferElementsStyle() {
    GridPane.setColumnSpan(firstRowHBox, 1);

    final String activeInputStyle = "input-with-border";
    final String readOnlyInputStyle = "input-with-border-readonly";
    amountValueCurrencyBox.getStyleClass().remove(activeInputStyle);
    amountValueCurrencyBox.getStyleClass().add(readOnlyInputStyle);
    priceAsPercentageValueCurrencyBox.getStyleClass().remove(activeInputStyle);
    priceAsPercentageValueCurrencyBox.getStyleClass().add(readOnlyInputStyle);
    volumeValueCurrencyBox.getStyleClass().remove(activeInputStyle);
    volumeValueCurrencyBox.getStyleClass().add(readOnlyInputStyle);
    priceValueCurrencyBox.getStyleClass().remove(activeInputStyle);
    priceValueCurrencyBox.getStyleClass().add(readOnlyInputStyle);
    minAmountValueCurrencyBox.getStyleClass().remove(activeInputStyle);
    minAmountValueCurrencyBox.getStyleClass().add(readOnlyInputStyle);

    resultLabel.getStyleClass().add("small");
    xLabel.getStyleClass().add("small");
    xIcon.setStyle(String.format("-fx-font-family: %s; -fx-font-size: %s;", MaterialDesignIcon.CLOSE.fontFamily(), "1em"));
    fakeXIcon.setStyle(String.format("-fx-font-family: %s; -fx-font-size: %s;", MaterialDesignIcon.CLOSE.fontFamily(), "1em"));
    fakeXLabel.getStyleClass().add("small");
}
 
Example 2
Source File: BsqReceiveView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void initialize() {
    if (DevEnv.isDaoActivated()) {
        gridRow = bsqBalanceUtil.addGroup(root, gridRow);

        TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 1,
                Res.get("dao.wallet.receive.fundYourWallet"), Layout.GROUP_DISTANCE);
        titledGroupBg.getStyleClass().add("last");
        GridPane.setColumnSpan(titledGroupBg, 3);
        Tuple3<Label, BsqAddressTextField, VBox> tuple = addLabelBsqAddressTextField(root, gridRow,
                Res.get("dao.wallet.receive.bsqAddress"),
                Layout.FIRST_ROW_AND_GROUP_DISTANCE);
        addressTextField = tuple.second;
        GridPane.setColumnSpan(tuple.third, 3);
    }
}
 
Example 3
Source File: DisplayUpdateDownloadWindow.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected void addButtons() {
    closeButton = new AutoTooltipButton(Res.get("displayUpdateDownloadWindow.button.ignoreDownload"));
    closeButton.setOnAction(event -> doClose());
    actionButton = new AutoTooltipButton(Res.get("displayUpdateDownloadWindow.button.downloadLater"));
    actionButton.setDefaultButton(false);
    actionButton.setOnAction(event -> {
        cleanup();
        hide();
        actionHandlerOptional.ifPresent(Runnable::run);
    });

    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(closeButton, actionButton);

    GridPane.setHalignment(hBox, HPos.LEFT);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnSpan(hBox, 2);
    GridPane.setMargin(hBox, new Insets(buttonDistance, 0, 0, 0));
    gridPane.getChildren().add(hBox);
}
 
Example 4
Source File: Overlay.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
protected void addHeadLine() {
    if (headLine != null) {
        ++rowIndex;

        HBox hBox = new HBox();
        hBox.setSpacing(7);
        headLineLabel = new AutoTooltipLabel(headLine);
        headlineIcon = new Label();
        headlineIcon.setManaged(false);
        headlineIcon.setVisible(false);
        headlineIcon.setPadding(new Insets(3));
        headLineLabel.setMouseTransparent(true);

        if (headlineStyle != null)
            headLineLabel.setStyle(headlineStyle);

        hBox.getChildren().addAll(headlineIcon, headLineLabel);

        GridPane.setHalignment(hBox, HPos.LEFT);
        GridPane.setRowIndex(hBox, rowIndex);
        GridPane.setColumnSpan(hBox, 2);
        gridPane.getChildren().addAll(hBox);
    }
}
 
Example 5
Source File: VoteResultView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void createCyclesTable() {
    TableGroupHeadline headline = new TableGroupHeadline(Res.get("dao.results.cycles.header"));
    GridPane.setRowIndex(headline, ++gridRow);
    GridPane.setMargin(headline, new Insets(Layout.GROUP_DISTANCE, -10, -10, -10));
    GridPane.setColumnSpan(headline, 2);
    root.getChildren().add(headline);

    cyclesTableView = new TableView<>();
    cyclesTableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.processingData")));
    cyclesTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    createCycleColumns(cyclesTableView);

    GridPane.setRowIndex(cyclesTableView, gridRow);
    GridPane.setMargin(cyclesTableView, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, -10, -15, -10));
    GridPane.setColumnSpan(cyclesTableView, 2);
    GridPane.setVgrow(cyclesTableView, Priority.SOMETIMES);
    root.getChildren().add(cyclesTableView);

    cyclesTableView.setItems(sortedCycleListItemList);
    sortedCycleListItemList.comparatorProperty().bind(cyclesTableView.comparatorProperty());


}
 
Example 6
Source File: WalletPasswordWindow.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private void addInputFields() {
    passwordTextField = addPasswordTextField(gridPane, ++rowIndex, Res.get("password.enterPassword"), Layout.FLOATING_LABEL_DISTANCE);
    GridPane.setColumnSpan(passwordTextField, 1);
    GridPane.setHalignment(passwordTextField, HPos.LEFT);
    changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordTextField.validate());
    passwordTextField.textProperty().addListener(changeListener);
}
 
Example 7
Source File: TorNetworkSettingsWindow.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
protected void addButtons() {
    closeButton = new AutoTooltipButton(closeButtonText == null ? Res.get("shared.close") : closeButtonText);
    closeButton.setOnAction(event -> doClose());

    if (actionHandlerOptional.isPresent()) {
        actionButton = new AutoTooltipButton(Res.get("shared.shutDown"));
        actionButton.setDefaultButton(true);
        //TODO app wide focus
        //actionButton.requestFocus();
        actionButton.setOnAction(event -> saveAndShutDown());

        Button urlButton = new AutoTooltipButton(Res.get("torNetworkSettingWindow.openTorWebPage"));
        urlButton.setOnAction(event -> {
            try {
                Utilities.openURI(URI.create("https://bridges.torproject.org/bridges"));
            } catch (IOException e) {
                e.printStackTrace();
            }
        });

        Pane spacer = new Pane();
        HBox hBox = new HBox();
        hBox.setSpacing(10);
        hBox.getChildren().addAll(spacer, urlButton, closeButton, actionButton);
        HBox.setHgrow(spacer, Priority.ALWAYS);

        GridPane.setHalignment(hBox, HPos.RIGHT);
        GridPane.setRowIndex(hBox, ++rowIndex);
        GridPane.setColumnSpan(hBox, 2);
        GridPane.setMargin(hBox, new Insets(buttonDistance, 0, 0, 0));
        gridPane.getChildren().add(hBox);
    } else if (!hideCloseButton) {
        closeButton.setDefaultButton(true);
        GridPane.setHalignment(closeButton, HPos.RIGHT);
        GridPane.setMargin(closeButton, new Insets(buttonDistance, 0, 0, 0));
        GridPane.setRowIndex(closeButton, rowIndex);
        GridPane.setColumnIndex(closeButton, 1);
        gridPane.getChildren().add(closeButton);
    }
}
 
Example 8
Source File: UnlockDisputeAgentRegistrationWindow.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private void addInputFields() {
    final Tuple3<Label, InputTextField, VBox> labelInputTextFieldTuple2 = addTopLabelInputTextFieldWithVBox(gridPane,
            ++rowIndex, Res.get("shared.enterPrivKey"), 3);
    GridPane.setColumnSpan(labelInputTextFieldTuple2.third, 2);
    Label label = labelInputTextFieldTuple2.first;
    label.setWrapText(true);

    keyInputTextField = labelInputTextFieldTuple2.second;
    if (useDevPrivilegeKeys)
        keyInputTextField.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);
    changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(newValue.length() == 0);
    keyInputTextField.textProperty().addListener(changeListener);
}
 
Example 9
Source File: QRCodeWindow.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void show() {
    createGridPane();
    addHeadLine();
    addMessage();

    GridPane.setRowIndex(qrCodeImageView, ++rowIndex);
    GridPane.setColumnSpan(qrCodeImageView, 2);
    GridPane.setHalignment(qrCodeImageView, HPos.CENTER);
    gridPane.getChildren().add(qrCodeImageView);

    String request = bitcoinURI.replace("%20", " ").replace("?", "\n?").replace("&", "\n&");
    Label infoLabel = new AutoTooltipLabel(Res.get("qRCodeWindow.request", request));
    infoLabel.setMouseTransparent(true);
    infoLabel.setWrapText(true);
    infoLabel.setId("popup-qr-code-info");
    GridPane.setHalignment(infoLabel, HPos.CENTER);
    GridPane.setHgrow(infoLabel, Priority.ALWAYS);
    GridPane.setMargin(infoLabel, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(infoLabel, ++rowIndex);
    GridPane.setColumnIndex(infoLabel, 0);
    GridPane.setColumnSpan(infoLabel, 2);
    gridPane.getChildren().add(infoLabel);

    addButtons();
    applyStyles();
    display();
}
 
Example 10
Source File: Overlay.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
protected void addBusyAnimation() {
    BusyAnimation busyAnimation = new BusyAnimation();
    GridPane.setHalignment(busyAnimation, HPos.CENTER);
    GridPane.setRowIndex(busyAnimation, ++rowIndex);
    GridPane.setColumnSpan(busyAnimation, 2);
    gridPane.getChildren().add(busyAnimation);
}
 
Example 11
Source File: TradeStepView.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private GridPane createInfoPopover() {
    GridPane infoGridPane = new GridPane();
    int rowIndex = 0;
    infoGridPane.setHgap(5);
    infoGridPane.setVgap(10);
    infoGridPane.setPadding(new Insets(10, 10, 10, 10));
    Label label = addMultilineLabel(infoGridPane, rowIndex++, Res.get("portfolio.pending.tradePeriodInfo"));
    label.setMaxWidth(450);

    HBox warningBox = new HBox();
    warningBox.setMinHeight(30);
    warningBox.setPadding(new Insets(5));
    warningBox.getStyleClass().add("warning-box");
    GridPane.setRowIndex(warningBox, rowIndex);
    GridPane.setColumnSpan(warningBox, 2);

    Label warningIcon = new Label();
    AwesomeDude.setIcon(warningIcon, AwesomeIcon.WARNING_SIGN);
    warningIcon.getStyleClass().add("warning");

    Label warning = new Label(Res.get("portfolio.pending.tradePeriodWarning"));
    warning.setWrapText(true);
    warning.setMaxWidth(410);

    warningBox.getChildren().addAll(warningIcon, warning);
    infoGridPane.getChildren().add(warningBox);

    return infoGridPane;
}
 
Example 12
Source File: TitledGroupBg.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public TitledGroupBg() {
    GridPane.setMargin(this, new Insets(-10, -10, -10, -10));
    GridPane.setColumnSpan(this, 2);

    label = new AutoTooltipLabel();
    label.textProperty().bind(text);
    label.setLayoutX(4);
    label.setLayoutY(-8);
    label.setPadding(new Insets(0, 7, 0, 5));
    setActive();
    getChildren().add(label);
}
 
Example 13
Source File: PreferencesView.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initializeDaoOptions() {
    daoOptionsTitledGroupBg = addTitledGroupBg(root, ++gridRow, 2, Res.get("setting.preferences.daoOptions"), Layout.GROUP_DISTANCE);
    resyncDaoFromResourcesButton = addButton(root, gridRow, Res.get("setting.preferences.dao.resyncFromResources.label"), Layout.TWICE_FIRST_ROW_AND_GROUP_DISTANCE);
    resyncDaoFromResourcesButton.setMaxWidth(Double.MAX_VALUE);
    GridPane.setHgrow(resyncDaoFromResourcesButton, Priority.ALWAYS);

    resyncDaoFromGenesisButton = addButton(root, ++gridRow, Res.get("setting.preferences.dao.resyncFromGenesis.label"));
    resyncDaoFromGenesisButton.setMaxWidth(Double.MAX_VALUE);
    GridPane.setHgrow(resyncDaoFromGenesisButton, Priority.ALWAYS);

    isDaoFullNodeToggleButton = addSlideToggleButton(root, ++gridRow, Res.get("setting.preferences.dao.isDaoFullNode"));
    rpcUserTextField = addInputTextField(root, ++gridRow, Res.get("setting.preferences.dao.rpcUser"));
    rpcUserTextField.setVisible(false);
    rpcUserTextField.setManaged(false);
    rpcPwTextField = addPasswordTextField(root, ++gridRow, Res.get("setting.preferences.dao.rpcPw"));
    rpcPwTextField.setVisible(false);
    rpcPwTextField.setManaged(false);

    // @Christoph: addPasswordTextField has by default column span 2. Would be better to dont set it there...
    GridPane.setColumnSpan(rpcPwTextField, 1);
    GridPane.setMargin(rpcPwTextField, new Insets(20, 0, 0, 0));

    blockNotifyPortTextField = addInputTextField(root, ++gridRow, Res.get("setting.preferences.dao.blockNotifyPort"));
    blockNotifyPortTextField.setVisible(false);
    blockNotifyPortTextField.setManaged(false);

    rpcUserListener = (observable, oldValue, newValue) -> preferences.setRpcUser(rpcUserTextField.getText());
    rpcPwListener = (observable, oldValue, newValue) -> preferences.setRpcPw(rpcPwTextField.getText());
    blockNotifyPortListener = (observable, oldValue, newValue) -> {
        try {
            int port = Integer.parseInt(blockNotifyPortTextField.getText());
            preferences.setBlockNotifyPort(port);
        } catch (Throwable ignore) {
            log.warn("Invalid input for blockNotifyPort: {}", blockNotifyPortTextField.getText());
        }
    };
}
 
Example 14
Source File: TilingPane.java    From chart-fx with Apache License 2.0 4 votes vote down vote up
protected void layoutNormal() {
    if (getChildren().isEmpty()) {
        return;
    }
    final int colsCount = getColumnsCount();

    if (getColumnConstraints().size() != colsCount) {
        final List<ColumnConstraints> colConstraintList = new ArrayList<>();
        for (int i = 0; i < colsCount; i++) {
            final ColumnConstraints colConstraints = new ColumnConstraints(); // NOPMD
            colConstraints.setPercentWidth(100.0 / colsCount);
            colConstraints.setFillWidth(true);
            colConstraintList.add(colConstraints);
        }
        getColumnConstraints().setAll(colConstraintList);
    }

    int rowIndex = 0;
    int colIndex = 0;
    int childCount = 0;
    final int nChildren = getChildren().size();
    int nColSpan = Math.max(1, colsCount / (nChildren - childCount));
    for (final Node child : getChildren()) {
        GridPane.setFillWidth(child, true);
        GridPane.setFillHeight(child, true);
        GridPane.setColumnIndex(child, colIndex);
        GridPane.setRowIndex(child, rowIndex);

        if ((colIndex == 0) && ((nChildren - childCount) < colsCount)) {
            nColSpan = Math.max(1, colsCount / (nChildren - childCount));
        }
        // last window fills up row
        if (((nChildren - childCount) == 1) && (colIndex < colsCount)) {
            nColSpan = colsCount - colIndex;
        }

        GridPane.setColumnSpan(child, nColSpan);

        colIndex += nColSpan;
        if (colIndex >= colsCount) {
            colIndex = 0;
            rowIndex++;
        }
        childCount++;
    }
}
 
Example 15
Source File: SendPrivateNotificationWindow.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private void addContent() {
    InputTextField keyInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("shared.unlock"), 10);
    if (useDevPrivilegeKeys)
        keyInputTextField.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);

    Tuple2<Label, TextArea> labelTextAreaTuple2 = addTopLabelTextArea(gridPane, ++rowIndex,
            Res.get("sendPrivateNotificationWindow.privateNotification"),
            Res.get("sendPrivateNotificationWindow.enterNotification"));
    TextArea alertMessageTextArea = labelTextAreaTuple2.second;
    Label first = labelTextAreaTuple2.first;
    first.setMinWidth(200);

    Button sendButton = new AutoTooltipButton(Res.get("sendPrivateNotificationWindow.send"));
    sendButton.setOnAction(e -> {
        if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
            PrivateNotificationPayload privateNotification = new PrivateNotificationPayload(alertMessageTextArea.getText());
            if (!privateNotificationManager.sendPrivateNotificationMessageIfKeyIsValid(
                    privateNotification,
                    pubKeyRing,
                    nodeAddress,
                    keyInputTextField.getText(),
                    new SendMailboxMessageListener() {
                        @Override
                        public void onArrived() {
                            log.info("PrivateNotificationPayload arrived at peer {}.", nodeAddress);
                            new Popup().feedback(Res.get("shared.messageArrived"))
                                    .onClose(SendPrivateNotificationWindow.this::hide).show();
                        }

                        @Override
                        public void onStoredInMailbox() {
                            log.info("PrivateNotificationPayload stored in mailbox for peer {}.", nodeAddress);
                            new Popup().feedback(Res.get("shared.messageStoredInMailbox"))
                                    .onClose(SendPrivateNotificationWindow.this::hide).show();
                        }

                        @Override
                        public void onFault(String errorMessage) {
                            log.error("PrivateNotificationPayload failed: Peer {}, errorMessage={}", nodeAddress,
                                    errorMessage);
                            new Popup().feedback(Res.get("shared.messageSendingFailed", errorMessage))
                                    .onClose(SendPrivateNotificationWindow.this::hide).show();
                        }
                    }))
                new Popup().warning(Res.get("shared.invalidKey")).width(300).onClose(this::blurAgain).show();
        }
    });

    closeButton = new AutoTooltipButton(Res.get("shared.close"));
    closeButton.setOnAction(e -> {
        hide();
        closeHandlerOptional.ifPresent(Runnable::run);
    });

    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.setAlignment(Pos.CENTER_RIGHT);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnSpan(hBox, 2);
    GridPane.setColumnIndex(hBox, 0);
    hBox.getChildren().addAll(sendButton, closeButton);
    gridPane.getChildren().add(hBox);
    GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
 
Example 16
Source File: TakeOfferView.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private void addPaymentGroup() {
    paymentAccountTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 1, Res.get("takeOffer.paymentInfo"));
    GridPane.setColumnSpan(paymentAccountTitledGroupBg, 2);

    final Tuple4<ComboBox<PaymentAccount>, Label, TextField, HBox> paymentAccountTuple = addComboBoxTopLabelTextField(gridPane,
            gridRow, Res.get("shared.selectTradingAccount"),
            Res.get("shared.paymentMethod"), Layout.FIRST_ROW_DISTANCE);

    paymentAccountsComboBox = paymentAccountTuple.first;
    HBox.setMargin(paymentAccountsComboBox, new Insets(Layout.FLOATING_LABEL_DISTANCE, 0, 0, 0));
    paymentAccountsComboBox.setConverter(GUIUtil.getPaymentAccountsComboBoxStringConverter());
    paymentAccountsComboBox.setCellFactory(model.getPaymentAccountListCellFactory(paymentAccountsComboBox));
    paymentAccountsComboBox.setVisible(false);
    paymentAccountsComboBox.setManaged(false);
    paymentAccountsComboBox.setOnAction(e -> {
        PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
        if (paymentAccount != null) {
            maybeShowClearXchangeWarning(paymentAccount);
            maybeShowFasterPaymentsWarning(paymentAccount);
        }
        model.onPaymentAccountSelected(paymentAccount);
    });

    paymentMethodLabel = paymentAccountTuple.second;
    paymentMethodTextField = paymentAccountTuple.third;
    paymentMethodTextField.setMinWidth(250);
    paymentMethodTextField.setEditable(false);
    paymentMethodTextField.setMouseTransparent(true);
    paymentMethodTextField.setFocusTraversable(false);

    currencyTextField = new JFXTextField();
    currencyTextField.setMinWidth(250);
    currencyTextField.setEditable(false);
    currencyTextField.setMouseTransparent(true);
    currencyTextField.setFocusTraversable(false);

    final Tuple2<Label, VBox> tradeCurrencyTuple = getTopLabelWithVBox(Res.get("shared.tradeCurrency"), currencyTextField);
    HBox.setMargin(tradeCurrencyTuple.second, new Insets(5, 0, 0, 0));

    final HBox hBox = paymentAccountTuple.fourth;
    hBox.setSpacing(30);
    hBox.setAlignment(Pos.CENTER_LEFT);
    hBox.setPadding(new Insets(10, 0, 18, 0));

    hBox.getChildren().add(tradeCurrencyTuple.second);
}
 
Example 17
Source File: BSQTransactionsView.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void initialize() {
    addTitledGroupBg(root, gridRow, 2, Res.get("dao.factsAndFigures.transactions.genesis"));
    String genTxHeight = String.valueOf(daoFacade.getGenesisBlockHeight());
    String genesisTxId = daoFacade.getGenesisTxId();
    String url = preferences.getBsqBlockChainExplorer().txUrl + genesisTxId;

    GridPane.setColumnSpan(addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.factsAndFigures.transactions.genesisBlockHeight"),
            genTxHeight, Layout.FIRST_ROW_DISTANCE).third, 2);

    // TODO use addTopLabelTxIdTextField
    Tuple3<Label, HyperlinkWithIcon, VBox> tuple = addTopLabelHyperlinkWithIcon(root, ++gridRow,
            Res.get("dao.factsAndFigures.transactions.genesisTxId"), genesisTxId, url, 0);
    HyperlinkWithIcon hyperlinkWithIcon = tuple.second;
    hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", genesisTxId)));

    GridPane.setColumnSpan(tuple.third, 2);


    int startRow = ++gridRow;

    TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, 3, Res.get("dao.factsAndFigures.transactions.txDetails"), Layout.GROUP_DISTANCE);
    titledGroupBg.getStyleClass().add("last");

    allTxTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.factsAndFigures.transactions.allTx"),
            genTxHeight, Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
    utxoTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.factsAndFigures.transactions.utxo")).second;
    compensationIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow,
            Res.get("dao.factsAndFigures.transactions.compensationIssuanceTx")).second;
    reimbursementIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow,
            Res.get("dao.factsAndFigures.transactions.reimbursementIssuanceTx")).second;

    int columnIndex = 1;
    gridRow = startRow;

    titledGroupBg = addTitledGroupBg(root, startRow, columnIndex, 3, "", Layout.GROUP_DISTANCE);
    titledGroupBg.getStyleClass().add("last");

    burntFeeTxsTextField = addTopLabelReadOnlyTextField(root, gridRow, columnIndex,
            Res.get("dao.factsAndFigures.transactions.burntTx"),
            Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
    invalidTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
            Res.get("dao.factsAndFigures.transactions.invalidTx")).second;
    irregularTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
            Res.get("dao.factsAndFigures.transactions.irregularTx")).second;
    gridRow++;

}
 
Example 18
Source File: BsqTxView.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void initialize() {
    gridRow = bsqBalanceUtil.addGroup(root, gridRow);

    tableView = new TableView<>();
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    addDateColumn();
    addTxIdColumn();
    addInformationColumn();
    addAmountColumn();
    addConfidenceColumn();
    addTxTypeColumn();

    chainSyncIndicator = new JFXProgressBar();
    chainSyncIndicator.setPrefWidth(120);
    if (DevEnv.isDaoActivated())
        chainSyncIndicator.setProgress(-1);
    else
        chainSyncIndicator.setProgress(0);
    chainSyncIndicator.setPadding(new Insets(-6, 0, -10, 5));

    chainHeightLabel = FormBuilder.addLabel(root, ++gridRow, "");
    chainHeightLabel.setId("num-offers");
    chainHeightLabel.setPadding(new Insets(-5, 0, -10, 5));

    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(chainHeightLabel, chainSyncIndicator);

    VBox vBox = new VBox();
    vBox.setSpacing(10);
    GridPane.setVgrow(vBox, Priority.ALWAYS);
    GridPane.setRowIndex(vBox, ++gridRow);
    GridPane.setColumnSpan(vBox, 3);
    GridPane.setRowSpan(vBox, 2);
    GridPane.setMargin(vBox, new Insets(40, -10, 5, -10));
    vBox.getChildren().addAll(tableView, hBox);
    VBox.setVgrow(tableView, Priority.ALWAYS);
    root.getChildren().add(vBox);

    walletChainHeightListener = (observable, oldValue, newValue) -> {
        walletChainHeight = bsqWalletService.getBestChainHeight();
        onUpdateAnyChainHeight();
    };
}
 
Example 19
Source File: BsqSendView.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private void addSendBsqGroup() {
    TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 2, Res.get("dao.wallet.send.sendFunds"), Layout.GROUP_DISTANCE);
    GridPane.setColumnSpan(titledGroupBg, 3);

    receiversAddressInputTextField = addInputTextField(root, gridRow,
            Res.get("dao.wallet.send.receiverAddress"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    receiversAddressInputTextField.setValidator(bsqAddressValidator);
    GridPane.setColumnSpan(receiversAddressInputTextField, 3);

    amountInputTextField = addInputTextField(root, ++gridRow, Res.get("dao.wallet.send.setAmount", bsqFormatter.formatCoinWithCode(Restrictions.getMinNonDustOutput())));
    amountInputTextField.setValidator(bsqValidator);
    GridPane.setColumnSpan(amountInputTextField, 3);

    focusOutListener = (observable, oldValue, newValue) -> {
        if (!newValue)
            onUpdateBalances();
    };

    sendBsqButton = addButtonAfterGroup(root, ++gridRow, Res.get("dao.wallet.send.send"));

    sendBsqButton.setOnAction((event) -> {
        // TODO break up in methods
        if (GUIUtil.isReadyForTxBroadcastOrShowPopup(p2PService, walletsSetup)) {
            String receiversAddressString = bsqFormatter.getAddressFromBsqAddress(receiversAddressInputTextField.getText()).toString();
            Coin receiverAmount = ParsingUtils.parseToCoin(amountInputTextField.getText(), bsqFormatter);
            try {
                Transaction preparedSendTx = bsqWalletService.getPreparedSendBsqTx(receiversAddressString, receiverAmount);
                Transaction txWithBtcFee = btcWalletService.completePreparedSendBsqTx(preparedSendTx, true);
                Transaction signedTx = bsqWalletService.signTx(txWithBtcFee);
                Coin miningFee = signedTx.getFee();
                int txSize = signedTx.bitcoinSerialize().length;
                showPublishTxPopup(receiverAmount,
                        txWithBtcFee,
                        TxType.TRANSFER_BSQ,
                        miningFee,
                        txSize,
                        receiversAddressInputTextField.getText(),
                        bsqFormatter,
                        btcFormatter,
                        () -> {
                            receiversAddressInputTextField.setText("");
                            amountInputTextField.setText("");
                        });
            } catch (BsqChangeBelowDustException e) {
                String msg = Res.get("popup.warning.bsqChangeBelowDustException", bsqFormatter.formatCoinWithCode(e.getOutputValue()));
                new Popup().warning(msg).show();
            } catch (Throwable t) {
                handleError(t);
            }
        }
    });
}
 
Example 20
Source File: DisputeSummaryWindow.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private void addReasonControls() {
    reasonWasBugRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.bug"));
    reasonWasUsabilityIssueRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.usability"));
    reasonProtocolViolationRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.protocolViolation"));
    reasonNoReplyRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.noReply"));
    reasonWasScamRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.scam"));
    reasonWasBankRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.bank"));
    reasonWasOtherRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.other"));

    HBox feeRadioButtonPane = new HBox();
    feeRadioButtonPane.setSpacing(20);
    feeRadioButtonPane.getChildren().addAll(reasonWasBugRadioButton, reasonWasUsabilityIssueRadioButton,
            reasonProtocolViolationRadioButton, reasonNoReplyRadioButton,
            reasonWasBankRadioButton, reasonWasScamRadioButton, reasonWasOtherRadioButton);

    VBox vBox = addTopLabelWithVBox(gridPane, ++rowIndex,
            Res.get("disputeSummaryWindow.reason"),
            feeRadioButtonPane, 10).second;
    GridPane.setColumnSpan(vBox, 2);

    reasonToggleGroup = new ToggleGroup();
    reasonWasBugRadioButton.setToggleGroup(reasonToggleGroup);
    reasonWasUsabilityIssueRadioButton.setToggleGroup(reasonToggleGroup);
    reasonProtocolViolationRadioButton.setToggleGroup(reasonToggleGroup);
    reasonNoReplyRadioButton.setToggleGroup(reasonToggleGroup);
    reasonWasScamRadioButton.setToggleGroup(reasonToggleGroup);
    reasonWasOtherRadioButton.setToggleGroup(reasonToggleGroup);
    reasonWasBankRadioButton.setToggleGroup(reasonToggleGroup);

    reasonToggleSelectionListener = (observable, oldValue, newValue) -> {
        if (newValue == reasonWasBugRadioButton)
            disputeResult.setReason(DisputeResult.Reason.BUG);
        else if (newValue == reasonWasUsabilityIssueRadioButton)
            disputeResult.setReason(DisputeResult.Reason.USABILITY);
        else if (newValue == reasonProtocolViolationRadioButton)
            disputeResult.setReason(DisputeResult.Reason.PROTOCOL_VIOLATION);
        else if (newValue == reasonNoReplyRadioButton)
            disputeResult.setReason(DisputeResult.Reason.NO_REPLY);
        else if (newValue == reasonWasScamRadioButton)
            disputeResult.setReason(DisputeResult.Reason.SCAM);
        else if (newValue == reasonWasBankRadioButton)
            disputeResult.setReason(DisputeResult.Reason.BANK_PROBLEMS);
        else if (newValue == reasonWasOtherRadioButton)
            disputeResult.setReason(DisputeResult.Reason.OTHER);
    };
    reasonToggleGroup.selectedToggleProperty().addListener(reasonToggleSelectionListener);
}