Package org.emrick.project.dev
Class DevUI.ResponsiveGrid
java.lang.Object
org.emrick.project.dev.DevUI.ResponsiveGrid
- All Implemented Interfaces:
LayoutManager
- Enclosing class:
- DevUI
Grid of cards whose column count follows the available width (up to
maxColumns), so cards
stack instead of squeezing when the window is narrow. With fillHeight, a single row stretches
to the available height.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final intprivate final intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionResponsiveGrid(int minCellWidth, int maxColumns, int gap, boolean fillHeight) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(String name, Component comp) private intavailableWidth(Container parent) private intvoidlayoutContainer(Container parent) minimumLayoutSize(Container parent) preferredLayoutSize(Container parent) voidprivate int[]rowHeights(Component[] comps, int cols) private Component[]
-
Field Details
-
minCellWidth
private final int minCellWidth -
maxColumns
private final int maxColumns -
gap
private final int gap -
fillHeight
private final boolean fillHeight
-
-
Constructor Details
-
ResponsiveGrid
ResponsiveGrid(int minCellWidth, int maxColumns, int gap, boolean fillHeight)
-
-
Method Details
-
columns
-
rowHeights
-
visible
-
availableWidth
-
preferredLayoutSize
- Specified by:
preferredLayoutSizein interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSizein interfaceLayoutManager
-
layoutContainer
- Specified by:
layoutContainerin interfaceLayoutManager
-
addLayoutComponent
- Specified by:
addLayoutComponentin interfaceLayoutManager
-
removeLayoutComponent
- Specified by:
removeLayoutComponentin interfaceLayoutManager
-