Interface FlexibleGridLayout.Builder

Enclosing class:
FlexibleGridLayout

public static interface FlexibleGridLayout.Builder
Builds a FlexibleGridLayout instances.
  • Method Details

    • rows

      Sets the number of rows in the layout. If both rows and columns are zero, layout behavior is undefined.
      Parameters:
      rows - the number of rows
      Returns:
      this builder instance
    • columns

      FlexibleGridLayout.Builder columns(int columns)
      Sets the number of columns in the layout. If both rows and columns are zero, layout behavior is undefined.
      Parameters:
      columns - the number of columns
      Returns:
      this builder instance
    • rowsColumns

      FlexibleGridLayout.Builder rowsColumns(int rows, int columns)
      Sets both the number of rows and columns.
      Parameters:
      rows - the number of rows
      columns - the number of columns
      Returns:
      this builder instance
    • gap

      Sets both the horizontal and vertical gap between components.
      Parameters:
      gap - the number of pixels between components in both directions
      Returns:
      this builder instance
    • horizontalGap

      FlexibleGridLayout.Builder horizontalGap(int horizontalGap)
      Sets the horizontal gap between components.
      Parameters:
      horizontalGap - the number of pixels between columns
      Returns:
      this builder instance
    • verticalGap

      FlexibleGridLayout.Builder verticalGap(int verticalGap)
      Sets the vertical gap between components.
      Parameters:
      verticalGap - the number of pixels between rows
      Returns:
      this builder instance
    • fixRowHeights

      FlexibleGridLayout.Builder fixRowHeights(boolean fixRowHeights)
      Enables or disables uniform row heights based on the tallest component in each row.
      Parameters:
      fixRowHeights - true to use fixed row heights
      Returns:
      this builder instance
    • fixColumnWidths

      FlexibleGridLayout.Builder fixColumnWidths(boolean fixColumnWidths)
      Enables or disables uniform column widths based on the widest component in each column.
      Parameters:
      fixColumnWidths - true to use fixed column widths
      Returns:
      this builder instance
    • fixedRowHeight

      FlexibleGridLayout.Builder fixedRowHeight(int fixedRowHeight)
      Sets a specific fixed pixel height for all rows. Automatically implies fixRowHeights(boolean) with true.
      Parameters:
      fixedRowHeight - the fixed row height in pixels
      Returns:
      this builder instance
    • fixedColumnWidth

      FlexibleGridLayout.Builder fixedColumnWidth(int fixedColumnWidth)
      Sets a specific fixed pixel width for all columns. Automatically implies fixColumnWidths(boolean) with true.
      Parameters:
      fixedColumnWidth - the fixed column width in pixels
      Returns:
      this builder instance
    • growRow

      FlexibleGridLayout.Builder growRow(int index)

      Specifies a row absorbing the height a container has beyond the preferred one, and giving up the height it lacks, the other rows keeping their preferred height. Call for each growing row.

      By default the difference is divided equally between all rows, as it is when none of the rows specified exists.

      Parameters:
      index - the index of the growing row
      Returns:
      this builder instance
      Throws:
      IllegalArgumentException - in case the index is negative
    • growColumn

      FlexibleGridLayout.Builder growColumn(int index)

      Specifies a column absorbing the width a container has beyond the preferred one, and giving up the width it lacks, the other columns keeping their preferred width. Call for each growing column.

      By default the difference is divided equally between all columns, as it is when none of the columns specified exists. A label column in a two column form typically keeps its preferred width:

       FlexibleGridLayout.builder()
               .rows(0)
               .columns(2)
               .growColumn(1)// the input column takes the space the labels do not need
               .build();
      
      Parameters:
      index - the index of the growing column
      Returns:
      this builder instance
      Throws:
      IllegalArgumentException - in case the index is negative
    • build

      Builds a new FlexibleGridLayout instance with the current configuration.
      Returns:
      a configured layout manager