Java Code Examples for javafx.scene.control.RadioButton#setPadding()

The following examples show how to use javafx.scene.control.RadioButton#setPadding() . 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: VertexTypeNodeProvider.java    From constellation with Apache License 2.0 6 votes vote down vote up
private VBox addFilter() {
    filterText.setPromptText("Filter Node types");
    final ToggleGroup toggleGroup = new ToggleGroup();
    startsWithRb.setToggleGroup(toggleGroup);
    startsWithRb.setPadding(new Insets(0, 0, 0, 5));
    startsWithRb.setSelected(true);
    final RadioButton containsRadioButton = new RadioButton("Contains");
    containsRadioButton.setToggleGroup(toggleGroup);
    containsRadioButton.setPadding(new Insets(0, 0, 0, 5));

    toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
        populateTree();
    });

    filterText.textProperty().addListener((observable, oldValue, newValue) -> {
        populateTree();
    });

    final HBox headerBox = new HBox(new Label("Filter: "), filterText, startsWithRb, containsRadioButton);
    headerBox.setAlignment(Pos.CENTER_LEFT);
    headerBox.setPadding(new Insets(5));

    final VBox box = new VBox(schemaLabel, headerBox, treeView);
    VBox.setVgrow(treeView, Priority.ALWAYS);
    return box;
}
 
Example 2
Source File: TransactionTypeNodeProvider.java    From constellation with Apache License 2.0 6 votes vote down vote up
private VBox addFilter() {
    filterText.setPromptText("Filter transaction types");
    final ToggleGroup toggleGroup = new ToggleGroup();
    startsWithRb.setToggleGroup(toggleGroup);
    startsWithRb.setPadding(new Insets(0, 0, 0, 5));
    startsWithRb.setSelected(true);
    final RadioButton containsRadioButton = new RadioButton("Contains");
    containsRadioButton.setToggleGroup(toggleGroup);
    containsRadioButton.setPadding(new Insets(0, 0, 0, 5));

    toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
        populateTree();
    });

    filterText.textProperty().addListener((observable, oldValue, newValue) -> {
        populateTree();
    });

    final HBox headerBox = new HBox(new Label("Filter: "), filterText, startsWithRb, containsRadioButton);
    headerBox.setAlignment(Pos.CENTER_LEFT);
    headerBox.setPadding(new Insets(5));

    final VBox box = new VBox(schemaLabel, headerBox, treeView);
    VBox.setVgrow(treeView, Priority.ALWAYS);
    return box;
}
 
Example 3
Source File: FormBuilder.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
public static Tuple3<Label, RadioButton, RadioButton> addTopLabelRadioButtonRadioButton(GridPane gridPane,
                                                                                        int rowIndex,
                                                                                        ToggleGroup toggleGroup,
                                                                                        String title,
                                                                                        String radioButtonTitle1,
                                                                                        String radioButtonTitle2,
                                                                                        double top) {
    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);

    final Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, hBox, top);

    return new Tuple3<>(topLabelWithVBox.first, radioButton1, radioButton2);
}
 
Example 4
Source File: AttributeNodeProvider.java    From constellation with Apache License 2.0 5 votes vote down vote up
@Override
public void setContent(final Tab tab) {
    GraphManager.getDefault().addGraphManagerListener(this);
    newActiveGraph(GraphManager.getDefault().getActiveGraph());

    final TextField filterText = new TextField();
    filterText.setPromptText("Filter attribute names");

    final ToggleGroup tg = new ToggleGroup();
    final RadioButton startsWithRb = new RadioButton("Starts with");
    startsWithRb.setToggleGroup(tg);
    startsWithRb.setPadding(new Insets(0, 0, 0, 5));
    startsWithRb.setSelected(true);
    final RadioButton containsRb = new RadioButton("Contains");
    containsRb.setToggleGroup(tg);
    containsRb.setPadding(new Insets(0, 0, 0, 5));

    tg.selectedToggleProperty().addListener((ov, oldValue, newValue) -> {
        filter(table, filterText.getText(), startsWithRb.isSelected());
    });

    filterText.textProperty().addListener((ov, oldValue, newValue) -> {
        filter(table, newValue, startsWithRb.isSelected());
    });

    final HBox headerBox = new HBox(new Label("Filter: "), filterText, startsWithRb, containsRb);
    headerBox.setAlignment(Pos.CENTER_LEFT);
    headerBox.setPadding(new Insets(5));

    final VBox box = new VBox(schemaLabel, headerBox, table);
    VBox.setVgrow(table, Priority.ALWAYS);

    Platform.runLater(() -> {
        tab.setContent(box);
    });
}
 
Example 5
Source File: FormBuilder.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public static Tuple4<Label, TextField, RadioButton, RadioButton> addTopLabelTextFieldRadioButtonRadioButton(GridPane gridPane,
                                                                                                            int rowIndex,
                                                                                                            ToggleGroup toggleGroup,
                                                                                                            String title,
                                                                                                            String textFieldTitle,
                                                                                                            String radioButtonTitle1,
                                                                                                            String radioButtonTitle2,
                                                                                                            double top) {
    TextField textField = new BisqTextField();
    textField.setPromptText(textFieldTitle);

    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(textField, radioButton1, radioButton2);

    final Tuple2<Label, VBox> labelVBoxTuple2 = addTopLabelWithVBox(gridPane, rowIndex, title, hBox, top);

    return new Tuple4<>(labelVBoxTuple2.first, textField, radioButton1, radioButton2);
}