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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations