org.PingOO.DLAI.lib.PWidget
Class LabeledPairLayout

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.PWidget.LabeledPairLayout

public final class LabeledPairLayout
extends java.lang.Object
implements java.awt.LayoutManager

Defines a layout for a component pair.
Eg : (label) (textfield)
Taken and adapted from the JDK demo Metalworks.

Since:
PingOO 2.0
Version:
1.5 08/26/98
Author:
Steve Wilson, Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
LayoutManager

Field Summary
private  java.util.Vector fields
          The vector that contains the primary column components.
private  java.util.Vector labels
          The vector that contains the primary column components.
static java.lang.String LEFT_COMPONENT
          Defines the components (labels) to be included on the left side.
static java.lang.String RIGHT_COMPONENT
          Defines the components (fields) to be included on the right side.
 
Constructor Summary
LabeledPairLayout()
          Creates a new labeled pair layout instance.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
 void layoutContainer(java.awt.Container parent)
          Lays out the container in the specified panel.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component from the layout.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

LEFT_COMPONENT

public static final java.lang.String LEFT_COMPONENT
Defines the components (labels) to be included on the left side.

RIGHT_COMPONENT

public static final java.lang.String RIGHT_COMPONENT
Defines the components (fields) to be included on the right side.

labels

private final java.util.Vector labels
The vector that contains the primary column components.

fields

private java.util.Vector fields
The vector that contains the primary column components.
Constructor Detail

LabeledPairLayout

public LabeledPairLayout()
Creates a new labeled pair layout instance.
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the specified component with the specified name to the layout.
Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - The component name.
comp - The component to be added.

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the container in the specified panel.
Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - The component which needs to be laid out

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - The component to be laid out.

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - The component to be laid out

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout.
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - The component to be removed.