Package javafx.scene.layout

Examples of javafx.scene.layout.GridPane


    container.getChildren().clear();
    container.getChildren().add(samples.get(num));
  }

  private GridPane configurePropertyPane() {
    GridPane gp = new GridPane();
    gp.setVgap(18);
    gp.setHgap(10);
    gp.setPadding(new Insets(0, 15, 0, 15));
    final CheckBox activateCB = new CheckBox();
    activateCB.setSelected(true);
    active.bind(activateCB.selectedProperty());

    final Slider rSlider = new Slider(50, 150, 86);
    rSlider.disableProperty().bind(activateCB.selectedProperty().not());
    radius.bind(rSlider.valueProperty());
    Label rL = new Label();
    rL.textProperty().bind(new StringBinding() {
      {
        bind(rSlider.valueProperty());
      }

      @Override
      protected String computeValue() {
        return df.format(rSlider.getValue()) + "px";
      }
    });

    final Slider fmSlider = new Slider(3, 10, 5.5);
    fmSlider.disableProperty().bind(activateCB.selectedProperty().not());
    frameWidth.bind(fmSlider.valueProperty());
    Label fmL = new Label();
    fmL.textProperty().bind(new StringBinding() {
      {
        bind(fmSlider.valueProperty());
      }

      @Override
      protected String computeValue() {
        return df.format(fmSlider.getValue()) + "px";
      }
    });

    final Slider sfSlider = new Slider(1, 8, 3);
    sfSlider.disableProperty().bind(activateCB.selectedProperty().not());
    scaleFactor.bind(sfSlider.valueProperty());
    Label sfL = new Label();
    sfL.textProperty().bind(new StringBinding() {
      {
        bind(sfSlider.valueProperty());
      }

      @Override
      protected String computeValue() {
        return df.format(sfSlider.getValue()) + "";
      }
    });

    final CheckBox slVisibleCB = new CheckBox();
    slVisibleCB.disableProperty().bind(activateCB.selectedProperty().not());
    scopeLinesVisible.bind(slVisibleCB.selectedProperty());

    final Slider sllider = new Slider(1, 4, 1.5);
    sllider.disableProperty().bind(new BooleanBinding() {
      {
        bind(activateCB.selectedProperty(), slVisibleCB.selectedProperty());
      }

      @Override
      protected boolean computeValue() {
        if (!activateCB.isSelected() || !slVisibleCB.isSelected()) {
          return true;
        }
        return false;
      }
    });
    scopeLineWidth.bind(sllider.valueProperty());
    Label slL = new Label();
    slL.textProperty().bind(new StringBinding() {
      {
        bind(sllider.valueProperty());
      }

      @Override
      protected String computeValue() {
        return df.format(sllider.getValue()) + "px";
      }
    });

    CheckBox scaleOnScrollCB = new CheckBox();
    scaleOnScrollCB.disableProperty().bind(activateCB.selectedProperty().not());
    scalableOnScroll.bind(scaleOnScrollCB.selectedProperty());

    CheckBox resizeOnScrollCB = new CheckBox();
    resizeOnScrollCB.disableProperty().bind(activateCB.selectedProperty().not());
    resizableOnScroll.bind(resizeOnScrollCB.selectedProperty());

    final Label secHeading = new Label("Configurable Properties :");
    secHeading.getStyleClass().add("sectionHeading");
    secHeading.setPrefHeight(40);
    secHeading.setAlignment(Pos.TOP_CENTER);

    gp.add(secHeading, 0, 0, 4, 1);
    gp.addRow(1, getSep("Active", MagnifierDoc.active), new Label(":"), activateCB, getSpacer());
    gp.addRow(2, getSep("Radius", MagnifierDoc.radius), new Label(":"), rSlider, rL);
    gp.addRow(3, getSep("Frame Width", MagnifierDoc.frameWidth), new Label(":"), fmSlider, fmL);
    gp.addRow(4, getSep("Scale Factor", MagnifierDoc.scaleFactor), new Label(":"), sfSlider, sfL);
    gp.addRow(5, getSep("Scope Lines Visible", MagnifierDoc.scopeLinesVisible), new Label(":"), slVisibleCB, getSpacer());
    gp.addRow(6, getSep("Scope Line Width", MagnifierDoc.scopeLineWidth), new Label(":"), sllider, slL);
    gp.addRow(7, getSep("Scalable On Scroll", MagnifierDoc.scalableOnScroll), new Label(":"), scaleOnScrollCB, getSpacer());
    gp.addRow(8, getSep("Resizable On Scroll", MagnifierDoc.resizableOnScroll), new Label(":"), resizeOnScrollCB, getSpacer());
    return gp;
  }
View Full Code Here


        tabClock.setText("Uhr");

        /*
         * The ClockSettings-Content
         */
        GridPane grid = new GridPane();
        grid.setHgap(5);
        grid.setVgap(5);
        grid.setPadding(new Insets(25, 30, 0, 60));

        CheckBox box1 = new CheckBox("Datum und Uhrzeit in der Men\u00FCleiste anzeigen");
        box1.setSelected(true);
        grid.add(box1, 0, 0, 3, 1);

        Label labelTime = new Label("Zeitoptionen:");
        ToggleGroup group = new ToggleGroup();
        RadioButton radioButtonDigital = new RadioButton("Digital");
        radioButtonDigital.setToggleGroup(group);
        radioButtonDigital.setSelected(true);
        RadioButton radioButtonAnalog = new RadioButton("Analog");
        radioButtonAnalog.setToggleGroup(group);
        grid.addRow(2, labelTime, radioButtonDigital, radioButtonAnalog);
        GridPane.setHalignment(labelTime, HPos.RIGHT);
        GridPane.setMargin(radioButtonAnalog, new Insets(0, 0, 0, 20));

        CheckBox box2 = new CheckBox("Uhrzeit mit Sekunden anzeigen");
        grid.add(box2, 1, 3, 2, 1);
        CheckBox box3 = new CheckBox("Blinkende Trennzeichen");
        grid.add(box3, 1, 4, 2, 1);
        CheckBox box4 = new CheckBox("24 Stunden verwenden");
        box4.setSelected(true);
        grid.add(box4, 1, 5, 2, 1);
        CheckBox box5 = new CheckBox("Uhrzeit mit Suffix anzeigen");
        box5.setDisable(true);
        grid.add(box5, 1, 6, 2, 1);

        Label labelDate = new Label("Datumsoptionen:");
        grid.add(labelDate, 0, 8);
        GridPane.setHalignment(labelDate, HPos.RIGHT);
        GridPane.setMargin(labelDate, new Insets(0, 0, 0, 40));
        CheckBox box6 = new CheckBox("Wochentag anzeigen");
        box6.setSelected(true);
        grid.add(box6, 1, 8, 2, 1);
        CheckBox box7 = new CheckBox("Datum anzeigen");
        grid.add(box7, 1, 9, 2, 1);

        HBox hbox = new HBox();
        hbox.setSpacing(5);
        hbox.setAlignment(Pos.CENTER_LEFT);
        CheckBox box8 = new CheckBox("Zeit vorlesen:");
        ChoiceBox<String> choices = new ChoiceBox<String>(FXCollections.observableArrayList("Zur vollen Stunde",
                "Zur halben Stunde", "Zur Viertelstunde"));
        choices.setDisable(true);
        choices.getSelectionModel().selectFirst();
        Button abjustVoice = new Button();
        abjustVoice.setText("Stimme anpassen ...");
        abjustVoice.setDisable(true);
        hbox.getChildren().addAll(box8, choices, abjustVoice);
        grid.add(hbox, 0, 14, 4, 1);

        tabClock.setContent(grid);
        /*
         * Content finished.. add it to Tab
         */
 
View Full Code Here

        stage.setScene(scene);
        stage.setTitle("AquaFX Controls");
        BorderPane pane = new BorderPane();
//        pane.setStyle("-fx-background-color: white;");

        GridPane grid = new GridPane();
        grid.setPadding(new Insets(20));
        grid.setVgap(10);
        grid.setHgap(10);
        ColumnConstraints column1 = new ColumnConstraints();
        column1.setHalignment(HPos.RIGHT);
        grid.getColumnConstraints().add(column1);

        ColumnConstraints column2 = new ColumnConstraints();
        column2.setHalignment(HPos.LEFT);
        grid.getColumnConstraints().add(column2);

        /*
         * Toolbar section
         */
        ToolBar toolBar = new ToolBar();
        Button tbBack = new Button();
        AquaFx.createButtonStyler().setIcon(MacOSDefaultIcons.LEFT).setType(ButtonType.LEFT_PILL).style(tbBack);
        Button tbForward = new Button();
        tbForward.setDisable(true);
        AquaFx.createButtonStyler().setIcon(MacOSDefaultIcons.RIGHT).setType(ButtonType.RIGHT_PILL).style(tbForward);
       
        HBox separator = new HBox();
        separator.setPrefSize(15, 1);
        Button btnAll = new Button("Alle einblenden");
        HBox separator2 = new HBox();
        separator2.setPrefSize(15, 1);
        Button share = new Button();
        share.setDisable(true);
        AquaFx.createButtonStyler().setIcon(MacOSDefaultIcons.SHARE).style(share);
       
       
        toolBar.getItems().addAll(tbBack, tbForward, separator, btnAll, separator2, share);
        pane.setTop(toolBar);

        Label info = new Label("Those Controls are styled by AquaFX:");
        grid.add(info, 0, 0, 5, 1);
        GridPane.setHalignment(info, HPos.LEFT);

        /*
         * Different Control-sizes
         */
        Label labelb5 = new Label("regular:");
        grid.add(labelb5, 0, 2);
        Button b5 = new Button("Button");
        AquaFx.createButtonStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(b5);
        grid.add(b5, 1, 2);
        ToggleButton tb5 = new ToggleButton("ToggleButton");
        AquaFx.createToggleButtonStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(tb5);
        grid.add(tb5, 2, 2);
        CheckBox cb5 = new CheckBox("CheckBox");
        cb5.setIndeterminate(true);
        AquaFx.createCheckBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(cb5);
        grid.add(cb5, 3, 2);
        RadioButton rb5 = new RadioButton("RadioButton");
        AquaFx.createRadioButtonStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(rb5);
        grid.add(rb5, 4, 2);
        TextField tf5 = new TextField("TextField");
        AquaFx.createTextFieldStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(tf5);
        grid.add(tf5, 5, 2);
        ComboBox<String> ecombo5 = new ComboBox<String>();
        ecombo5.setItems(items);
        ecombo5.setEditable(true);
        ecombo5.setPromptText("select");
        AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(ecombo5);
        grid.add(ecombo5, 6, 2);
        ComboBox<String> combo5 = new ComboBox<String>();
        combo5.setItems(items);
        combo5.setPromptText("select");
        AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(combo5);
        grid.add(combo5, 7, 2);
        ChoiceBox<String> choice5 = new ChoiceBox<String>();
        choice5.setItems(items);
        choice5.getSelectionModel().selectFirst();
        AquaFx.createChoiceBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(choice5);
        grid.add(choice5, 8, 2);

        Label labelb6 = new Label("small:");
        AquaFx.createLabelStyler().setSizeVariant(ControlSizeVariant.SMALL).style(labelb6);
        grid.add(labelb6, 0, 3);
        Button b6 = new Button("Button");
        AquaFx.createButtonStyler().setSizeVariant(ControlSizeVariant.SMALL).style(b6);
        grid.add(b6, 1, 3);
        ToggleButton tb6 = new ToggleButton("ToggleButton");
        AquaFx.createToggleButtonStyler().setSizeVariant(ControlSizeVariant.SMALL).style(tb6);
        grid.add(tb6, 2, 3);
        CheckBox cb6 = new CheckBox("CheckBox");
        cb6.setSelected(true);
        // cb6.setDisable(true);
        AquaFx.createCheckBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(cb6);
        grid.add(cb6, 3, 3);
        RadioButton rb6 = new RadioButton("RadioButton");
        AquaFx.createRadioButtonStyler().setSizeVariant(ControlSizeVariant.SMALL).style(rb6);
        grid.add(rb6, 4, 3);
        TextField tf6 = new TextField("TextField");
        AquaFx.createTextFieldStyler().setSizeVariant(ControlSizeVariant.SMALL).style(tf6);
        grid.add(tf6, 5, 3);
        ComboBox<String> ecombo6 = new ComboBox<String>();
        ecombo6.setItems(items);
        ecombo6.setEditable(true);
        ecombo6.setPromptText("select");
        AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(ecombo6);
        grid.add(ecombo6, 6, 3);
        ComboBox<String> combo6 = new ComboBox<String>();
        combo6.setItems(items);
        combo6.setPromptText("select");
        AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(combo6);
        grid.add(combo6, 7, 3);
        ChoiceBox<String> choice6 = new ChoiceBox<String>();
        choice6.setItems(items);
        choice6.getSelectionModel().selectFirst();
        AquaFx.createChoiceBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(choice6);
        grid.add(choice6, 8, 3);

        Label labelb7 = new Label("mini:");
        AquaFx.createLabelStyler().setSizeVariant(ControlSizeVariant.MINI).style(labelb7);
        grid.add(labelb7, 0, 4);
        Button b7 = new Button("Button");
        AquaFx.createButtonStyler().setSizeVariant(ControlSizeVariant.MINI).style(b7);
        grid.add(b7, 1, 4);
        ToggleButton tb7 = new ToggleButton("ToggleButton");
        AquaFx.createToggleButtonStyler().setSizeVariant(ControlSizeVariant.MINI).style(tb7);
        grid.add(tb7, 2, 4);
        CheckBox cb7 = new CheckBox("CheckBox");
        cb7.setIndeterminate(true);
        // cb7.setDisable(true);
        AquaFx.createCheckBoxStyler().setSizeVariant(ControlSizeVariant.MINI).style(cb7);
        grid.add(cb7, 3, 4);
        RadioButton rb7 = new RadioButton("RadioButton");
        AquaFx.createRadioButtonStyler().setSizeVariant(ControlSizeVariant.MINI).style(rb7);
        grid.add(rb7, 4, 4);
        TextField tf7 = new TextField("TextField");
        AquaFx.createTextFieldStyler().setSizeVariant(ControlSizeVariant.MINI).style(tf7);
        grid.add(tf7, 5, 4);
        ComboBox<String> ecombo7 = new ComboBox<String>();
        ecombo7.setItems(items);
        ecombo7.setEditable(true);
        ecombo7.setPromptText("select");
        AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.MINI).style(ecombo7);
        grid.add(ecombo7, 6, 4);
        ComboBox<String> combo7 = new ComboBox<String>();
        combo7.setItems(items);
        combo7.setPromptText("select");
        AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.MINI).style(combo7);
        grid.add(combo7, 7, 4);
        ChoiceBox<String> choice7 = new ChoiceBox<String>();
        choice7.setItems(items);
        choice7.getSelectionModel().selectFirst();
        AquaFx.createChoiceBoxStyler().setSizeVariant(ControlSizeVariant.MINI).style(choice7);
        grid.add(choice7, 8, 4);

        Label labelb8 = new Label("regular:");
        grid.add(labelb8, 0, 6);
        Slider slider5 = new Slider(0, 50, 20);
        slider5.setShowTickLabels(true);
        slider5.setShowTickMarks(true);
        slider5.setMajorTickUnit(25);
        slider5.setMinorTickCount(4);
        grid.add(slider5, 1, 6, 2, 1);
        Slider slider11 = new Slider(0, 50, 20);
        slider11.setShowTickLabels(false);
        slider11.setShowTickMarks(false);
        grid.add(slider11, 3, 6, 2, 1);
        ProgressIndicator indicator1 = new ProgressIndicator();
        grid.add(indicator1, 5, 6);
        ProgressIndicator indicator2 = new ProgressIndicator(0.5);
        grid.add(indicator2, 6, 6);
        // TextArea area1 = new TextArea();
        // area1.setPromptText("TextArea with promptText");
        // area1.setPrefRowCount(2);
        // area1.setPrefColumnCount(15);
        // grid.add(area1, 7, 6, 2, 1);
        ProgressBar bar = new ProgressBar(0.6);
        grid.add(bar, 7, 6, 2, 1);

        Label labelb9 = new Label("small:");
        AquaFx.createLabelStyler().setSizeVariant(ControlSizeVariant.SMALL).style(labelb9);
        grid.add(labelb9, 0, 7);
        Slider slider6 = new Slider(0, 50, 20);
        slider6.setShowTickLabels(true);
        slider6.setShowTickMarks(true);
        slider6.setMajorTickUnit(25);
        slider6.setMinorTickCount(4);
        AquaFx.createSliderStyler().setSizeVariant(ControlSizeVariant.SMALL).style(slider6);
        grid.add(slider6, 1, 7, 2, 1);
        Slider slider12 = new Slider(0, 50, 20);
        slider12.setShowTickLabels(false);
        slider12.setShowTickMarks(false);
        AquaFx.createSliderStyler().setSizeVariant(ControlSizeVariant.SMALL).style(slider12);
        grid.add(slider12, 3, 7, 2, 1);
        ProgressIndicator indicator3 = new ProgressIndicator();
        AquaFx.createProgressIndicatorStyler().setSizeVariant(ControlSizeVariant.SMALL).style(indicator3);
        grid.add(indicator3, 5, 7);
        ProgressIndicator indicator4 = new ProgressIndicator(0.5);
        AquaFx.createProgressIndicatorStyler().setSizeVariant(ControlSizeVariant.SMALL).style(indicator4);
        grid.add(indicator4, 6, 7);
        // TextArea area2 = new TextArea();
        // area2.setPromptText("TextArea with promptText");
        // area2.setPrefRowCount(2);
        // area2.setPrefColumnCount(15);
        // AquaFx.resizeControl(area2, ControlSizeVariant.SMALL);
        // grid.add(area2, 7, 7, 2, 1);
        ProgressBar bar2 = new ProgressBar(0.6);
        AquaFx.createProgressBarStyler().setSizeVariant(ControlSizeVariant.SMALL).style(bar2);
        grid.add(bar2, 7, 7, 2, 1);

        Label labelb10 = new Label("mini:");
        AquaFx.createLabelStyler().setSizeVariant(ControlSizeVariant.MINI).style(labelb10);
        grid.add(labelb10, 0, 8);
        Slider slider7 = new Slider(0, 50, 20);
        slider7.setShowTickLabels(true);
        slider7.setShowTickMarks(true);
        slider7.setMajorTickUnit(25);
        slider7.setMinorTickCount(4);
        AquaFx.createSliderStyler().setSizeVariant(ControlSizeVariant.MINI).style(slider7);
        grid.add(slider7, 1, 8, 2, 1);
        Slider slider13 = new Slider(0, 50, 20);
        slider13.setShowTickLabels(false);
        slider13.setShowTickMarks(false);
        AquaFx.createSliderStyler().setSizeVariant(ControlSizeVariant.MINI).style(slider13);
        grid.add(slider13, 3, 8, 2, 1);
        ProgressIndicator indicator5 = new ProgressIndicator();
        AquaFx.createProgressIndicatorStyler().setSizeVariant(ControlSizeVariant.MINI).style(indicator5);
        grid.add(indicator5, 5, 8);
        ProgressIndicator indicator6 = new ProgressIndicator(0.5);
        AquaFx.createProgressIndicatorStyler().setSizeVariant(ControlSizeVariant.MINI).style(indicator6);
        grid.add(indicator6, 6, 8);
        // TextArea area3 = new TextArea();
        // area3.setPromptText("TextArea with promptText");
        // area3.setPrefRowCount(2);
        // area3.setPrefColumnCount(15);
        // AquaFx.resizeControl(area3, ControlSizeVariant.MINI);
        // grid.add(area3, 7, 8, 2, 1);
        ProgressBar bar3 = new ProgressBar(0.6);
        AquaFx.createProgressBarStyler().setSizeVariant(ControlSizeVariant.MINI).style(bar3);
        grid.add(bar3, 7, 8, 2, 1);

        /*
         * a GroupBox
         */
        VBox box = new VBox();
        box.setSpacing(15);
        box.setPadding(new Insets(15));
        AquaFx.setGroupBox(box);
        Label groupInfo = new Label("This is a GroupBox,\nwhich is applicable for all Panes\nvia AquaFX");
        box.getChildren().add(groupInfo);
        grid.add(box, 0, 10, 6, 3);

        /*
         * Special Controls
         */
        Label labelb2 = new Label("Help Button:");
        GridPane.setHalignment(labelb2, HPos.RIGHT);
        grid.add(labelb2, 6, 10);
        Button b2 = new Button("?");
        AquaFx.createButtonStyler().setType(ButtonType.HELP).style(b2);
        grid.add(b2, 7, 10);

        Label labelb3 = new Label("Rounded Button:");
        GridPane.setHalignment(labelb3, HPos.RIGHT);
        grid.add(labelb3, 6, 11);
        Button b3 = new Button("round rect");
        AquaFx.createButtonStyler().setType(ButtonType.ROUND_RECT).style(b3);
        grid.add(b3, 7, 11);

        Label labelb4 = new Label("Share Button:");
        GridPane.setHalignment(labelb4, HPos.RIGHT);
        grid.add(labelb4, 6, 12);
        Button b4 = new Button();
        AquaFx.createButtonStyler().setIcon(MacOSDefaultIcons.SHARE).style(b4);
        grid.add(b4, 7, 12);

        pane.setCenter(grid);
        scene.setRoot(pane);
        stage.show();
    }
View Full Code Here

        return tabPane;
    }

    private void buildListViewTab(Tab tab) {
        GridPane grid = new GridPane();
        grid.setPadding(new Insets(5, 5, 5, 5));
        grid.setHgap(5);
        grid.setVgap(5);

        // create the listview
        final ListView<TestPerson> listView = new ListView<TestPerson>();
        listView.setItems(data);

        // set the cell factory
        Callback<TestPerson, ObservableValue<Boolean>> getProperty = new Callback<TestPerson, ObservableValue<Boolean>>() {
            @Override public BooleanProperty call(TestPerson person) {
                // given a person, we return the property that represents
                // whether or not they are invited. We can then bind to this
                // bidirectionally.
                return person.telecommuterProperty();
            }
        };
        listView.setCellFactory(CheckBoxListCell.forListView(getProperty));

        grid.add(listView, 0, 0);
        GridPane.setVgrow(listView, Priority.ALWAYS);
        GridPane.setHgrow(listView, Priority.ALWAYS);
        tab.setContent(grid);
    }
View Full Code Here

        GridPane.setHgrow(listView, Priority.ALWAYS);
        tab.setContent(grid);
    }

    private void buildTreeViewTab(Tab tab) {
        GridPane grid = new GridPane();
        grid.setPadding(new Insets(5, 5, 5, 5));
        grid.setHgap(5);
        grid.setVgap(5);

        // --- TreeView 1
        // create the tree model
        TreeItem<String> root = TreeModels.getFamiliesTree();
        root.setExpanded(true);

        // create the treeView
        TreeView<String> treeView = new TreeView<String>();
        treeView.setRoot(root);

        // set the cell factory
        treeView.setCellFactory(CheckBoxTreeCell.<String> forTreeView());

        grid.add(treeView, 0, 0);
        GridPane.setVgrow(treeView, Priority.ALWAYS);
        GridPane.setHgrow(treeView, Priority.ALWAYS);

        // --- TreeView 2
        // create the tree model
        TreeItem<String> root1 = TreeModels.getFamiliesTree();
        root1.setExpanded(true);

        // update tree model to be independent
        setIndependent(root1);

        // create the treeView
        TreeView<String> treeView1 = new TreeView<String>();
        treeView1.setRoot(root1);

        // set the cell factory
        treeView1.setCellFactory(CheckBoxTreeCell.<String> forTreeView());

        grid.add(treeView1, 1, 0);
        GridPane.setVgrow(treeView1, Priority.ALWAYS);
        GridPane.setHgrow(treeView1, Priority.ALWAYS);

        tab.setContent(grid);
    }
View Full Code Here

            setIndependent(child);
        }
    }

    private void buildTableViewTab(Tab tab) {
        GridPane grid = new GridPane();
        grid.setPadding(new Insets(5, 5, 5, 5));
        grid.setHgap(5);
        grid.setVgap(5);

        // create the tableview
        TableColumn<TestPerson, Boolean> invitedColumn = new TableColumn<TestPerson, Boolean>("Invited");

        invitedColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, Boolean>("invited"));

        TableColumn<TestPerson, String> nameColumn = new TableColumn<TestPerson, String>("First Name");
        nameColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, String>("firstName"));

        TableView<TestPerson> tableView = new TableView<TestPerson>(data);
        tableView.getColumns().setAll(invitedColumn, nameColumn);

        // set the cell factory in the invited TableColumn
        invitedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(invitedColumn));

        grid.add(tableView, 0, 0);
        GridPane.setVgrow(tableView, Priority.ALWAYS);
        GridPane.setHgrow(tableView, Priority.ALWAYS);
        tab.setContent(grid);
    }
View Full Code Here

        content.getChildren().add(list);

        /*
         * The right-side content
         */
        GridPane grid = new GridPane();
        // grid.setGridLinesVisible(true);
        grid.setHgap(10);
        grid.setVgap(10);
        grid.setPadding(new Insets(18, 5, 8, 15));
        AquaFx.setGroupBox(grid);

        Label labelStatus = new Label("Status:");
        GridPane.setHalignment(labelStatus, HPos.RIGHT);
        grid.add(labelStatus, 0, 0, 2, 1);
        Label labelConnected = new Label("Verbunden");
        labelConnected.setStyle("-fx-font-weight: bold;");
        grid.add(labelConnected, 2, 0);
        Button btnDisableWlan = new Button("WLAN deaktivieren");
        GridPane.setHalignment(btnDisableWlan, HPos.RIGHT);
        grid.add(btnDisableWlan, 3, 0);
        Label labelCurrent = new Label("\"WLAN\" ist mit \"PrettyFlyForAWiFi\" verbunden und \n hat die IP-Adresse 192.168.0.104.");
        labelCurrent.setStyle("-fx-font-size: 11");
        grid.add(labelCurrent, 2, 2, 3, 1);
        Label labelNetworkName = new Label("Netzwerkname:");
        GridPane.setHalignment(labelNetworkName, HPos.RIGHT);
        grid.add(labelNetworkName, 0, 3);
        ChoiceBox<Object> choicesNetwork = new ChoiceBox<Object>();
        choicesNetwork.setItems(FXCollections.observableArrayList("PrettyFlyForAWiFi", new Separator(),
                "Mit anderem Netzwerk verbinden ...", "Netzwerk anlegen"));
        choicesNetwork.getSelectionModel().select(2);
        GridPane.setHalignment(choicesNetwork, HPos.RIGHT);
        GridPane.getHgrow(choicesNetwork);
        grid.add(choicesNetwork, 1, 3, 3, 1);
        CheckBox checkShowNew = new CheckBox("Auf neue Netzwerke hinweisen");
        checkShowNew.setSelected(true);
        grid.add(checkShowNew, 1, 4, 3, 1);
        Label labelExplanation = new Label("Bekannte Netzwerke wewrden automatisch verbunden. \n" + "Falls kein bekanntes Netzwerk vorhanden ist, werden \n" + "Sie vor dem Verbinden mit einem neuen Netzwerk \n" + "gefragt.");
        labelExplanation.setStyle("-fx-font-size: 10");
        grid.add(labelExplanation, 1, 5, 3, 1);
        VBox spacer = new VBox();
        spacer.setPrefHeight(140);
        spacer.setPrefWidth(200);
        grid.add(spacer, 3, 6);
        CheckBox chekShowState = new CheckBox("WLAN-Status in der \n" + "Men\u00FCleiste anzeigen");
        chekShowState.setSelected(true);
        GridPane.setValignment(chekShowState, VPos.TOP);
        grid.add(chekShowState, 0, 7, 2, 1);
        Button btmMore = new Button("Weitere Optionen ...");
        GridPane.setHalignment(btmMore, HPos.RIGHT);
        GridPane.setValignment(btmMore, VPos.BOTTOM);
        grid.add(btmMore, 2, 7, 2, 1);
        Button helpBtn = new Button("?");
        AquaFx.createButtonStyler().setType(ButtonType.HELP).style(helpBtn);
        GridPane.setValignment(helpBtn, VPos.BOTTOM);
        GridPane.setHalignment(helpBtn, HPos.RIGHT);
        grid.add(helpBtn, 4, 7);

        content.getChildren().add(grid);
        mainBox.getChildren().add(content);

        /*
 
View Full Code Here

        stage.setTitle("TitledPane");
        Scene scene = new Scene(new Group(), 400, 250);
       
        // --- GridPane container
        TitledPane gridTitlePane = new TitledPane();
        GridPane grid = new GridPane();
        grid.setVgap(4);
        grid.setPadding(new Insets(5, 5, 5, 5));
        grid.add(new Label("To: "), 0, 0);
        grid.add(new TextField(), 1, 0);
        grid.add(new Label("Cc: "), 0, 1);
        grid.add(new TextField(), 1, 1);
        grid.add(new Label("Subject: "), 0, 2);
        grid.add(new TextField(), 1, 2);       
        grid.add(new Label("Attachment: "), 0, 3);
        grid.add(label,1, 3);
        gridTitlePane.setText("Grid");
        gridTitlePane.setContent(grid);
       
        // --- Accordion
        final Accordion accordion = new Accordion ();               
View Full Code Here

   
    TextArea results = (TextArea)args.get(0);
   
    rsearch.create(args);
   
    GridPane rbook = new GridPane();
    rbook.setHgap(10);
    rbook.setVgap(10);
    rbook.setPadding(new Insets(50, 0, 0, 0));
    Label lbook = new Label("Booking");
    Label lclid = new Label("Client id: ");
    TextField tfid = new TextField();
    tfid.addEventHandler(KeyEvent.KEY_TYPED, new NumFilter());
    Label lroomnum = new Label("Room number: ");
    TextField tfroomnum = new TextField();
    tfroomnum.addEventHandler(KeyEvent.KEY_TYPED, new NumFilter());
    Button btnbook = new Button("Book!");
    btnbook.setDisable(true);
    btnbook.setOnAction(new BookEventHandler(results, tfid, tfroomnum));
    rbook.add(lbook, 0, 0);
    rbook.add(lclid, 0, 1);
    rbook.add(tfid, 1, 1);
    rbook.add(lroomnum, 0, 2);
    rbook.add(tfroomnum, 1, 2);
    rbook.add(btnbook, 0, 3);
   
    this.getChildren().addAll(rsearch, rbook);
  }
View Full Code Here

  public void close() throws SQLException {
    connect.close();
  }
 
  private Node createCleanSearchPanel() {
    GridPane gp = new GridPane();
    gp.setHgap(10);
    gp.setVgap(10);
   
    Label lclean = new Label("Worker search");
    Label lid = new Label("Id:");
    TextField tfid = new TextField();
    tfid.addEventFilter(KeyEvent.KEY_TYPED, new NumFilter());
    Label lname = new Label("Name:");
    TextField tfname = new TextField();
    tfname.addEventFilter(KeyEvent.KEY_TYPED, new NameFilter());
    Button btnsearch = new Button("Search");
   
    gp.add(lclean, 0, 0);
    gp.add(lid, 0, 1);
    gp.add(tfid, 1, 1);
    gp.add(lname, 0, 2);
    gp.add(tfname, 1, 2);
    gp.add(btnsearch, 0, 3);
   
    return gp;
  }
View Full Code Here

TOP

Related Classes of javafx.scene.layout.GridPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.