org.moyoman.client.reference.util
Class GridLayout2

java.lang.Object
  |
  +--java.awt.GridLayout
        |
        +--org.moyoman.client.reference.util.GridLayout2
All Implemented Interfaces:
LayoutManager, Serializable

public class GridLayout2
extends GridLayout

This layout manager extends GridLayout to allow the cells to be different sizes. Taken from Java World Tip #121: Flex Your Grid Layout.

Since:
v0.01
Version:
v0.01
Author:
Bogdan Dorohonceanu
, Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.GridLayout
 
Constructor Summary
GridLayout2()
          Construct this object.
GridLayout2(int rows, int cols)
          Construct this object with the given parameters.
GridLayout2(int rows, int cols, int hgap, int vgap)
          Construct this object with the given parameters.
 
Method Summary
 void layoutContainer(Container parent)
          Layout the components in the given container.
 Dimension minimumLayoutSize(Container parent)
          Return the minimum layout size for the given container.
 Dimension preferredLayoutSize(Container parent)
          Return the preferred layout size for the given container.
 
Methods inherited from class java.awt.GridLayout
addLayoutComponent, getColumns, getHgap, getRows, getVgap, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridLayout2

public GridLayout2()
Construct this object.

Since:
v0.01

GridLayout2

public GridLayout2(int rows,
                   int cols)
Construct this object with the given parameters.

Parameters:
rows - Number of rows.
cols - Number of columns.
Since:
v0.01

GridLayout2

public GridLayout2(int rows,
                   int cols,
                   int hgap,
                   int vgap)
Construct this object with the given parameters.

Parameters:
rows - Number of rows.
cols - Number of columns.
hgap - Horizontal gap between components.
vgap - Vertical gap between components.
Since:
v0.01
Method Detail

layoutContainer

public void layoutContainer(Container parent)
Layout the components in the given container.

Specified by:
layoutContainer in interface LayoutManager
Overrides:
layoutContainer in class GridLayout
Parameters:
parent - Container to layout.
Since:
v0.01

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Return the minimum layout size for the given container.

Specified by:
minimumLayoutSize in interface LayoutManager
Overrides:
minimumLayoutSize in class GridLayout
Parameters:
parent - Container of interest.
Since:
v0.01

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Return the preferred layout size for the given container.

Specified by:
preferredLayoutSize in interface LayoutManager
Overrides:
preferredLayoutSize in class GridLayout
Parameters:
parent - Container of interest.
Since:
v0.01