gui.layouts
Class PreferredSizeGridLayout

java.lang.Object
  extended by java.awt.GridLayout
      extended by gui.layouts.PreferredSizeGridLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable

public class PreferredSizeGridLayout
extends java.awt.GridLayout

See Also:
Serialized Form

Constructor Summary
PreferredSizeGridLayout()
           
PreferredSizeGridLayout(int rows, int cols)
          Creates a grid layout with the specified number of rows and columns.
PreferredSizeGridLayout(int rows, int cols, int hgap, int vgap)
          Creates a grid layout with the specified number of rows and columns.
 
Method Summary
 BoundableInterface getBoundableInterface()
           
 void layoutContainer(java.awt.Container parent)
          Lays out the specified container using this layout.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
           
 void setBoundableInterface(BoundableInterface boundableInterface)
           
 
Methods inherited from class java.awt.GridLayout
addLayoutComponent, getColumns, getHgap, getRows, getVgap, minimumLayoutSize, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PreferredSizeGridLayout

public PreferredSizeGridLayout()

PreferredSizeGridLayout

public PreferredSizeGridLayout(int rows,
                               int cols)
Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

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

PreferredSizeGridLayout

public PreferredSizeGridLayout(int rows,
                               int cols,
                               int hgap,
                               int vgap)
Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

In addition, the horizontal and vertical gaps are set to the specified values. Horizontal gaps are placed affineTransform the left and right edges, and between each of the columns. Vertical gaps are placed affineTransform the top and bottom edges, and between each of the rows.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

Parameters:
rows - the rows, with the value zero meaning any number of rows.
cols - the columns, with the value zero meaning any number of columns.
hgap - the horizontal gap.
vgap - the vertical gap.
Throws:
java.lang.IllegalArgumentException - if the of rows or cols is invalid.
Method Detail

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Overrides:
preferredLayoutSize in class java.awt.GridLayout

layoutContainer

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

This method reshapes the components in the specified target container in order to satisfy the constraints of the PreferredSizeGridLayout object.

The grid layout manager determines the size of individual components by dividing the free space in the container into equal-sized portions according to the number of rows and columns in the layout. The container's free space equals the container's size minus any insets and any specified horizontal or vertical gap. All components in a grid layout are given the Minimum of the same size or the preferred size.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Overrides:
layoutContainer in class java.awt.GridLayout
See Also:
Container, Container.doLayout()

getBoundableInterface

public BoundableInterface getBoundableInterface()

setBoundableInterface

public void setBoundableInterface(BoundableInterface boundableInterface)