[.home.]
[.hacks.]
[.java.]

Class ColumnLayout

java.lang.Object
  |
  +--ColumnLayout
All Implemented Interfaces:
java.awt.LayoutManager

public class ColumnLayout
extends java.lang.Object
implements java.awt.LayoutManager

(#)ColumnLayout.java

Version:
3.2 19-Mar-2004

Implements a ColumnLayout for gui items which is very useful for forms. Has the ability to expand specific rows/cols.
Author:
Holger Pfaff

Field Summary
static int ALL
          expand horz and vert
protected  int cellexpn
          Should we expand each cell to fit exactly (as in GridLayout) ?
protected  java.awt.Insets cellinset
          The border around each cell
protected  int cellpos
          where should the component be psoitioned within each cell ?
static int CENTER
          Center position
protected  int columns
          no of colums
static int E
          East position
static int HORZ
          expand horz
static int N
          North position
static int NE
          NorthEast position
static int NONE
          do not expand or no rubbercol/row
static int NW
          NorthWest position
protected  int rubbercolumn
          which col to expand if parent larger than preferred size
protected  int rubberrow
          which row to expand if parent larger than preferred size.
static int S
          South position
static int SE
          SouthEast position
static int SW
          SouthWest position
static int VERT
          expand vert
static int W
          West position
 
Constructor Summary
ColumnLayout(int columns, int cellexpn, int cellpos, int rubbercolumn, int rubberrow)
          Creates a column layout with default insets
ColumnLayout(int columns, int cellexpn, int cellpos, int rubbercolumn, int rubberrow, java.awt.Insets cellinset)
          Creates a column layout
 
Method Summary
 void addLayoutComponent(java.lang.String s, java.awt.Component c)
          Just here to satisfy the interface.
 void layoutContainer(java.awt.Container C)
          Position the children.
 java.awt.Dimension minimumLayoutSize(java.awt.Container C)
          Calculate the minimum layout size.
 java.awt.Dimension preferredLayoutSize(java.awt.Container C)
          Calculate the preferred layout size.
 void removeLayoutComponent(java.awt.Component c)
          Just here to satisfy the interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
do not expand or no rubbercol/row

See Also:
Constant Field Values

ALL

public static final int ALL
expand horz and vert

See Also:
Constant Field Values

HORZ

public static final int HORZ
expand horz

See Also:
Constant Field Values

VERT

public static final int VERT
expand vert

See Also:
Constant Field Values

cellinset

protected java.awt.Insets cellinset
The border around each cell


N

public static final int N
North position

See Also:
Constant Field Values

E

public static final int E
East position

See Also:
Constant Field Values

S

public static final int S
South position

See Also:
Constant Field Values

W

public static final int W
West position

See Also:
Constant Field Values

NW

public static final int NW
NorthWest position

See Also:
Constant Field Values

SW

public static final int SW
SouthWest position

See Also:
Constant Field Values

NE

public static final int NE
NorthEast position

See Also:
Constant Field Values

SE

public static final int SE
SouthEast position

See Also:
Constant Field Values

CENTER

public static final int CENTER
Center position

See Also:
Constant Field Values

cellpos

protected int cellpos
where should the component be psoitioned within each cell ?


cellexpn

protected int cellexpn
Should we expand each cell to fit exactly (as in GridLayout) ?


rubbercolumn

protected int rubbercolumn
which col to expand if parent larger than preferred size


rubberrow

protected int rubberrow
which row to expand if parent larger than preferred size.


columns

protected int columns
no of colums

Constructor Detail

ColumnLayout

public ColumnLayout(int columns,
                    int cellexpn,
                    int cellpos,
                    int rubbercolumn,
                    int rubberrow)
Creates a column layout with default insets

Parameters:
columns - the number of columns
cellexpn - expand the component within cell (NONE, ALL, HORZ, VERT)
cellpos - position of component within cell (NW, N, NE, E, SE, S, SW, W, C)
rubbercolumn - specify column to expand if parent larger as needed (NONE, ALL, )
rubberrow - specify row to expand if parent larger as needed (NONE, ALL, )

ColumnLayout

public ColumnLayout(int columns,
                    int cellexpn,
                    int cellpos,
                    int rubbercolumn,
                    int rubberrow,
                    java.awt.Insets cellinset)
Creates a column layout

Parameters:
columns - the number of columns
cellexpn - expand the component within cell (NONE, ALL, HORZ, VERT)
cellpos - position of component within cell (NW, N, NE, E, SE, S, SW, W, C)
rubbercolumn - specify column to expand if parent larger as needed (NONE, ALL, )
rubberrow - specify row to expand if parent larger as needed (NONE, ALL, )
cellinset - the border within each cell
Method Detail

layoutContainer

public void layoutContainer(java.awt.Container C)
Position the children. Overridden from LayoutManager

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
C - the parent container

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container C)
Calculate the minimum layout size. Same as preferredLayoutSize() for this layout. Overridden from LayoutManager

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
C - the parent container

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container C)
Calculate the preferred layout size.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
C - the parent container

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component c)
Just here to satisfy the interface. Overridden from LayoutManager

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
c - component being removed

addLayoutComponent

public void addLayoutComponent(java.lang.String s,
                               java.awt.Component c)
Just here to satisfy the interface. Overridden from LayoutManager

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
s - additional layout info
c - component being added

[.home.]
[.hacks.]
[.java.]