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.


Constructor Index

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

Method Index

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

Constructors

 o 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 colums in the layout
 o 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

Methods

 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
An empty method that must appear (it is part of the LayoutManager interface). It does not do anything.

 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
An empty method that must appear (it is part of the LayoutManager interface). It does not do anything.

 o 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
 o 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
 o 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