Search in sources :

Example 6 with RowConstraints

use of javafx.scene.layout.RowConstraints in project jOOQ by jOOQ.

the class BarChartSample method grow.

private void grow(GridPane pane) {
    ColumnConstraints col = new ColumnConstraints();
    col.setFillWidth(true);
    col.setHgrow(Priority.ALWAYS);
    pane.getColumnConstraints().add(col);
    RowConstraints row = new RowConstraints();
    row.setFillHeight(true);
    row.setVgrow(Priority.ALWAYS);
    pane.getRowConstraints().add(row);
}
Also used : ColumnConstraints(javafx.scene.layout.ColumnConstraints) RowConstraints(javafx.scene.layout.RowConstraints)

Example 7 with RowConstraints

use of javafx.scene.layout.RowConstraints in project jgnash by ccavanaugh.

the class SelectAccountSecuritiesDialog method createGridPane.

private GridPane createGridPane() {
    final GridPane gridPane = new GridPane();
    gridPane.getStyleClass().add("form");
    final ColumnConstraints col0 = new ColumnConstraints();
    col0.setFillWidth(true);
    col0.setHgrow(Priority.ALWAYS);
    col0.setMaxWidth(Double.MAX_VALUE);
    col0.setPrefWidth(220);
    final ColumnConstraints col1 = new ColumnConstraints();
    col1.setFillWidth(true);
    col1.setHgrow(Priority.NEVER);
    final ColumnConstraints col2 = new ColumnConstraints();
    col2.setFillWidth(true);
    col2.setHgrow(Priority.ALWAYS);
    col2.setMaxWidth(Double.MAX_VALUE);
    col2.setPrefWidth(220);
    gridPane.getColumnConstraints().addAll(col0, col1, col2);
    final RowConstraints row0 = new RowConstraints();
    row0.setFillHeight(true);
    row0.setVgrow(Priority.NEVER);
    final RowConstraints row1 = new RowConstraints();
    row1.setMaxHeight(Double.MAX_VALUE);
    row1.setPrefHeight(220);
    row1.setVgrow(Priority.ALWAYS);
    final RowConstraints row2 = new RowConstraints();
    row0.setFillHeight(true);
    row0.setVgrow(Priority.NEVER);
    gridPane.getRowConstraints().addAll(row0, row1, row2);
    return gridPane;
}
Also used : GridPane(javafx.scene.layout.GridPane) ColumnConstraints(javafx.scene.layout.ColumnConstraints) RowConstraints(javafx.scene.layout.RowConstraints)

Example 8 with RowConstraints

use of javafx.scene.layout.RowConstraints in project selenium_java by sergueik.

the class ComplexFormEx method start.

@SuppressWarnings("restriction")
@Override
public void start(Stage stage) {
    BorderPane root = new BorderPane();
    stage.setTitle(inputData.containsKey("title") ? inputData.get("title") : "Element Locators");
    Scene scene = new Scene(root, 480, 250, Color.WHITE);
    // stage.setScene(new Scene(root, 480, 250, Color.WHITE));
    stage.setScene(scene);
    GridPane gridPane1 = new GridPane();
    GridPane gridPane = new GridPane();
    gridPane.setRowIndex(gridPane, 0);
    gridPane.setColumnIndex(gridPane, 0);
    HBox buttonbarHbox = new HBox(10);
    buttonbarHbox.setPadding(new Insets(10));
    // buttonbarHbox.setSpacing(50);
    // buttonbarHbox.setPadding(new Insets(10, 10, 10, 10));
    // gridPane.setVgap(5);
    gridPane.setRowIndex(buttonbarHbox, 1);
    gridPane.setColumnIndex(buttonbarHbox, 0);
    // Save button
    Button saveButton = new Button("Save");
    saveButton.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Saved");
            Stage stage = (Stage) ((Button) (event.getSource())).getScene().getWindow();
            stage.close();
        }
    });
    saveButton.setDefaultButton(true);
    // Delete button
    Button deleteButton = new Button("Delete");
    deleteButton.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Deleted");
            Stage stage = (Stage) ((Button) (event.getSource())).getScene().getWindow();
            stage.close();
        }
    });
    // Cancel button
    Button cancelButton = new Button("Cancel");
    cancelButton.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Cancel");
            Stage stage = (Stage) ((Button) (event.getSource())).getScene().getWindow();
            stage.close();
        }
    });
    buttonbarHbox.getChildren().addAll(saveButton, deleteButton, cancelButton);
    gridPane.setPadding(new Insets(20, 10, 10, 20));
    gridPane.setHgap(5);
    gridPane.setVgap(5);
    gridPane.setStyle("-fx-padding: 10; -fx-border-style: solid inside; -fx-border-width: 2; -fx-border-insets: 5; -fx-border-radius: 0; -fx-border-color: darkgray;");
    ToggleGroup group = new ToggleGroup();
    // CSS
    RadioButton cssButton = new RadioButton("css");
    cssButton.setToggleGroup(group);
    cssButton.setSelected(true);
    gridPane.setHalignment(cssButton, HPos.LEFT);
    gridPane.add(cssButton, 0, 0);
    TextField cssFld = new TextField();
    gridPane.setHalignment(cssFld, HPos.LEFT);
    cssFld.setMaxWidth(Double.MAX_VALUE);
    gridPane.add(cssFld, 1, 0);
    // XPath
    RadioButton xpathButton = new RadioButton("xpath");
    xpathButton.setToggleGroup(group);
    gridPane.setHalignment(xpathButton, HPos.LEFT);
    gridPane.add(xpathButton, 0, 1);
    TextField xpathFld = new TextField();
    gridPane.setHalignment(xpathFld, HPos.LEFT);
    xpathFld.setMaxWidth(Double.MAX_VALUE);
    gridPane.add(xpathFld, 1, 1);
    // ID
    RadioButton idButton = new RadioButton("id");
    idButton.setToggleGroup(group);
    gridPane.setHalignment(idButton, HPos.LEFT);
    gridPane.add(idButton, 0, 2);
    idButton.setDisable(true);
    TextField idFld = new TextField();
    gridPane.setHalignment(idFld, HPos.LEFT);
    idFld.setMaxWidth(Double.MAX_VALUE);
    gridPane.add(idFld, 1, 2);
    idFld.setDisable(true);
    RadioButton textButton = new RadioButton("text");
    textButton.setToggleGroup(group);
    gridPane.setHalignment(textButton, HPos.LEFT);
    gridPane.add(textButton, 0, 3);
    TextField textFld = new TextField();
    gridPane.setHalignment(textFld, HPos.LEFT);
    textFld.setMaxWidth(Double.MAX_VALUE);
    gridPane.add(textFld, 1, 3);
    // constant
    final RowConstraints rowConstraints = new RowConstraints(64);
    // height
    final ColumnConstraints column1Constraints = new ColumnConstraints(100, Control.USE_COMPUTED_SIZE, Control.USE_COMPUTED_SIZE);
    final ColumnConstraints column2Constraints = new ColumnConstraints(250, Control.USE_COMPUTED_SIZE, Double.MAX_VALUE);
    gridPane.getRowConstraints().add(rowConstraints);
    column2Constraints.setHgrow(Priority.ALWAYS);
    gridPane.getColumnConstraints().addAll(column1Constraints, column2Constraints);
    gridPane.prefWidthProperty().bind(root.widthProperty());
    gridPane1.getChildren().addAll(gridPane, buttonbarHbox);
    gridPane1.prefWidthProperty().bind(root.widthProperty());
    root.getChildren().add(gridPane1);
    scene.setRoot(root);
    stage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) ActionEvent(javafx.event.ActionEvent) ColumnConstraints(javafx.scene.layout.ColumnConstraints) RadioButton(javafx.scene.control.RadioButton) Scene(javafx.scene.Scene) RowConstraints(javafx.scene.layout.RowConstraints) Button(javafx.scene.control.Button) RadioButton(javafx.scene.control.RadioButton) ToggleGroup(javafx.scene.control.ToggleGroup) Stage(javafx.stage.Stage) TextField(javafx.scene.control.TextField)

Aggregations

ColumnConstraints (javafx.scene.layout.ColumnConstraints)8 RowConstraints (javafx.scene.layout.RowConstraints)8 GridPane (javafx.scene.layout.GridPane)6 Button (javafx.scene.control.Button)4 Insets (javafx.geometry.Insets)3 Scene (javafx.scene.Scene)3 Label (javafx.scene.control.Label)3 HBox (javafx.scene.layout.HBox)3 ActionEvent (javafx.event.ActionEvent)2 BorderPane (javafx.scene.layout.BorderPane)2 Stage (javafx.stage.Stage)2 XYLocation (aima.core.util.datastructure.XYLocation)1 Machine (increment.simulator.Machine)1 MachineWrapper (increment.simulator.userInterface.MachineWrapper)1 ArrayList (java.util.ArrayList)1 KeyFrame (javafx.animation.KeyFrame)1 Timeline (javafx.animation.Timeline)1 RadioButton (javafx.scene.control.RadioButton)1 Separator (javafx.scene.control.Separator)1 TextArea (javafx.scene.control.TextArea)1