org.globus.cog.gui.util
Class SimpleGridLayout

java.lang.Object
  extended byorg.globus.cog.gui.util.SimpleGridLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class SimpleGridLayout
extends Object
implements LayoutManager2

This class is a layout manager which places it's components in a grid layout. The difference from the standard grid layout is that this one adjusts the sizes of the rows/columns according to the dimensions of the components, therefore not restricting a colummn or row to a specific width/height. It also takes into account the alignment of the components when placing them into the cells


Field Summary
static int Expand
           
 
Constructor Summary
SimpleGridLayout(int nRows, int nCols)
           
SimpleGridLayout(int nRows, int nCols, int hGap, int vGap)
           
 
Method Summary
 void addLayoutComponent(Component comp, Object constraints)
          Add a new component to the layout manager.
 void addLayoutComponent(String title, Component comp)
           
 float getLayoutAlignmentX(Container c)
           
 float getLayoutAlignmentY(Container c)
           
 void invalidateLayout(Container c)
           
 void layoutContainer(Container container)
          set the container of this layout manager
 Dimension maximumLayoutSize(Container container)
           
 Dimension minimumLayoutSize(Container container)
          get the minimum layout size for the specified container
 Dimension preferredLayoutSize(Container container)
           
 Dimension preferredLayoutSize1(Container container)
          get the preferred layout size for the specified container
 void removeLayoutComponent(Component component)
          remove the specified component from this layout manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Expand

public static final int Expand
See Also:
Constant Field Values
Constructor Detail

SimpleGridLayout

public SimpleGridLayout(int nRows,
                        int nCols)

SimpleGridLayout

public SimpleGridLayout(int nRows,
                        int nCols,
                        int hGap,
                        int vGap)
Method Detail

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
Add a new component to the layout manager.

Specified by:
addLayoutComponent in interface LayoutManager2
Parameters:
comp - The feature to be added to the LayoutComponent attribute
constraints - The feature to be added to the LayoutComponent attribute

addLayoutComponent

public void addLayoutComponent(String title,
                               Component comp)
Specified by:
addLayoutComponent in interface LayoutManager

layoutContainer

public void layoutContainer(Container container)
set the container of this layout manager

Specified by:
layoutContainer in interface LayoutManager
Parameters:
container - the container of this layout manager

minimumLayoutSize

public Dimension minimumLayoutSize(Container container)
get the minimum layout size for the specified container

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
container - the container to be checked for it's minimum layout size
Returns:
the minimum layout size as a Dimension object

preferredLayoutSize

public Dimension preferredLayoutSize(Container container)
Specified by:
preferredLayoutSize in interface LayoutManager

preferredLayoutSize1

public Dimension preferredLayoutSize1(Container container)
get the preferred layout size for the specified container

Parameters:
container - the container to be checked for it's preferred layout size
Returns:
the preferred layout size as a Dimension object

maximumLayoutSize

public Dimension maximumLayoutSize(Container container)
Specified by:
maximumLayoutSize in interface LayoutManager2

getLayoutAlignmentX

public float getLayoutAlignmentX(Container c)
Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container c)
Specified by:
getLayoutAlignmentY in interface LayoutManager2

removeLayoutComponent

public void removeLayoutComponent(Component component)
remove the specified component from this layout manager

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
component - the component to be removed

invalidateLayout

public void invalidateLayout(Container c)
Specified by:
invalidateLayout in interface LayoutManager2