Package javafx.scene.layout

Examples of javafx.scene.layout.FlowPane


            if (content != null) {
                contentPanel.setCenter(content);
                contentPanel.setPadding(new Insets(0, 0, 12, 0));
            }

            FlowPane buttonsPanel = new FlowPane(6, 0) {
                @Override protected void layoutChildren() {
                    /*
                    * According to UI guidelines, all buttons should have the same length.
                    * This function is to define the longest button in the array of buttons
                    * and set all buttons in array to be the length of the longest button.
                    */
                    // Find out the longest button...
                    double widest = 50;
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        widest = Math.max(widest, btn.prefWidth(-1));
                    }

                    // ...and set all buttons to be this width
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        btn.setPrefWidth(btn.isVisible() ? widest : 0);
                    }
                   
                    super.layoutChildren();
                }
            };
            buttonsPanel.getStyleClass().add("button-bar");

            // Create buttons from okBtnStr and cancelBtnStr strings.
            buttonsPanel.getChildren().addAll(createButtons());

            if (contentPanel.getChildren().size() > 0) {
                centerPanel.getChildren().add(contentPanel);
            }

View Full Code Here


      content = VBoxBuilder.create().styleClass("dialog")
          .build();
      content.setMaxSize(width, height);
      stage.setScene(new Scene(content, width, height, Color.TRANSPARENT));
      stage.getScene().getStylesheets().add(RS.path(RS.CSS_MAIN));
      final FlowPane flowPane = new FlowPane();
      flowPane.setAlignment(Pos.CENTER);
      flowPane.setVgap(20d);
      flowPane.setHgap(10d);
      flowPane.setPrefWrapLength(width);
      if (submitButton != null) {
        flowPane.getChildren().add(submitButton);
      }
      content.getChildren().addAll(header, messageHeader);
      if (children != null && children.length > 0) {
        for (final Node node : children) {
          if (node == null) {
            continue;
          }
          if (node instanceof Button) {
            flowPane.getChildren().add(node);
          } else {
            content.getChildren().add(node);
          }
        }
      }
View Full Code Here

    }

  @Override
  public void start(Stage stage) {

    FlowPane lFlowPane = new FlowPane();
      lFlowPane.setVgap(20);
      lFlowPane.setHgap(20);
      Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
      lFlowPane.setPrefWrapLength(primaryScreenBounds.getWidth());
      
    for (int j = 0; j < 10; j++)
//int j = 2;
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(Color.GREEN);
      lCircularPane.setArc(90.0);
      for (int i = 0; i < j; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(15,15);
        //c.setStroke(Color.RED);
        lCircularPane.add(c);
      }
      lFlowPane.getChildren().add(lCircularPane);
    }

        // setup scene
    Scene scene = new Scene(lFlowPane);
    //scene.getStylesheets().add(this.getClass().getName().replace(".", "/") + ".css");
View Full Code Here

    }

  @Override
  public void start(Stage stage) {

    FlowPane lFlowPane = new FlowPane();
      lFlowPane.setVgap(20);
      lFlowPane.setHgap(20);
      Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
      lFlowPane.setPrefWrapLength(primaryScreenBounds.getWidth());
      
    for (int j = 0; j < 360; j += 10)
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setStyle("-fx-border-color:black;");
      //lCircularPane.setAnimate(true);
      lCircularPane.setShowDebug(Color.GREEN);
      lCircularPane.setStartAngle( (double)j );
      for (int i = 0; i < 2; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(15,15);
        //c.setStroke(Color.RED);
        lCircularPane.add(c);
      }
      lFlowPane.getChildren().add(lCircularPane);
    }

        // setup scene
    Scene scene = new Scene(lFlowPane);
    //scene.getStylesheets().add(this.getClass().getName().replace(".", "/") + ".css");
View Full Code Here

    }

  @Override
  public void start(Stage stage) {

    FlowPane lFlowPane = new FlowPane();
      lFlowPane.setVgap(20);
      lFlowPane.setHgap(20);
      Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
      lFlowPane.setPrefWrapLength(primaryScreenBounds.getWidth());
      
    for (int j = 0; j < 360; j += 10)
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(Color.GREEN);
      lCircularPane.setStartAngle( (double)j );
      lCircularPane.setArc(90.0);
      for (int i = 0; i < 10; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(15,15);
        //c.setStroke(Color.RED);
        lCircularPane.add(c);
      }
      lFlowPane.getChildren().add(lCircularPane);
    }

        // setup scene
    Scene scene = new Scene(lFlowPane);
    scene.getStylesheets().add(this.getClass().getName().replace(".", "/") + ".css");
View Full Code Here

        }

    }

    @Override public void start(Stage stage) {
        FlowPane pane = new FlowPane();
        pane.getChildren().addAll(gauges);

        Scene scene = new Scene(pane, 500, 500, Color.WHITE);

        stage.setTitle("Gauge");
        stage.setScene(scene);
View Full Code Here

        ipp.getCenterBorderPane().setTop(hbox);
        if (icon != null) {
            hbox.getChildren().add(icon);
        }
        if (header != null) {
            FlowPane p = new FlowPane();
            p.setAlignment(Pos.CENTER);
            p.getChildren().add(header);
            hbox.getChildren().add(p);
        }
        if (content != null) {
            ipp.getCenterBorderPane().setCenter(content);
        }

        FlowPane flow = new FlowPane();
        ipp.getCenterBorderPane().setBottom(flow);
        flow.setAlignment(Pos.CENTER_RIGHT);
        flow.setHgap(20.0);

        if (check_box != null) {
            flow.getChildren().add(check_box);
            flow.getChildren().add(new Label(" "));
            flow.getChildren().add(new Label(" "));
        }
        if (ok_btn != null) {
            flow.getChildren().add(ok_btn);
        }
        if (cancel_btn != null) {
            flow.getChildren().add(cancel_btn);
        }
        flow.getChildren().add(new Label(" "));

        ipp.blurShow();

        is_show = true;
    }
View Full Code Here

        ipp.getCenterBorderPane().setTop(hbox);
        if (icon != null) {
            hbox.getChildren().add(icon);
        }
        if (header != null) {
            FlowPane p = new FlowPane();
            p.setAlignment(Pos.CENTER);
            p.getChildren().add(header);
            hbox.getChildren().add(p);
        }

        if (content != null && password_field == null) {
            ipp.getCenterBorderPane().setCenter(content);
        } else if (content != null && password_field != null) {

            BorderPane center_pane = new BorderPane();
            ipp.getCenterBorderPane().setCenter(center_pane);
            center_pane.setTop(content);

            if (content.getText() != null && content.getText().length() < 64) {
                content.setTranslateX(120.0);
            }

            FlowPane flow = new FlowPane();
            flow.setHgap(2);
            flow.setVgap(2);
            flow.setAlignment(Pos.CENTER);
            flow.getChildren().add(password_field);
            password_field.setPaddingValue(new Insets(3, 0, 0, 0));
            center_pane.setCenter(flow);

        } else if (content == null && password_field != null) {
            ipp.getCenterBorderPane().setCenter(password_field);
        }

        FlowPane flow = new FlowPane();
        ipp.getCenterBorderPane().setBottom(flow);
        flow.setAlignment(Pos.CENTER_RIGHT);
        flow.setHgap(20.0);

        if (check_box != null) {
            flow.getChildren().add(check_box);
            flow.getChildren().add(new Label(" "));
            flow.getChildren().add(new Label(" "));
        }
        if (ok_btn != null) {
            flow.getChildren().add(ok_btn);
        }
        if (cancel_btn != null) {
            flow.getChildren().add(cancel_btn);
        }
        flow.getChildren().add(new Label(" "));

        ipp.blurShow();

        is_show = true;
    }
View Full Code Here

        ipp.getCenterBorderPane().setTop(hbox);
        if (icon != null) {
            hbox.getChildren().add(icon);
        }
        if (header != null) {
            FlowPane p = new FlowPane();
            p.setAlignment(Pos.CENTER);
            p.getChildren().add(header);
            hbox.getChildren().add(p);
        }
        if (content != null) {
            ipp.getCenterBorderPane().setCenter(content);
        }

        FlowPane flow = new FlowPane();
        ipp.getCenterBorderPane().setBottom(flow);
        flow.setAlignment(Pos.CENTER_RIGHT);
        flow.setHgap(20.0);

        if (check_box != null) {
            flow.getChildren().add(check_box);
            flow.getChildren().add(new Label(" "));
            flow.getChildren().add(new Label(" "));
        }
        if (ok_btn != null) {
            flow.getChildren().add(ok_btn);
        }
        if (cancel_btn != null) {
            flow.getChildren().add(cancel_btn);
        }
        flow.getChildren().add(new Label(" "));

        ipp.blurShow();

        is_show = true;
    }
View Full Code Here

  public void dialog() {
    JuFxUtils.startApplication()
      .button("Show dialog", new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent ev) {
          FlowPane flowPane = new FlowPane();
          flowPane.getChildren().add(new Text("Hello There"));
          Button btn = new Button("Buhu");
          btn.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent ev) {
              Button btn = (Button)ev.getSource();
              JuFxUtils.closeWindow(btn);
            }
          });
         
          flowPane.getChildren().add(btn);
          flowPane.setPrefHeight(100);
         
          Scene scene = new Scene(flowPane);
         
          Stage stage = new Stage(StageStyle.UTILITY);
          stage.setTitle("Hello there");
View Full Code Here

TOP

Related Classes of javafx.scene.layout.FlowPane

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.