Package jfxtras.scene.layout

Examples of jfxtras.scene.layout.HBox


    if (lArrowDirection == ArrowDirection.HORIZONTAL)
    {
      if (lArrowPosition == ArrowPosition.LEADING)
      {
        HBox lHBox = new HBox(0);
        lHBox.add(decrementArrow, new HBox.C().hgrow(Priority.ALWAYS));
        lHBox.add(incrementArrow, new HBox.C().hgrow(Priority.ALWAYS));
        skinNode.setLeft(lHBox);
        BorderPane.setAlignment(lHBox, Pos.CENTER_LEFT);
        //lHBox.setStyle("-fx-border-color: blue;");
      }
      if (lArrowPosition == ArrowPosition.TRAILING)
      {
        HBox lHBox = new HBox(0);
        lHBox.add(decrementArrow, new HBox.C().hgrow(Priority.ALWAYS));
        lHBox.add(incrementArrow, new HBox.C().hgrow(Priority.ALWAYS));
        skinNode.setRight(lHBox);
        BorderPane.setAlignment(lHBox, Pos.CENTER_RIGHT);
        //lHBox.setStyle("-fx-border-color: blue;");
      }
      if (lArrowPosition == ArrowPosition.SPLIT)
View Full Code Here


    }

  @Override
  public void start(Stage stage)
  {
    HBox lHBox = new HBox(5.0);
    lHBox.add(new Button("grow"), new HBox.C().hgrow(Priority.ALWAYS));
    lHBox.add(new Button("margin 5 grow"), new HBox.C().margin(new Insets(5.0)).hgrow(Priority.ALWAYS));
    lHBox.getChildren().add(new Button("old style"));
    lHBox.add(new Button("margin 20 nogrow"), new HBox.C().margin(new Insets(20.0)));
    lHBox.add(new Button("grow maxheight 50"), new HBox.C().hgrow(Priority.ALWAYS).maxHeight(50.0));

        // setup scene
    Scene scene = new Scene(lHBox, 800, 200);
   
        // create stage
View Full Code Here

  /**
   *
   */
  public Parent getRootNode()
  {
    hbox = new HBox(5.0);
    hbox.add(new Button("grow"), new HBox.C().hgrow(Priority.ALWAYS));
    hbox.add(new Button("margin 5 grow"), new HBox.C().margin(new Insets(5.0)).hgrow(Priority.ALWAYS));
    hbox.getChildren().add(new Button("old style"));
    hbox.add(new Button("margin 20 nogrow"), new HBox.C().margin(new Insets(20.0)));
    hbox.add(new Button("grow maxheight 50"), new HBox.C().hgrow(Priority.ALWAYS).maxHeight(50.0));
View Full Code Here

    }

  @Override
  public void start(Stage stage) {
   
    HBox lHBox = new HBox(20);
    Paint lShowDebug = Color.GREEN;
   
    {
      CircularPane lCircularPane = new CircularPane();
      //lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setStartAngle(360.0 / 12 / 2); // make sure the 12 is on top
      lCircularPane.setChildrenAreCircular(true);
      //lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      final List<Label> labels = new ArrayList<>();
      final List<Circle> circles = new ArrayList<>();
      final AtomicReference<Circle> lastFocus = new AtomicReference<>();
      final AtomicBoolean isPM = new AtomicBoolean(false);
      for (int i = 0; i < 12; i++) {
        javafx.scene.shape.Circle c = new javafx.scene.shape.Circle(10, Color.TRANSPARENT);
        c.getStyleClass().add("timecircle");
        circles.add(c);
        javafx.scene.control.Label t = new javafx.scene.control.Label("" + (i + 1));
        t.getStyleClass().add("time");
        labels.add(t);
        c.setOnMouseEntered( (event) -> {
          int lastFocusIdx = circles.indexOf(lastFocus.get());
          int currentIdx = circles.indexOf( event.getSource() );
         
          if ( (lastFocusIdx == 11 && currentIdx == 0)
            || (lastFocusIdx == 0 && currentIdx == 11)
             ) {
            isPM.set( !isPM.get() );
          }
         
          for (int j = 0; j < 12; j++) {
            labels.get(j).setText( "" + ( (j + 1) + (isPM.get() ? 12 : 0) ) );
          }
        });
        c.setOnMouseExited( (event) -> {
          lastFocus.set( (Circle)event.getSource() );
        });
        StackPane lStackPane = new StackPane();
        lStackPane.setId("" + i);
        lStackPane.getChildren().add(c);
        lStackPane.getChildren().add(t);
        lCircularPane.add(lStackPane);
      }
     
      StackPane lStackPane = new StackPane();
      Circle c = new Circle(1, Color.WHITE);
      c.radiusProperty().bind(lCircularPane.widthProperty().divide(2.0));
      lStackPane.getChildren().add(c);
      lStackPane.getChildren().add(lCircularPane);
      Label l = new Label("H");
      l.getStyleClass().add("center");
      lStackPane.getChildren().add(l);
      lHBox.add(lStackPane);
    }
   
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setStartAngle(-360.0 / 12 / 2);
      lCircularPane.setDiameter(150.0);
      //lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setChildrenAreCircular(true);
      //lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      final List<Label> labels = new ArrayList<>();
      final List<Circle> circles = new ArrayList<>();
      for (int i = 0; i < 12; i++) {
        javafx.scene.shape.Circle c = new javafx.scene.shape.Circle(10, Color.TRANSPARENT);
        circles.add(c);
        javafx.scene.control.Label t = new javafx.scene.control.Label("" + (i * 5));
        t.getStyleClass().add("time");
        labels.add(t);
        StackPane lStackPane = new StackPane();
        lStackPane.getChildren().add(c);
        lStackPane.getChildren().add(t);
        lCircularPane.add(lStackPane);
      }
      StackPane lStackPane = new StackPane();
      Circle c = new Circle(1, Color.WHITE);
      c.radiusProperty().bind(lCircularPane.widthProperty().divide(2.0));
      lStackPane.getChildren().add(c);
      lStackPane.getChildren().add(lCircularPane);
      Label l = new Label("M");
      l.getStyleClass().add("center");
      lStackPane.getChildren().add(l);
      lHBox.add(lStackPane);
    }
   
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setDiameter(90.0);
      //lCircularPane.setStyle("-fx-border-color:black;");
      //lCircularPane.setChildrenAreCircular(true);
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      final List<Label> labels = new ArrayList<>();
      final List<Circle> circles = new ArrayList<>();
      final AtomicReference<Circle> lastFocus = new AtomicReference<>();
      final AtomicBoolean isPM = new AtomicBoolean(false);
      for (int i = 0; i < 12; i++) {
        javafx.scene.shape.Circle c = new javafx.scene.shape.Circle(10, Color.GRAY);
        circles.add(c);
        javafx.scene.control.Label t = new javafx.scene.control.Label("" + (i * 5));
        t.getStyleClass().add("time");
        labels.add(t);
        StackPane lStackPane = new StackPane();
        lStackPane.getChildren().add(c);
        lStackPane.getChildren().add(t);
        lCircularPane.add(lStackPane);
      }
      StackPane lStackPane = new StackPane();
      lStackPane.getChildren().add(lCircularPane);
      Label l = new Label("S");
      l.getStyleClass().add("center");
      lStackPane.getChildren().add(l);
      lHBox.add(lStackPane);
    }
   
    {
      CircularPane lCircularPane = new CircularPane().withId("XX");
      //lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      for (int i = 0; i < 12; i++) {
        javafx.scene.control.Button b = new javafx.scene.control.Button("XX");
//        b.setStyle("-fx-padding:10px;");
        b.setStyle("-fx-margin:10px;");
        lCircularPane.add(b);
      }
      lHBox.add(lCircularPane);
    }
   
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setMinSize(200200);
      //lCircularPane.setStyle("-fx-border-color:black;");
      //lCircularPane.setChildrenAreCircular(true);
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      for (int i = 0; i < 8; i++) {
        javafx.scene.shape.Circle c = new javafx.scene.shape.Circle(10);
        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane);
     
//      final Node n = lCircularPane.getChildren().get(0);       
//      n.layoutXProperty().addListener( (observable) -> {
//        System.out.println("layoutX=" + n.getLayoutX());
//      });   
//      n.layoutYProperty().addListener( (observable) -> {
//        System.out.println("layoutY=" + n.getLayoutY());
//      });   
     
    }
   
    {
      CircularPane lCircularPane = new CircularPane();
      //lCircularPane.setStyle("-fx-border-color:black;");
      //lCircularPane.setChildrenAreCircular(true);
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      for (int i = 0; i < 8; i++) {
        javafx.scene.shape.Circle c = new javafx.scene.shape.Circle(10);
        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane, new HBox.C().hgrow(Priority.ALWAYS));
    }
   
    {
      CircularPane lCircularPane = new CircularPane();
      //lCircularPane.setStyle("-fx-border-color:black;");
      //lCircularPane.setChildrenAreCircular(true);
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      for (int i = 0; i < 8; i++) {
        javafx.scene.shape.Circle c = new javafx.scene.shape.Circle(5 + i);
        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane);
    }

    {
      CircularPane lCircularPane = new CircularPane();
      //lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      for (int i = 0; i < 8; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(5 + (2*i), 5 + (2*i));
        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane);
    }
   
    {
      CircularPane lCircularPane = new CircularPane();
      //lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateFromTheOrigin);
      for (int i = 0; i < 8; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(5 + (2*i), 5 + (2*i));
        c.setRotate(45);
        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane);
    }
   
   
    CircularPane lCircularPane = new CircularPane();
    {
      //lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(lShowDebug);
      lCircularPane.setAnimationInterpolation(CircularPane::animateFromTheOrigin);
//      lCircularPane.setAnimationInterpolation(CircularPane::animateOverTheArc);
      for (int i = 0; i < 10; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(20, 20);
        c.setRotate(i * 10);
        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane);
    }
   
    Button lButton = new Button("out");
    lButton.setOnAction( (actionEvent) -> {
      lCircularPane.animateOut();
    });
    lCircularPane.setOnAnimateOutFinished( (event) -> {
      lCircularPane.setVisible(false);
      Platform.runLater(() -> {
        TestUtil.sleep(3000);
        lCircularPane.setVisible(true);
        lCircularPane.animateIn();
      });
    });
    lHBox.getChildren().add(lButton);
   
        // setup scene
    Scene scene = new Scene(lHBox);
    scene.getStylesheets().add(this.getClass().getName().replace(".", "/") + ".css");
   
View Full Code Here

  @Override
  public void start(Stage stage) {

    VBox lVBox = new VBox();   
    HBox lHBox = new HBox(0);
    lVBox.getChildren().add(lHBox);

    for (int j = 1; j < 27; j++)
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setStyle("-fx-border-color:black;");
      lCircularPane.setShowDebug(Color.GREEN);
      for (int i = 0; i < j; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(30,30);
        //c.setStroke(Color.RED);
        lCircularPane.add(c);
      }
      lHBox.getChildren().add(lCircularPane);
      if (lHBox.prefWidth(-1) > 1500) {
        lHBox = new HBox(0);
        lVBox.getChildren().add(lHBox);
      }
    }

        // setup scene
View Full Code Here

  @Override
  public void start(Stage stage) {

    VBox lVBox = new VBox();   
    HBox lHBox = new HBox(0);
    lVBox.getChildren().add(lHBox);

    for (int j = 1; j < 27; j++)
    {
      CircularPane lCircularPane = new CircularPane();
      lCircularPane.setStyle("-fx-border-color:black;");
      //lCircularPane.setChildrenAreCircular(true);
      lCircularPane.setShowDebug(Color.GREEN);
      for (int i = 0; i < j; i++) {
        javafx.scene.shape.Rectangle c = new javafx.scene.shape.Rectangle(20,20);
        lCircularPane.add(c);
      }
      lHBox.getChildren().add(lCircularPane);
      if (lHBox.prefWidth(-1) > 1000) {
        lHBox = new HBox(0);
        lVBox.getChildren().add(lHBox);
      }
    }

        // setup scene
View Full Code Here

TOP

Related Classes of jfxtras.scene.layout.HBox

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.