public final class Grid
- Object
- Grid
Holds components in a grid. Does most of the logic behind the layout manager.
Fields
public static final boolean TEST_GAPS = true |
Constructors
public Grid(ContainerWrapper container, LC lc, AC rowConstr, AC colConstr, Map<? extends ComponentWrapper, CC> ccMap, ArrayList<LayoutCallback> callbackList) | Constructor. |
Methods
public 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. |
public boolean layout(int[] bounds, UnitValue alignX, UnitValue alignY, boolean debug, boolean notUsed) | Deprecated |
public boolean layout(int[] bounds, UnitValue alignX, UnitValue alignY, boolean debug) | Does the actual layout. |
public void paintDebug() | |
public ContainerWrapper getContainer() | |
public int[] getWidth() | |
public int[] getWidth(int refHeight) | |
public int[] getHeight() | |
public int[] getHeight(int refWidth) |
Inherited methods
Field details
TEST_GAPS
public static final boolean TEST_GAPS = trueConstructor details
Grid
public Grid(ContainerWrapper container, LC lc, AC rowConstr, AC colConstr, Map<? extends ComponentWrapper, CC> ccMap, ArrayList<LayoutCallback> callbackList)Constructor.
Parameters
containerContainerWrapper- The container that will be laid out.
lcLC- The form flow constraints.
rowConstrAC- 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.
colConstrAC- 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.
ccMapMap<? extends ComponentWrapper, CC>- 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. callbackListArrayList<LayoutCallback>- A list of callbacks or
nullif none. Will not be altered.
Method details
invalidateContainerSize
public 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.
If any component can have changed cell the grid needs to be recreated.
layout
public 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
net.miginfocom.layout.ComponentWrapper#getContentBias()
instead;layout
public boolean layout(int[] bounds, UnitValue alignX, UnitValue alignY, boolean debug)Does the actual layout. Uses many values calculated in the constructor.
Parameters
boundsint[]- The bounds to layout against. Normally that of the parent. [x, y, width, height].
alignXUnitValue- The alignment for the x-axis. Can be null.
alignYUnitValue- The alignment for the y-axis. Can be null.
debugboolean- If debug information should be saved in
#debugRects.
Returns
If the layout has changed the preferred size and there is need
for a new layout. This can happen if one or more components in the grid
has a content bias according to
net.miginfocom.layout.ComponentWrapper#getContentBias().paintDebug
public void paintDebug()getContainer
public ContainerWrapper getContainer()getWidth
public int[] getWidth()getWidth
public int[] getWidth(int refHeight)getHeight
public int[] getHeight()getHeight
public int[] getHeight(int refWidth)