java.lang.Object
com.aoapps.hodgepodge.awt.LabelledGridLayout
- All Implemented Interfaces:
LayoutManager
Used to layout components in a grid. Each element in the
grid contains two components. The borders between these
two components are vertically aligned.
- Author:
- AO Industries, Inc.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLabelledGridLayout
(int rows, int columns) LabelledGridLayout
(int rows, int columns, int hgap, int vgap, int cgap) LabelledGridLayout
(int rows, int columns, int hgap, int vgap, int cgap, boolean stretchComponents) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayoutComponent
(String place, Component component) void
layoutContainer
(Container parent) Fix the layout when stretchComponenets == false and the number of components is not evenly divisible by the number of cols or rows.minimumLayoutSize
(Container parent) preferredLayoutSize
(Container parent) void
removeLayoutComponent
(Component component)
-
Field Details
-
rows
public final int rows -
columns
public final int columns -
hgap
public final int hgap -
vgap
public final int vgap -
cgap
public final int cgap -
stretchComponents
public final boolean stretchComponents
-
-
Constructor Details
-
LabelledGridLayout
public LabelledGridLayout(int rows, int columns) -
LabelledGridLayout
public LabelledGridLayout(int rows, int columns, int hgap, int vgap, int cgap) - Parameters:
rows
- the number of rowscolumns
- the number of columns, each column is two components widehgap
- the space between columnsvgap
- the space between rowscgap
- the space between the two components in a column
-
LabelledGridLayout
public LabelledGridLayout(int rows, int columns, int hgap, int vgap, int cgap, boolean stretchComponents) - Parameters:
rows
- the number of rowscolumns
- the number of columns, each column is two components widehgap
- the space between columnsvgap
- the space between rowscgap
- the space between the two components in a column
-
-
Method Details
-
addLayoutComponent
- Specified by:
addLayoutComponent
in interfaceLayoutManager
-
layoutContainer
Fix the layout when stretchComponenets == false and the number of components is not evenly divisible by the number of cols or rows.- Specified by:
layoutContainer
in interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
removeLayoutComponent
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
-