Package javafx.scene.layout

Examples of javafx.scene.layout.VBox


    protected GridPane gridPane;
    protected int row = 0;

    @Override
    protected Node createRootNode() throws NodeCreationException {
        VBox titleBox = new VBox();
        titleBox.getChildren().add(createTitleNode());
        VBox contentBox = new VBox();
        contentBox.setPadding(new Insets(5.0, 5.0, 5.0, 5.0));
        contentBox.getStyleClass().add("form-content-box");
        titleBox.getChildren().add(contentBox);
        contentBox.setSpacing(5.0);
        gridPane = GridPaneBuilder.create().hgap(5.0).vgap(5.0).build();
        contentBox.getChildren().add(gridPane);
        return titleBox;
    }
View Full Code Here


        fxForm.setTitle("Dude, where is my form?");
        root.getChildren().add(createNode());
    }

    private Node createNode() {
        VBox vBox = new VBox();
        vBox.getChildren().addAll(createSkinSelector(), createCSSNode(), fxForm, createConstraintNode());
        return ScrollPaneBuilder.create().content(vBox).fitToWidth(true).build();
    }
View Full Code Here

        Application.launch(Demo.class, args);
    }

    @Override
    public void start(Stage stage) {
        VBox root = new VBox();
        root.setPadding(new Insets(10, 10, 10, 10));
        final DemoObject instance1 = new SubDemoObject();
        instance1.setName("John");
        instance1.setAge(18);
        final DemoObject instance2 = new SubDemoObject();
        instance2.setName("Julio");
        instance2.setAge(4);
        new ObjectPropertyObserver(instance1);
        new ObjectPropertyObserver(instance2);
        final FXForm fxForm = createFXForm();
        Scene scene = new Scene(root);
        scene.getStylesheets().add(Demo.class.getResource("style.css").toExternalForm());
        ChoiceBox<FXFormSkinFactory> skinChoiceBox = new ChoiceBox<FXFormSkinFactory>();
        skinChoiceBox.getItems().addAll(FXFormSkinFactory.DEFAULT_FACTORY, FXFormSkinFactory.INLINE_FACTORY);
        skinChoiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<FXFormSkinFactory>() {
            public void changed(ObservableValue<? extends FXFormSkinFactory> observableValue, FXFormSkinFactory fxFormSkin, FXFormSkinFactory fxFormSkin1) {
                fxForm.setSkin(fxFormSkin1.createSkin(fxForm));
            }
        });
        ChoiceBox<DemoObject> instanceChoiceBox = new ChoiceBox<DemoObject>();
        instanceChoiceBox.getItems().addAll(instance1, instance2);
        instanceChoiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<DemoObject>() {
            public void changed(ObservableValue<? extends DemoObject> observableValue, DemoObject demoObject, DemoObject demoObject1) {
                fxForm.setSource(demoObject1);
            }
        });
        instanceChoiceBox.selectionModelProperty().get().selectFirst();
        skinChoiceBox.selectionModelProperty().get().selectFirst();
        root.getChildren().addAll(skinChoiceBox, instanceChoiceBox, fxForm);
        stage.setScene(scene);
        stage.show();
        fxForm.addFilters(new ReorderFilter(new String[]{"age", "mail"}));
    }
View Full Code Here

        TextInputHelper.addLengthListener(tfTeamRnk10, 50);
        TextInputHelper.addLengthListener(tfTeamRnk11, 50);
        TextInputHelper.addLengthListener(tfTeamRnk12, 50);

        final Label title = LabelBuilder.create().text(ResourceLoader.getResource("label.title.createLeague")).style("-fx-font: NORMAL 16 Tahoma;").build();
        final VBox vBoxTop = VBoxBuilder.create().children().spacing(5.0).padding(new Insets(10, 10, 10, 10)).children(title).build();

        // create league button
        final Button buttonCreate = ButtonBuilder.create().text(ResourceLoader.getResource("button.createLeague")).onAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(final ActionEvent event) {
                // TODO validate and save data to database
                final Team team1 = new Team();
                team1.setStartPos(1);
                team1.setName(tfTeamRnk1.getText());
            }
        }).prefWidth(100.0).build();

        // cancel dialogue button
        final Button buttonCancel = ButtonBuilder.create().text(ResourceLoader.getResource("button.cancel")).onAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(final ActionEvent event) {
                final Stage stage = (Stage) parent.getScene().getWindow();
                stage.close();
            }
        }).prefWidth(100.0).build();

        final HBox hBoxButtonArea = HBoxBuilder.create().alignment(Pos.CENTER).spacing(5.0).padding(new Insets(20)).children(buttonCreate, buttonCancel).build();

        final ColumnConstraints ccWidth20 = ColumnConstraintsBuilder.create().prefWidth(50.0).build();
        final ColumnConstraints ccWidth180 = ColumnConstraintsBuilder.create().prefWidth(150.0).build();

        // labels for team names
        final Label labelTeamRnk1 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank1")).build();
        final Label labelTeamRnk2 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank2")).build();
        final Label labelTeamRnk3 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank3")).build();
        final Label labelTeamRnk4 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank4")).build();
        final Label labelTeamRnk5 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank5")).build();
        final Label labelTeamRnk6 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank6")).build();
        final Label labelTeamRnk7 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank7")).build();
        final Label labelTeamRnk8 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank8")).build();
        final Label labelTeamRnk9 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank9")).build();
        final Label labelTeamRnk10 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank10")).build();
        final Label labelTeamRnk11 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank11")).build();
        final Label labelTeamRnk12 = LabelBuilder.create().text(ResourceLoader.getResource("label.team.rank12")).build();

        final GridPane gpTeams = GridPaneBuilder.create().alignment(Pos.TOP_LEFT).hgap(5.0).vgap(5.0).columnConstraints(ccWidth20, ccWidth180).build();
        gpTeams.add(labelTeamRnk1, 0, 0);
        gpTeams.add(tfTeamRnk1, 1, 0);
        gpTeams.add(labelTeamRnk2, 0, 1);
        gpTeams.add(tfTeamRnk2, 1, 1);
        gpTeams.add(labelTeamRnk3, 0, 2);
        gpTeams.add(tfTeamRnk3, 1, 2);
        gpTeams.add(labelTeamRnk4, 0, 3);
        gpTeams.add(tfTeamRnk4, 1, 3);
        gpTeams.add(labelTeamRnk5, 0, 4);
        gpTeams.add(tfTeamRnk5, 1, 4);
        gpTeams.add(labelTeamRnk6, 0, 5);
        gpTeams.add(tfTeamRnk6, 1, 5);
        gpTeams.add(labelTeamRnk7, 0, 6);
        gpTeams.add(tfTeamRnk7, 1, 6);
        gpTeams.add(labelTeamRnk8, 0, 7);
        gpTeams.add(tfTeamRnk8, 1, 7);
        gpTeams.add(labelTeamRnk9, 0, 8);
        gpTeams.add(tfTeamRnk9, 1, 8);
        gpTeams.add(labelTeamRnk10, 0, 9);
        gpTeams.add(tfTeamRnk10, 1, 9);
        gpTeams.add(labelTeamRnk11, 0, 10);
        gpTeams.add(tfTeamRnk11, 1, 10);
        gpTeams.add(labelTeamRnk12, 0, 11);
        gpTeams.add(tfTeamRnk12, 1, 11);

        final ColumnConstraints ccWidth80 = ColumnConstraintsBuilder.create().prefWidth(80.0).build();
        final ColumnConstraints ccWidth120 = ColumnConstraintsBuilder.create().prefWidth(120.0).build();

        final Label labelMatchday = LabelBuilder.create().text(ResourceLoader.getResource("label.firstMatchday")).build();
        final TextField tfMatchday = TextFieldBuilder.create().id("idTfMatchday").build();

        final GridPane gpMatchday = GridPaneBuilder.create().alignment(Pos.TOP_LEFT).hgap(5.0).vgap(5.0).columnConstraints(ccWidth80, ccWidth120).build();
        gpMatchday.add(labelMatchday, 0, 0);
        gpMatchday.add(tfMatchday, 1, 0);

        final VBox vBoxCenter = VBoxBuilder.create().children(gpTeams, gpMatchday, hBoxButtonArea).spacing(5.0).padding(new Insets(10, 10, 10, 10)).build();

        parent.setTop(vBoxTop);
        parent.setCenter(vBoxCenter);
        return parent;
    }
View Full Code Here

    private VBox controllerBox;

    @Override
    protected Node createRootNode() throws NodeCreationException {
        VBox titleBox = new VBox();
        titleBox.getChildren().add(createTitleNode());
        final VBox contentBox = new VBox();
        contentBox.setPadding(new Insets(5.0, 5.0, 5.0, 5.0));
        contentBox.getStyleClass().add("form-content-box");
        titleBox.getChildren().add(contentBox);
        contentBox.setSpacing(5.0);
        ConstraintLabel constraintLabel = new ConstraintLabel();
        constraintLabel.constraintProperty().bind(fxForm.getClassLevelValidator().constraintViolationsProperty());
        controllerBox = new VBox();
        contentBox.getChildren().addAll(constraintLabel, controllerBox);
        return titleBox;
    }
View Full Code Here

    protected GridPane gridPane;
    protected int row = 0;

    @Override
    protected Node createRootNode() throws NodeCreationException {
        VBox titleBox = new VBox();
        titleBox.getChildren().add(createTitleNode());
        VBox contentBox = new VBox();
        contentBox.setPadding(new Insets(5.0, 5.0, 5.0, 5.0));
        contentBox.getStyleClass().add("form-content-box");
        titleBox.getChildren().add(contentBox);
        contentBox.setSpacing(5.0);
        ConstraintLabel constraintLabel = new ConstraintLabel();
        constraintLabel.constraintProperty().bind(fxForm.getClassLevelValidator().constraintViolationsProperty());
        gridPane = GridPaneBuilder.create().hgap(5.0).vgap(5.0).build();
        contentBox.getChildren().addAll(constraintLabel, gridPane);
        return titleBox;
    }
View Full Code Here

       
        // create toolbar background path
        Path toolBarBackground = createToolBarPath(null,Color.web("#606060"));
       
        // create toolbar
        toolBar = new VBox(0);
        toolBar.setId("ToolsToolbar");
        toolBar.setClip(createToolBarPath(Color.BLACK, null));
        ToggleGroup toggleGroup = new ToggleGroup();
        for (int i=0; i < tools.length; i++) {
            final int index = i;
View Full Code Here

     *
     * @return the vbox with default content items
     */
    protected VBox buildDefaultContent(final SlideContent slideContent) {

        final VBox vbox = new VBox();
        // vbox.getStyleClass().add("content");

        // Link the class style of this slide content
        if (getModel().getSlide().getStyle() != null) {
            vbox.getStyleClass().add(getModel().getSlide().getStyle());
        }

        if (slideContent != null) {
            // Add all slide item into the vbox panel
            for (final SlideItem item : slideContent.getItem()) {
View Full Code Here

 

  @Override
  public Node createForm() {

      VBox rootBox = VBoxBuilder.create()
          .spacing(10)
          .build();
     
     
      rootBox.getChildren().addAll(
          buildVBox(),
          buildVBox(),
          buildVBox()
          );
     
View Full Code Here

        return rootBox;

    }

  private VBox buildVBox() {
    final VBox contentBox = VBoxBuilder.create()
                .styleClass("Form")
                .prefWidth(200)
               
                .build();



        contentBox.getChildren().add(createField("FIELD", "km/h"));
        contentBox.getChildren().add(createLine());
        contentBox.getChildren().add(createField("Field", "km/h"));
        contentBox.getChildren().add(createLine());
        contentBox.getChildren().add(createField("Field", "km/h"));
        contentBox.getChildren().add(createLine());
        contentBox.getChildren().add(createField("Field", "km/h"));
        contentBox.getChildren().add(createLine());
        contentBox.getChildren().add(createField("Field", "km/h"));
    return contentBox;
  }
View Full Code Here

TOP

Related Classes of javafx.scene.layout.VBox

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.