All Packages Class Hierarchy This Package Previous Next Index
Class jclass.contrib.JCRowColLayout
java.lang.Object
|
+----jclass.contrib.JCRowColLayout
- public class JCRowColLayout
- extends Object
- implements LayoutManager
JCRowColLayout is an improved version of Java's AWT GridLayout. It implements
the LayoutManager interface, and lays out a grid of rows and columns based
on the attributes of the individual rows and columns. Whereas GridLayout
uses the widest and tallest child to size each cell, JCRowColLayout uses
the widest element in a column to set the width of that column, and the
tallest element in a row to set the height of that row.
Constructing a JCRowColLayout with a negative number of rows or columns
tells JCRowColLayout that the number of rows or columns is variable, and
the other item is fixed.

JCRowColLayout(int,
int)
- A simple constructor with no "gap" information.
JCRowColLayout(int,
int, int, int)
- A constructor that includes "gap" information.

addLayoutComponent(String,
Component)
- An empty method that must appear (it is part of the LayoutManager interface).
layoutContainer(Container)
- Performs the layout of the children.
minimumLayoutSize(Container)
- Calculates the minimum size for this layout.
preferredLayoutSize(Container)
- Calculates the preferred size for this layout.
removeLayoutComponent(Component)
- An empty method that must appear (it is part of the LayoutManager interface).

JCRowColLayout
public JCRowColLayout(int rows,
int cols)
- A simple constructor with no "gap" information. By default
the gap between items is set to 0.
- Parameters:
- rows - the number of rows in the layout
- cols - the number of columns in the layout
JCRowColLayout
public JCRowColLayout(int rows,
int cols,
int hgap,
int vgap)
- A constructor that includes "gap" information.
- Parameters:
- rows - the number of rows in the layout
- cols - the number of columns in the layout
- hgap - the horizontal gap between items
- vgap - the vertical gap between items

addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- An empty method that must appear (it is part of the LayoutManager interface).
It do not do anything.
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- An empty method that must appear (it is part of the LayoutManager interface).
It does not do anything.
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- Calculates the preferred size for this layout. It is part of the LayoutManager
interface.
- Parameters:
- parent - the parent of this layout
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Calculates the minimum size for this layout. It is part of the LayoutManager
interface.
- Parameters:
- parent - the parent of this layout.
layoutContainer
public void layoutContainer(Container parent)
- Performs the layout of the children. It is part of the LayoutManager
interface. It calculates the number of actual rows and columns based on
the user's settings, retrieves row height and column width information,
then moves all the children to the appropriate places.
- Parameters:
- parent - the parent of this layout.
All Packages Class Hierarchy This Package Previous Next Index