public final class Grid extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
TEST_GAPS |
Constructor and Description |
---|
Grid(ContainerWrapper container,
LC lc,
AC rowConstr,
AC colConstr,
Map<? extends ComponentWrapper,CC> ccMap,
ArrayList<LayoutCallback> callbackList)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ContainerWrapper |
getContainer() |
int[] |
getHeight() |
int[] |
getHeight(int refWidth) |
int[] |
getWidth() |
int[] |
getWidth(int refHeight) |
void |
invalidateContainerSize()
If the container (parent) that this grid is laying out has changed its bounds, call this method to
clear any cached values min/pref/max sizes of the components and rows/columns.
|
boolean |
layout(int[] bounds,
UnitValue alignX,
UnitValue alignY,
boolean debug)
Does the actual layout.
|
boolean |
layout(int[] bounds,
UnitValue alignX,
UnitValue alignY,
boolean debug,
boolean notUsed)
Deprecated.
since 5.0 Last boolean is not needed and is gotten from the new
ComponentWrapper.getContentBias() instead; |
void |
paintDebug() |
public static final boolean TEST_GAPS
public Grid(ContainerWrapper container, LC lc, AC rowConstr, AC colConstr, Map<? extends ComponentWrapper,CC> ccMap, 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. Can have null CC which will use a common
cached one.callbackList
- A list of callbacks or null
if none. Will not be altered.public void invalidateContainerSize()
If any component can have changed cell the grid needs to be recreated.
public boolean layout(int[] bounds, UnitValue alignX, UnitValue alignY, boolean debug, boolean notUsed)
ComponentWrapper.getContentBias()
instead;public boolean layout(int[] bounds, UnitValue alignX, UnitValue alignY, boolean debug)
bounds
- The bounds to layout against. Normally that of the parent. [x, y, width, height].alignX
- The alignment for the x-axis. Can be null.alignY
- The alignment for the y-axis. Can be null.debug
- If debug information should be saved in debugRects
.ComponentWrapper.getContentBias()
.public void paintDebug()
public ContainerWrapper getContainer()
public final int[] getWidth()
public final int[] getWidth(int refHeight)
public final int[] getHeight()
public final int[] getHeight(int refWidth)
Copyright © 2007–2021. All rights reserved.