org.PingOO.DLAI.lib.PWidget
Class FormRowLayout

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.PWidget.FormRowLayout
Direct Known Subclasses:
FormLayout.RowLeader

class FormRowLayout
extends java.lang.Object

An abstract layout manager to set the horizontal positions of a set of components based on unique, ordered, non-sequential row numbers, layout size, and component minimum and preferred sizes.

Basic Design:
Each FormRowLayout is responsible for a single row of components.
Each component is stored in a component layout, which performs the actual layout functions.
Rows are linked together in a doubly linked list.
Rows use the same minimum and preferred location floating point scheme as ColumnLayout, except that they will not expand to fill extra space.

Since:
PingOO 2.0
Version:
2.0
Author:
Byron Hawkins (bhawkins@oz.net), Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
PInternalFrame

Inner Class Summary
private  class FormRowLayout.ComponentLayout
           
 
Field Summary
static int ALIGN_BOTTOM
           
static int ALIGN_CENTER
           
static int ALIGN_TOP
           
private  FormLayout.ExtendedVector m_components
          the components in this layout.
(package private)  FormLayout m_containingLayout
           
protected  int m_currLocation
           
private  int m_currSize
           
private  FormRowLayout m_followingRow
          The row above this.
private  int m_index
          row index.
private  int m_justification
          How to position components that are allotted extra space (components will never fill the extra space).
protected  int m_minLocation
           
private  int m_minSize
           
protected  int m_prefLocation
           
private  int m_prefSize
           
private  FormRowLayout m_previousRow
          the row below this.
 
Constructor Summary
FormRowLayout(int index, FormLayout containingLayout)
           
 
Method Summary
 void add(java.awt.Component addMe)
           
 void addFloater(java.awt.Component addMe, int anchorRow)
           
 void doLayout()
           
protected  void findMinimumLocation()
          determine m_minLocation and m_minSize
protected  void findPreferredLocation()
          Determine m_prefLocation and m_prefSize.
 int getIndex()
           
protected  int getMinLowerBoundary()
           
protected  int getPrefLowerBoundary()
           
 FormRowLayout getRow(int row)
          may create the row requested.
protected  int getUpperBoundary()
           
protected  void removeIfEmpty()
          If this has no more components, remove this.
 void removeLayoutComponent(java.awt.Component removeMe)
           
private  void setAnchor(FormRowLayout.ComponentLayout addMe)
           
protected  void setLocation(double pct)
           
protected  void setMinimumLocation(int minLoc)
          Hook for subclasses
protected  void setPreferredLocation(int prefLoc)
          Hook for subclasses.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_components

private FormLayout.ExtendedVector m_components
the components in this layout.

m_previousRow

private FormRowLayout m_previousRow
the row below this.

m_followingRow

private FormRowLayout m_followingRow
The row above this.

m_containingLayout

FormLayout m_containingLayout

m_minLocation

protected int m_minLocation

m_prefLocation

protected int m_prefLocation

m_currLocation

protected int m_currLocation

m_minSize

private int m_minSize

m_prefSize

private int m_prefSize

m_currSize

private int m_currSize

m_justification

private int m_justification
How to position components that are allotted extra space (components will never fill the extra space).

m_index

private int m_index
row index.

ALIGN_TOP

public static final int ALIGN_TOP

ALIGN_CENTER

public static final int ALIGN_CENTER

ALIGN_BOTTOM

public static final int ALIGN_BOTTOM
Constructor Detail

FormRowLayout

public FormRowLayout(int index,
                     FormLayout containingLayout)
Parameters:
index -  
containingLayout -  
Method Detail

getIndex

public int getIndex()

add

public void add(java.awt.Component addMe)

addFloater

public void addFloater(java.awt.Component addMe,
                       int anchorRow)

setAnchor

private void setAnchor(FormRowLayout.ComponentLayout addMe)

getRow

public FormRowLayout getRow(int row)
may create the row requested.

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component removeMe)

removeIfEmpty

protected void removeIfEmpty()
If this has no more components, remove this.

findPreferredLocation

protected void findPreferredLocation()
Determine m_prefLocation and m_prefSize.

findMinimumLocation

protected void findMinimumLocation()
determine m_minLocation and m_minSize

setPreferredLocation

protected void setPreferredLocation(int prefLoc)
Hook for subclasses.

setMinimumLocation

protected void setMinimumLocation(int minLoc)
Hook for subclasses

setLocation

protected void setLocation(double pct)

getPrefLowerBoundary

protected int getPrefLowerBoundary()

getMinLowerBoundary

protected int getMinLowerBoundary()

getUpperBoundary

protected int getUpperBoundary()

doLayout

public void doLayout()