Search in sources :

Example 1 with AutoTooltipRadioButton

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

the class DisputeSummaryWindow method addTradeAmountPayoutControls.

private void addTradeAmountPayoutControls() {
    Label distributionLabel = addLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.payout"), 10);
    GridPane.setValignment(distributionLabel, VPos.TOP);
    buyerGetsTradeAmountRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.getsTradeAmount", Res.get("shared.buyer")));
    buyerGetsAllRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.getsAll", Res.get("shared.buyer")));
    sellerGetsTradeAmountRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.getsTradeAmount", Res.get("shared.seller")));
    sellerGetsAllRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.getsAll", Res.get("shared.seller")));
    customRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.custom"));
    VBox radioButtonPane = new VBox();
    radioButtonPane.setSpacing(10);
    radioButtonPane.getChildren().addAll(buyerGetsTradeAmountRadioButton, buyerGetsAllRadioButton, sellerGetsTradeAmountRadioButton, sellerGetsAllRadioButton, customRadioButton);
    GridPane.setRowIndex(radioButtonPane, rowIndex);
    GridPane.setColumnIndex(radioButtonPane, 1);
    GridPane.setMargin(radioButtonPane, new Insets(10, 0, 0, 0));
    gridPane.getChildren().add(radioButtonPane);
    tradeAmountToggleGroup = new ToggleGroup();
    buyerGetsTradeAmountRadioButton.setToggleGroup(tradeAmountToggleGroup);
    buyerGetsAllRadioButton.setToggleGroup(tradeAmountToggleGroup);
    sellerGetsTradeAmountRadioButton.setToggleGroup(tradeAmountToggleGroup);
    sellerGetsAllRadioButton.setToggleGroup(tradeAmountToggleGroup);
    customRadioButton.setToggleGroup(tradeAmountToggleGroup);
    tradeAmountToggleGroupListener = (observable, oldValue, newValue) -> applyPayoutAmounts(newValue);
    tradeAmountToggleGroup.selectedToggleProperty().addListener(tradeAmountToggleGroupListener);
    buyerPayoutAmountListener = (observable1, oldValue1, newValue1) -> applyCustomAmounts(buyerPayoutAmountInputTextField);
    sellerPayoutAmountListener = (observable1, oldValue1, newValue1) -> applyCustomAmounts(sellerPayoutAmountInputTextField);
    customRadioButtonSelectedListener = (observable, oldValue, newValue) -> {
        buyerPayoutAmountInputTextField.setEditable(newValue);
        sellerPayoutAmountInputTextField.setEditable(newValue);
        if (newValue) {
            buyerPayoutAmountInputTextField.textProperty().addListener(buyerPayoutAmountListener);
            sellerPayoutAmountInputTextField.textProperty().addListener(sellerPayoutAmountListener);
        } else {
            removePayoutAmountListeners();
        }
    };
    customRadioButton.selectedProperty().addListener(customRadioButtonSelectedListener);
}
Also used : Insets(javafx.geometry.Insets) ToggleGroup(javafx.scene.control.ToggleGroup) Label(javafx.scene.control.Label) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) VBox(javafx.scene.layout.VBox)

Example 2 with AutoTooltipRadioButton

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

the class FormBuilder method addRadioButton.

// /////////////////////////////////////////////////////////////////////////////////////////
// RadioButton
// /////////////////////////////////////////////////////////////////////////////////////////
public static RadioButton addRadioButton(GridPane gridPane, int rowIndex, ToggleGroup toggleGroup, String title) {
    RadioButton radioButton = new AutoTooltipRadioButton(title);
    radioButton.setToggleGroup(toggleGroup);
    GridPane.setRowIndex(radioButton, rowIndex);
    GridPane.setColumnIndex(radioButton, 1);
    gridPane.getChildren().add(radioButton);
    return radioButton;
}
Also used : AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton)

Example 3 with AutoTooltipRadioButton

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

the class FormBuilder method addLabelRadioButton.

// /////////////////////////////////////////////////////////////////////////////////////////
// Label  + RadioButton
// /////////////////////////////////////////////////////////////////////////////////////////
public static Tuple2<Label, RadioButton> addLabelRadioButton(GridPane gridPane, int rowIndex, ToggleGroup toggleGroup, String title, String radioButtonTitle) {
    Label label = addLabel(gridPane, rowIndex, title, 0);
    RadioButton radioButton = new AutoTooltipRadioButton(radioButtonTitle);
    radioButton.setToggleGroup(toggleGroup);
    radioButton.setPadding(new Insets(6, 0, 0, 0));
    GridPane.setRowIndex(radioButton, rowIndex);
    GridPane.setColumnIndex(radioButton, 1);
    gridPane.getChildren().add(radioButton);
    return new Tuple2<>(label, radioButton);
}
Also used : Insets(javafx.geometry.Insets) Tuple2(bisq.common.util.Tuple2) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton)

Example 4 with AutoTooltipRadioButton

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

the class FormBuilder method addLabelRadioButtonRadioButton.

// /////////////////////////////////////////////////////////////////////////////////////////
// Label  + RadioButton + RadioButton
// /////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<Label, RadioButton, RadioButton> addLabelRadioButtonRadioButton(GridPane gridPane, int rowIndex, ToggleGroup toggleGroup, String title, String radioButtonTitle1, String radioButtonTitle2) {
    Label label = addLabel(gridPane, rowIndex, title, 0);
    RadioButton radioButton1 = new AutoTooltipRadioButton(radioButtonTitle1);
    radioButton1.setToggleGroup(toggleGroup);
    radioButton1.setPadding(new Insets(6, 0, 0, 0));
    RadioButton radioButton2 = new AutoTooltipRadioButton(radioButtonTitle2);
    radioButton2.setToggleGroup(toggleGroup);
    radioButton2.setPadding(new Insets(6, 0, 0, 0));
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(radioButton1, radioButton2);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    gridPane.getChildren().add(hBox);
    return new Tuple3<>(label, radioButton1, radioButton2);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton)

Example 5 with AutoTooltipRadioButton

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

the class DisputeSummaryWindow method addReasonControls.

private void addReasonControls() {
    Label label = addLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.reason"), 10);
    GridPane.setValignment(label, VPos.TOP);
    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);
    GridPane.setRowIndex(feeRadioButtonPane, rowIndex);
    GridPane.setColumnIndex(feeRadioButtonPane, 1);
    GridPane.setMargin(feeRadioButtonPane, new Insets(10, 0, 10, 0));
    gridPane.getChildren().add(feeRadioButtonPane);
    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);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) ToggleGroup(javafx.scene.control.ToggleGroup) Label(javafx.scene.control.Label) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton)

Aggregations

AutoTooltipRadioButton (bisq.desktop.components.AutoTooltipRadioButton)5 Insets (javafx.geometry.Insets)4 Label (javafx.scene.control.Label)4 RadioButton (javafx.scene.control.RadioButton)3 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)2 ToggleGroup (javafx.scene.control.ToggleGroup)2 HBox (javafx.scene.layout.HBox)2 Tuple2 (bisq.common.util.Tuple2)1 Tuple3 (bisq.common.util.Tuple3)1 VBox (javafx.scene.layout.VBox)1