Search in sources :

Example 6 with HBox

use of javafx.scene.layout.HBox in project aic-praise by aic-sri-international.

the class SGSolverDemoController method configureSettingsContent.

private Node configureSettingsContent() {
    VBox configureMenu = new VBox(2);
    configureMenu.setPadding(new Insets(3, 3, 3, 3));
    HBox displayPrecisionHBox = newButtonHBox();
    displayPrecisionSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 80, _displayPrecision.get()));
    displayPrecisionSpinner.setPrefWidth(60);
    _displayPrecision.bind(displayPrecisionSpinner.valueProperty());
    displayPrecisionHBox.getChildren().addAll(new Label("Display Numeric Precision:"), displayPrecisionSpinner);
    displayExactCheckBox.setSelected(_isDisplayExact.get());
    displayExactCheckBox.setText("Display Numerics Exactly");
    _isDisplayExact.bind(displayExactCheckBox.selectedProperty());
    HBox displayScientificHBox = newButtonHBox();
    displayScientificGreater.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(2, 80, _displayScientificGreater.get()));
    displayScientificGreater.setPrefWidth(60);
    _displayScientificGreater.bind(displayScientificGreater.valueProperty());
    displayScientificAfter.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(2, 80, _displayScientificAfter.get()));
    displayScientificAfter.setPrefWidth(60);
    _displayScientificAfter.bind(displayScientificAfter.valueProperty());
    displayScientificHBox.getChildren().addAll(new Label("Use Scientific When Outside Range:"), displayScientificGreater, new Label("."), displayScientificAfter);
    debugModeCheckBox.setSelected(_inDebugMode.get());
    debugModeCheckBox.setText("In Debug Mode");
    _inDebugMode.bind(debugModeCheckBox.selectedProperty());
    configureMenu.getChildren().addAll(displayPrecisionHBox, displayScientificHBox, displayExactCheckBox, new Separator(Orientation.HORIZONTAL), debugModeCheckBox);
    return configureMenu;
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Label(javafx.scene.control.Label) VBox(javafx.scene.layout.VBox) Separator(javafx.scene.control.Separator) SpinnerValueFactory(javafx.scene.control.SpinnerValueFactory)

Example 7 with HBox

use of javafx.scene.layout.HBox in project jabref by JabRef.

the class LinkedFilesEditor method createFileDisplay.

private static Node createFileDisplay(LinkedFileViewModel linkedFile) {
    Text icon = MaterialDesignIconFactory.get().createIcon(linkedFile.getTypeIcon());
    Text text = new Text(linkedFile.getLink());
    ProgressBar progressIndicator = new ProgressBar();
    progressIndicator.progressProperty().bind(linkedFile.downloadProgressProperty());
    progressIndicator.visibleProperty().bind(linkedFile.downloadOngoingProperty());
    Button acceptAutoLinkedFile = MaterialDesignIconFactory.get().createIconButton(MaterialDesignIcon.BRIEFCASE_CHECK);
    acceptAutoLinkedFile.setTooltip(new Tooltip(Localization.lang("This file was found automatically. Do you want to link it to this entry?")));
    acceptAutoLinkedFile.visibleProperty().bind(linkedFile.isAutomaticallyFoundProperty());
    acceptAutoLinkedFile.setOnAction(event -> linkedFile.acceptAsLinked());
    acceptAutoLinkedFile.getStyleClass().setAll("flatButton");
    HBox container = new HBox(10);
    container.setPrefHeight(Double.NEGATIVE_INFINITY);
    container.getChildren().addAll(icon, text, progressIndicator, acceptAutoLinkedFile);
    return container;
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) Text(javafx.scene.text.Text) ProgressBar(javafx.scene.control.ProgressBar)

Example 8 with HBox

use of javafx.scene.layout.HBox in project bitsquare by bitsquare.

the class SendPrivateNotificationWindow method addContent.

private void addContent() {
    InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Key for private notification:", 10).second;
    Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Private notification:", "Enter notification");
    TextArea alertMessageTextArea = labelTextAreaTuple2.second;
    Label first = labelTextAreaTuple2.first;
    first.setMinWidth(200);
    sendButton = new Button("Send private notification");
    sendButton.setOnAction(e -> {
        if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
            if (!sendPrivateNotificationHandler.handle(new PrivateNotification(alertMessageTextArea.getText()), pubKeyRing, nodeAddress, keyInputTextField.getText(), new SendMailboxMessageListener() {

                @Override
                public void onArrived() {
                    log.trace("PrivateNotificationMessage arrived at peer.");
                    new Popup<>().feedback("Message arrived.").onClose(SendPrivateNotificationWindow.this::hide).show();
                }

                @Override
                public void onStoredInMailbox() {
                    log.trace("PrivateNotificationMessage was stored in mailbox.");
                    new Popup<>().feedback("Message stored in mailbox.").onClose(SendPrivateNotificationWindow.this::hide).show();
                }

                @Override
                public void onFault(String errorMessage) {
                    new Popup<>().feedback("Message sending failed. error=" + errorMessage).onClose(SendPrivateNotificationWindow.this::hide).show();
                }
            }))
                new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
        }
    });
    closeButton = new Button("Close");
    closeButton.setOnAction(e -> {
        hide();
        closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
    });
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.getChildren().addAll(sendButton, closeButton);
    gridPane.getChildren().add(hBox);
    GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) TextArea(javafx.scene.control.TextArea) FormBuilder.addLabelTextArea(io.bitsquare.gui.util.FormBuilder.addLabelTextArea) Button(javafx.scene.control.Button) FormBuilder.addLabelInputTextField(io.bitsquare.gui.util.FormBuilder.addLabelInputTextField) InputTextField(io.bitsquare.gui.components.InputTextField) Popup(io.bitsquare.gui.main.overlays.popups.Popup) Label(javafx.scene.control.Label) PrivateNotification(io.bitsquare.alert.PrivateNotification) SendMailboxMessageListener(io.bitsquare.p2p.messaging.SendMailboxMessageListener)

Example 9 with HBox

use of javafx.scene.layout.HBox in project bitsquare by bitsquare.

the class DisputeSummaryWindow method addFeeControls.

private void addFeeControls() {
    Label splitFeeLabel = addLabel(gridPane, ++rowIndex, "Arbitration fee:", 10);
    GridPane.setValignment(splitFeeLabel, VPos.TOP);
    loserPaysFeeRadioButton = new RadioButton("Loser pays arbitration fee");
    splitFeeRadioButton = new RadioButton("Split arbitration fee");
    waiveFeeRadioButton = new RadioButton("Waive arbitration fee");
    HBox feeRadioButtonPane = new HBox();
    feeRadioButtonPane.setSpacing(20);
    feeRadioButtonPane.getChildren().addAll(loserPaysFeeRadioButton, splitFeeRadioButton, waiveFeeRadioButton);
    GridPane.setRowIndex(feeRadioButtonPane, rowIndex);
    GridPane.setColumnIndex(feeRadioButtonPane, 1);
    GridPane.setMargin(feeRadioButtonPane, new Insets(10, 0, 10, 0));
    gridPane.getChildren().add(feeRadioButtonPane);
    feeToggleGroup = new ToggleGroup();
    loserPaysFeeRadioButton.setToggleGroup(feeToggleGroup);
    splitFeeRadioButton.setToggleGroup(feeToggleGroup);
    waiveFeeRadioButton.setToggleGroup(feeToggleGroup);
    feeToggleSelectionListener = (observable, oldValue, newValue) -> {
        if (newValue == loserPaysFeeRadioButton)
            disputeResult.setDisputeFeePolicy(DisputeResult.DisputeFeePolicy.LOSER);
        else if (newValue == splitFeeRadioButton)
            disputeResult.setDisputeFeePolicy(DisputeResult.DisputeFeePolicy.SPLIT);
        else if (newValue == waiveFeeRadioButton)
            disputeResult.setDisputeFeePolicy(DisputeResult.DisputeFeePolicy.WAIVE);
    };
    feeToggleGroup.selectedToggleProperty().addListener(feeToggleSelectionListener);
    if (dispute.isSupportTicket())
        feeToggleGroup.selectToggle(waiveFeeRadioButton);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets)

Example 10 with HBox

use of javafx.scene.layout.HBox in project bitsquare by bitsquare.

the class DisputeSummaryWindow method addReasonControls.

private void addReasonControls() {
    Label label = addLabel(gridPane, ++rowIndex, "Reason of dispute:", 10);
    GridPane.setValignment(label, VPos.TOP);
    reasonWasBugRadioButton = new RadioButton("Bug");
    reasonWasUsabilityIssueRadioButton = new RadioButton("Usability");
    reasonProtocolViolationRadioButton = new RadioButton("Protocol violation");
    reasonNoReplyRadioButton = new RadioButton("No reply");
    reasonWasScamRadioButton = new RadioButton("Scam");
    reasonWasOtherRadioButton = new RadioButton("Other");
    HBox feeRadioButtonPane = new HBox();
    feeRadioButtonPane.setSpacing(20);
    feeRadioButtonPane.getChildren().addAll(reasonWasBugRadioButton, reasonWasUsabilityIssueRadioButton, reasonProtocolViolationRadioButton, reasonNoReplyRadioButton, 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);
    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 == reasonWasOtherRadioButton)
            disputeResult.setReason(DisputeResult.Reason.OTHER);
    };
    reasonToggleGroup.selectedToggleProperty().addListener(reasonToggleSelectionListener);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets)

Aggregations

HBox (javafx.scene.layout.HBox)54 Button (javafx.scene.control.Button)25 Insets (javafx.geometry.Insets)22 Label (javafx.scene.control.Label)22 Scene (javafx.scene.Scene)12 VBox (javafx.scene.layout.VBox)11 BorderPane (javafx.scene.layout.BorderPane)8 Node (javafx.scene.Node)7 InputTextField (io.bitsquare.gui.components.InputTextField)6 TextArea (javafx.scene.control.TextArea)6 Stage (javafx.stage.Stage)6 Popup (io.bitsquare.gui.main.overlays.popups.Popup)5 IOException (java.io.IOException)5 ObservableList (javafx.collections.ObservableList)5 FXML (javafx.fxml.FXML)5 ImageView (javafx.scene.image.ImageView)5 KeyFrame (javafx.animation.KeyFrame)4 Timeline (javafx.animation.Timeline)4 File (java.io.File)3 Group (javafx.scene.Group)3