예제 #1
0
  public static Tuple2<Label, CheckBox> addLabelCheckBox(
      GridPane gridPane, int rowIndex, String title, String checkBoxTitle, double top) {
    Label label = addLabel(gridPane, rowIndex, title, -3);
    GridPane.setMargin(label, new Insets(top, 0, 0, 0));

    CheckBox checkBox = new CheckBox(checkBoxTitle);
    GridPane.setRowIndex(checkBox, rowIndex);
    GridPane.setColumnIndex(checkBox, 1);
    GridPane.setMargin(checkBox, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(checkBox);

    return new Tuple2<>(label, checkBox);
  }
예제 #2
0
 public static Label addLabel(GridPane gridPane, int rowIndex, String title, double top) {
   Label label = new Label(title);
   GridPane.setRowIndex(label, rowIndex);
   GridPane.setMargin(label, new Insets(top, 0, 0, 0));
   gridPane.getChildren().add(label);
   return label;
 }
예제 #3
0
  public static Tuple2<Label, TextArea> addLabelTextArea(
      GridPane gridPane, int rowIndex, String title, String prompt, double top) {
    Label label = addLabel(gridPane, rowIndex, title, 0);
    GridPane.setMargin(label, new Insets(top + 4, 0, 0, 0));
    GridPane.setValignment(label, VPos.TOP);

    TextArea textArea = new TextArea();
    textArea.setPromptText(prompt);
    textArea.setWrapText(true);
    GridPane.setRowIndex(textArea, rowIndex);
    GridPane.setColumnIndex(textArea, 1);
    GridPane.setMargin(textArea, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(textArea);

    return new Tuple2<>(label, textArea);
  }
예제 #4
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;
 }
예제 #5
0
 public static CheckBox addCheckBox(
     GridPane gridPane, int rowIndex, String checkBoxTitle, double top) {
   CheckBox checkBox = new CheckBox(checkBoxTitle);
   GridPane.setMargin(checkBox, new Insets(top, 0, 0, 0));
   GridPane.setRowIndex(checkBox, rowIndex);
   GridPane.setColumnIndex(checkBox, 1);
   gridPane.getChildren().add(checkBox);
   return checkBox;
 }
예제 #6
0
 public static Label addMultilineLabel(GridPane gridPane, int rowIndex, String text, double top) {
   Label label = new Label(text);
   label.setWrapText(true);
   GridPane.setHalignment(label, HPos.LEFT);
   GridPane.setRowIndex(label, rowIndex);
   GridPane.setColumnSpan(label, 2);
   GridPane.setMargin(label, new Insets(top, 0, 0, 0));
   gridPane.getChildren().add(label);
   return label;
 }
예제 #7
0
 public static TitledGroupBg addTitledGroupBg(
     GridPane gridPane, int rowIndex, int rowSpan, String title, double top) {
   TitledGroupBg titledGroupBg = new TitledGroupBg();
   titledGroupBg.setText(title);
   titledGroupBg.prefWidthProperty().bind(gridPane.widthProperty());
   GridPane.setRowIndex(titledGroupBg, rowIndex);
   GridPane.setRowSpan(titledGroupBg, rowSpan);
   GridPane.setColumnSpan(titledGroupBg, 2);
   GridPane.setMargin(titledGroupBg, new Insets(top, -10, -10, -10));
   gridPane.getChildren().add(titledGroupBg);
   return titledGroupBg;
 }
예제 #8
0
  public static Tuple2<Label, ListView> addLabelListView(
      GridPane gridPane, int rowIndex, String title, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

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

    return new Tuple2<>(label, listView);
  }
예제 #9
0
  public static Tuple2<Label, TxIdTextField> addLabelTxIdTextField(
      GridPane gridPane, int rowIndex, String title, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

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

    return new Tuple2<>(label, txIdTextField);
  }
예제 #10
0
  public static Tuple2<Label, TextFieldWithCopyIcon> addLabelTextFieldWithCopyIcon(
      GridPane gridPane, int rowIndex, String title, String value, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

    TextFieldWithCopyIcon textFieldWithCopyIcon = new TextFieldWithCopyIcon();
    textFieldWithCopyIcon.setText(value);
    GridPane.setRowIndex(textFieldWithCopyIcon, rowIndex);
    GridPane.setColumnIndex(textFieldWithCopyIcon, 1);
    GridPane.setMargin(textFieldWithCopyIcon, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(textFieldWithCopyIcon);

    return new Tuple2<>(label, textFieldWithCopyIcon);
  }
예제 #11
0
  public static Tuple2<Label, ComboBox> addLabelComboBox(
      GridPane gridPane, int rowIndex, String title, double top) {
    Label label = null;
    if (title != null) label = addLabel(gridPane, rowIndex, title, top);

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

    return new Tuple2<>(label, comboBox);
  }
예제 #12
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);
 }
예제 #13
0
  public static Tuple2<Label, TextField> addLabelTextField(
      GridPane gridPane, int rowIndex, String title, String value, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

    TextField textField = new TextField(value);
    textField.setEditable(false);
    textField.setMouseTransparent(true);
    textField.setFocusTraversable(false);
    GridPane.setRowIndex(textField, rowIndex);
    GridPane.setColumnIndex(textField, 1);
    GridPane.setMargin(textField, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(textField);

    return new Tuple2<>(label, textField);
  }
예제 #14
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);
  }
예제 #15
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);
  }