Class DynamicGridLayout

java.lang.Object
org.xj3d.ui.awt.widgets.DynamicGridLayout
All Implemented Interfaces:
LayoutManager, Serializable

public class DynamicGridLayout extends Object implements LayoutManager, Serializable
A layout manager that lays out a container's components in a rectangular grid, with different sizes for each row/column.

As with GridLayout one component is placed in each rectangle, but the width of columns and height of rows are not necessarily the same. By default each row and column will be sized in proportion to the minimum size of the largest component in that row or column. Alternatively, individual rows or columns can be set to a fixed percentage of the container or their minimum size with various options. Components can also be set to fill the assigned area or use their minimum size and align themselves within that allocated space. If the grid itself doesn't completely fill the area assigned by the container there are methods to set this alignment too.

Here's a simple example of using a DynamicGridLayout.

   //create the layout and set it
   setLayout(dgl=new DynamicGridLayout(2,2,5,5));

   //set any styles, sizes or alignments
   dgl.setRowSize(0,dgl.MINIMUM);

   //add the components
   add(new Button("Row One/Col One"));
   add(new Button("Row One/Col Two"));

   add(new Button("Row Two/Col One"));
   add(new Button("Row Two/Col Two"));
 
Version:
$Revision: 1.2 $
Author:
Robert Nielsen
See Also: