Package jfxtras.scene.layout

Examples of jfxtras.scene.layout.GridPane


  /**
   *
   */
  public Parent getRootNode()
  {
    gridPane = new GridPane()
      .withHGap(5)
      .withVGap(5)
      .withPadding(new Insets(10, 10, 10, 10))
      .withGridLinesVisible(true);
 
View Full Code Here


    }

  @Override
  public void start(Stage stage)
  {
    GridPane gridPane = new GridPane()
      .withHGap(5)
      .withVGap(5)
      .withPadding(new Insets(10, 10, 10, 10))
      .withGridLinesVisible(true);

      gridPane.add(new Label("SingleCell"), new GridPane.C().col(1).row(0));
    gridPane.add(new Label("RIGHT"), new GridPane.C().col(2).row(0).halignment(HPos.RIGHT));

    gridPane.add(new Label("Span2Row\nSpan2Row\nSpan2Row"), new GridPane.C().col(0).row(0).colSpan(1).rowSpan(2));

      gridPane.add(new Label("Span2Columns Span2Columns"), new GridPane.C().col(1).row(1).colSpan(2).rowSpan(1));

    gridPane.add(new Label("Single"), new GridPane.C().col(0).row(2));
    gridPane.add(new Label("Span2Col2RowCenter\nSpan2Col2RowCenter\nSpan2Col2RowCenter\nSpan2Col2RowCenter\nSpan2Col2RowCenter"), new GridPane.C().col(1).row(2).colSpan(2).rowSpan(2).halignment(HPos.CENTER));

    gridPane.add(new Label("BOTTOM"), new GridPane.C().col(0).row(3).valignment(VPos.BOTTOM));

      gridPane.add(new Label("TOP"), new GridPane.C().col(3).row(3).valignment(VPos.TOP));
     
        // setup scene
    Scene scene = new Scene(gridPane, 800, 200);
   
        // create stage
View Full Code Here

  private void layoutNodes()
  {
    getChildren().clear();
   
    // the result
    GridPane gridPane = new GridPane();
    gridPane = new GridPane();
    gridPane.setVgap(2.0);
    gridPane.setHgap(2.0);
    //gridPane.setPadding(new javafx.geometry.Insets(0,0,0,0));
    //gridPane.gridLinesVisibleProperty().set(true);
    getChildren().add(gridPane);
   
    // show weeknumbers
    boolean lShowWeeknumbers = ShowWeeknumbers.YES.equals( getShowWeeknumbers() );
    int lWeeknumbersCols = (lShowWeeknumbers ? 1 : 0);
    
    // setup the grid so all weekday togglebuttons will grow, but the weeknumbers do not
    ColumnConstraints lColumnConstraintsAlwaysGrow = new ColumnConstraints();
    lColumnConstraintsAlwaysGrow.setHgrow(Priority.ALWAYS);
    ColumnConstraints lColumnConstraintsNeverGrow = new ColumnConstraints();
    lColumnConstraintsNeverGrow.setHgrow(Priority.NEVER);
    if (lShowWeeknumbers)
    {
      gridPane.getColumnConstraints().addAll(lColumnConstraintsNeverGrow);
    }
    gridPane.getColumnConstraints().addAll(lColumnConstraintsAlwaysGrow, lColumnConstraintsAlwaysGrow, lColumnConstraintsAlwaysGrow, lColumnConstraintsAlwaysGrow, lColumnConstraintsAlwaysGrow, lColumnConstraintsAlwaysGrow, lColumnConstraintsAlwaysGrow);

    // month spinner
    gridPane.add(monthListSpinner, new GridPane.C().col(lWeeknumbersCols).row(0).colSpan(4).rowSpan(1));
   
    // year spinner
    gridPane.add(yearListSpinner, new GridPane.C().col(lWeeknumbersCols + 4).row(0).colSpan(3).rowSpan(1));
   
    // double click here to show today
    if (lShowWeeknumbers) {
      gridPane.add(todayLabel, new GridPane.C().col(0).row(1));
    }   
   
    // weekday labels
    for (int i = 0; i < 7; i++)
    {
      gridPane.add(weekdayLabels.get(i), new GridPane.C().col(lWeeknumbersCols + i).row(1));
    }
   
    // weeknumber labels
    if (lShowWeeknumbers)
    {
      for (int i = 0; i < 6; i++)
      {
        gridPane.add(weeknumberLabels.get(i), new GridPane.C().col(0).row(i + 2).margin(new javafx.geometry.Insets(0,0,0,0)));
      }
    }
   
    // setup: 6 rows of 7 days per week (which is the maximum number of buttons required in the worst case layout)
    for (int i = 0; i < 6 * 7; i++)
    {
      gridPane.add(dayButtons.get(i), new GridPane.C().col(lWeeknumbersCols + (i % 7)).row((i / 7) + 2));
    }

    // add timepicker
    // TODO: this is done upon construction, we need to make this dynamic based on Mode and showTime
    if (getSkinnable().getMode().equals(CalendarPicker.Mode.SINGLE) && getSkinnable().showTimeProperty().get() == true)
    {
      gridPane.add(timePicker, new GridPane.C().col(lWeeknumbersCols).row(8).colSpan(7).rowSpan(1));
    }
  }
View Full Code Here

TOP

Related Classes of jfxtras.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.