org.vizzini.ui
Class GridLayout2

java.lang.Object
  extended by java.awt.GridLayout
      extended by org.vizzini.ui.GridLayout2
All Implemented Interfaces:
LayoutManager, Serializable

public class GridLayout2
extends GridLayout

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

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

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)
          Lays out the specified container using this layout.
 Dimension minimumLayoutSize(Container parent)
          Determines the minimum size of the container argument using this grid layout.
 Dimension preferredLayoutSize(Container parent)
          Determines the preferred size of the container argument using this grid layout.
 
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.1

GridLayout2

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

Parameters:
rows - Number of rows, with the value zero meaning any number of rows.
cols - Number of columns, with the value zero meaning any number of columns.
Since:
v0.1

GridLayout2

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

Parameters:
rows - Number of rows, with the value zero meaning any number of rows.
cols - Number of columns, with the value zero meaning any number of columns.
hgap - Horizontal gap.
vgap - Vertical gap.
Since:
v0.1
Method Detail

layoutContainer

public void layoutContainer(Container parent)
Lays out the specified container using this layout.

Specified by:
layoutContainer in interface LayoutManager
Overrides:
layoutContainer in class GridLayout
Parameters:
parent - The container in which to do the layout.
Since:
v0.1

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Determines the minimum size of the container argument using this grid layout.

Specified by:
minimumLayoutSize in interface LayoutManager
Overrides:
minimumLayoutSize in class GridLayout
Parameters:
parent - The container in which to do the layout.
Since:
v0.1

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using this grid layout.

Specified by:
preferredLayoutSize in interface LayoutManager
Overrides:
preferredLayoutSize in class GridLayout
Parameters:
parent - The container in which to do the layout.
Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02