cds.gui
Class CColumnLayout

java.lang.Object
  extended bycds.gui.CColumnLayout
All Implemented Interfaces:
java.awt.LayoutManager

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

Column Layout. Displays components columnwise in four different modes: LEFT or RIGHT adjusted, CENTERed or JUSTIFIED on the whole width. The gap between two components can be adjusted.

Version:
1.0 July 2003
Author:
Marc Wenger/CDS

Field Summary
static int CENTER
           
static int JUSTIFY
           
static int LEFT
           
private  int minHeight
           
private  int minWidth
           
private  int preferredHeight
           
private  int preferredWidth
           
static int RIGHT
           
private  boolean sizeUnknown
           
private  int type
           
private  int vgap
           
 
Constructor Summary
CColumnLayout()
          Default constructor.
CColumnLayout(int type)
          Constructor specifying the alignement type
CColumnLayout(int type, int vgap)
          Constructor fully specified
 
Method Summary
private  void addInsets(java.awt.Dimension dim, java.awt.Container c)
          utility routine adding the container insets to the given dimension
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 void layoutContainer(java.awt.Container parent)
          This method is called when the panel is first displayed, and every time its size changes.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Compute the minimum size of the container
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Compute the preferred size of all the components in the container This method is called by the doLayout() method
 void removeLayoutComponent(java.awt.Component comp)
           
 java.lang.String toString()
          Displays the CColumnLayout object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

JUSTIFY

public static final int JUSTIFY
See Also:
Constant Field Values

type

private int type

vgap

private int vgap

minWidth

private int minWidth

minHeight

private int minHeight

preferredWidth

private int preferredWidth

preferredHeight

private int preferredHeight

sizeUnknown

private boolean sizeUnknown
Constructor Detail

CColumnLayout

public CColumnLayout()
Default constructor. Displays the components left aligned.


CColumnLayout

public CColumnLayout(int type)
Constructor specifying the alignement type

Parameters:
type - alignement type: CColumnLayout.LEFT, .RIGHT, .CENTER, .JUSTIFY

CColumnLayout

public CColumnLayout(int type,
                     int vgap)
Constructor fully specified

Parameters:
type - alignement type: CColumnLayout.LEFT, .RIGHT, .CENTER, .JUSTIFY
vgap - vertical gap to insert between components
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Compute the preferred size of all the components in the container This method is called by the doLayout() method

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - container defined with this layout
Returns:
the container preferred Dimension object

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Compute the minimum size of the container

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - container defined with this layout
Returns:
the container preferred Dimension object

layoutContainer

public void layoutContainer(java.awt.Container parent)
This method is called when the panel is first displayed, and every time its size changes.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - container having this layout specified and which should be layed out.

addInsets

private void addInsets(java.awt.Dimension dim,
                       java.awt.Container c)
utility routine adding the container insets to the given dimension

Parameters:
dim - dimension to increment (Dimension are mutable objects)
c - container from which the inserts are added to the dimension

toString

public java.lang.String toString()
Displays the CColumnLayout object

Returns:
the string showing the layout parameters