public final class Grid
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
TEST_GAPS |
Constructor and Description |
---|
Grid(ContainerWrapper container,
LC lc,
AC rowConstr,
AC colConstr,
java.util.Map<ComponentWrapper,CC> ccMap,
java.util.ArrayList<LayoutCallback> callbackList)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ContainerWrapper |
getContainer() |
int[] |
getHeight() |
int[] |
getWidth() |
void |
invalidateContainerSize()
If the container (parent) that this grid is laying out has changed its bounds, call this method to
clear any cached values.
|
boolean |
layout(int[] bounds,
UnitValue alignX,
UnitValue alignY,
boolean debug,
boolean checkPrefChange)
Does the actual layout.
|
void |
paintDebug() |
public static final boolean TEST_GAPS
public Grid(ContainerWrapper container, LC lc, AC rowConstr, AC colConstr, java.util.Map<ComponentWrapper,CC> ccMap, java.util.ArrayList<LayoutCallback> callbackList)
container
- The container that will be laid out.lc
- The form flow constraints.rowConstr
- The rows specifications. If more cell rows are required, the last element will be used for when there is no corresponding element in this array.colConstr
- The columns specifications. If more cell rows are required, the last element will be used for when there is no corresponding element in this array.ccMap
- The map containing the parsed constraints for each child component of parent
. Will not be altered.callbackList
- A list of callbacks or null
if none. Will not be altered.public void invalidateContainerSize()
public boolean layout(int[] bounds, UnitValue alignX, UnitValue alignY, boolean debug, boolean checkPrefChange)
bounds
- The bounds to layout against. Normally that of the parent. [x, y, width, height].alignX
- The alignment for the x-axis.alignY
- The alignment for the y-axis.debug
- If debug information should be saved in debugRects
.checkPrefChange
- If a check should be done to see if the setting of any new bounds changes the preferred size
of a component.public void paintDebug()
public ContainerWrapper getContainer()
public final int[] getWidth()
public final int[] getHeight()