Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.layout
Interface FlexibleGridLayout.Builder
- Enclosing class:
FlexibleGridLayout
public static interface FlexibleGridLayout.Builder
Builds a
FlexibleGridLayout
instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newFlexibleGridLayout
instance with the current configuration.columns
(int columns) Sets the number of columns in the layout.fixColumnWidths
(boolean fixColumnWidths) Enables or disables uniform column widths based on the widest component in each column.fixedColumnWidth
(int fixedColumnWidth) Sets a specific fixed pixel width for all columns.fixedRowHeight
(int fixedRowHeight) Sets a specific fixed pixel height for all rows.fixRowHeights
(boolean fixRowHeights) Enables or disables uniform row heights based on the tallest component in each row.gap
(int gap) Sets both the horizontal and vertical gap between components.horizontalGap
(int horizontalGap) Sets the horizontal gap between components.rows
(int rows) Sets the number of rows in the layout.rowsColumns
(int rows, int columns) Sets both the number of rows and columns.verticalGap
(int verticalGap) Sets the vertical gap between components.
-
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
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
Sets both the number of rows and columns.- Parameters:
rows
- the number of rowscolumns
- 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
Sets the horizontal gap between components.- Parameters:
horizontalGap
- the number of pixels between columns- Returns:
- this builder instance
-
verticalGap
Sets the vertical gap between components.- Parameters:
verticalGap
- the number of pixels between rows- Returns:
- this builder instance
-
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
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
Sets a specific fixed pixel height for all rows. Automatically impliesfixRowHeights(boolean)
with true.- Parameters:
fixedRowHeight
- the fixed row height in pixels- Returns:
- this builder instance
-
fixedColumnWidth
Sets a specific fixed pixel width for all columns. Automatically impliesfixColumnWidths(boolean)
with true.- Parameters:
fixedColumnWidth
- the fixed column width in pixels- Returns:
- this builder instance
-
build
FlexibleGridLayout build()Builds a newFlexibleGridLayout
instance with the current configuration.- Returns:
- a configured layout manager
-