Ejemplo n.º 1
0
 public static Button addButton(GridPane gridPane, int rowIndex, String title) {
   Button button = new Button(title);
   button.setDefaultButton(true);
   GridPane.setRowIndex(button, rowIndex);
   GridPane.setColumnIndex(button, 1);
   gridPane.getChildren().add(button);
   return button;
 }
Ejemplo n.º 2
0
 public static Button addButtonAfterGroup(GridPane gridPane, int rowIndex, String title) {
   Button button = new Button(title);
   button.setDefaultButton(true);
   GridPane.setRowIndex(button, rowIndex);
   GridPane.setColumnIndex(button, 1);
   GridPane.setMargin(button, new Insets(15, 0, 0, 0));
   gridPane.getChildren().add(button);
   return button;
 }
Ejemplo n.º 3
0
 public static Tuple2<Button, Button> add2ButtonsAfterGroup(
     GridPane gridPane, int rowIndex, String title1, String title2, double top) {
   HBox hBox = new HBox();
   hBox.setSpacing(10);
   Button button1 = new Button(title1);
   button1.setDefaultButton(true);
   Button button2 = new Button(title2);
   hBox.getChildren().addAll(button1, button2);
   GridPane.setRowIndex(hBox, rowIndex);
   GridPane.setColumnIndex(hBox, 1);
   GridPane.setMargin(hBox, new Insets(top, 10, 0, 0));
   gridPane.getChildren().add(hBox);
   return new Tuple2<>(button1, button2);
 }
Ejemplo n.º 4
0
  public static Tuple2<Button, CheckBox> addButtonCheckBox(
      GridPane gridPane, int rowIndex, String buttonTitle, String checkBoxTitle, double top) {
    Button button = new Button(buttonTitle);
    button.setDefaultButton(true);
    CheckBox checkBox = new CheckBox(checkBoxTitle);
    HBox.setMargin(checkBox, new Insets(6, 0, 0, 0));

    HBox hBox = new HBox();
    hBox.setSpacing(20);
    hBox.getChildren().addAll(button, checkBox);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.setPadding(new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(hBox);

    return new Tuple2<>(button, checkBox);
  }
Ejemplo n.º 5
0
  public static Tuple3<Label, ComboBox, Button> addLabelComboBoxButton(
      GridPane gridPane, int rowIndex, String title, String buttonTitle, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

    HBox hBox = new HBox();
    hBox.setSpacing(10);

    Button button = new Button(buttonTitle);
    button.setDefaultButton(true);

    ComboBox comboBox = new ComboBox();

    hBox.getChildren().addAll(comboBox, button);

    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(15, 0, 0, 0));
    gridPane.getChildren().add(hBox);

    return new Tuple3<>(label, comboBox, button);
  }
Ejemplo n.º 6
0
  public static Tuple3<Button, ProgressIndicator, Label> addButtonWithStatus(
      GridPane gridPane, int rowIndex, String buttonTitle, double top) {
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    Button button = new Button(buttonTitle);
    button.setDefaultButton(true);

    ProgressIndicator progressIndicator = new ProgressIndicator(0);
    progressIndicator.setPrefHeight(24);
    progressIndicator.setPrefWidth(24);
    progressIndicator.setVisible(false);

    Label label = new Label();
    label.setPadding(new Insets(5, 0, 0, 0));

    hBox.getChildren().addAll(button, progressIndicator, label);

    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(hBox);

    return new Tuple3<>(button, progressIndicator, label);
  }