net.miginfocom.layout
Class Grid

java.lang.Object
  extended by net.miginfocom.layout.Grid

public final class Grid
extends Object

Holds components in a grid. Does most of the logic behind the layout manager.


Field Summary
static boolean TEST_GAPS
           
 
Constructor Summary
Grid(ContainerWrapper container, LC lc, AC rowConstr, AC colConstr, Map<ComponentWrapper,CC> ccMap, ArrayList<LayoutCallback> callbackList)
          Constructor.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_GAPS

public static final boolean TEST_GAPS
See Also:
Constant Field Values
Constructor Detail

Grid

public Grid(ContainerWrapper container,
            LC lc,
            AC rowConstr,
            AC colConstr,
            Map<ComponentWrapper,CC> ccMap,
            ArrayList<LayoutCallback> callbackList)
Constructor.

Parameters:
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.
Method Detail

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.


layout

public boolean layout(int[] bounds,
                      UnitValue alignX,
                      UnitValue alignY,
                      boolean debug,
                      boolean checkPrefChange)
Does the actual layout. Uses many values calculated in the constructor.

Parameters:
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.
Returns:
If the layout has probably changed the preferred size and there is need for a new layout (normally only SWT).

paintDebug

public void paintDebug()

getContainer

public ContainerWrapper getContainer()

getWidth

public final int[] getWidth()

getHeight

public final int[] getHeight()


Copyright © 2007-2011. All Rights Reserved.