org.PingOO.DLAI.lib.PWidget
Class FormColumnLayout
java.lang.Object
|
+--org.PingOO.DLAI.lib.PWidget.FormColumnLayout
- Direct Known Subclasses:
- FormLayout.ColumnLeader
- class FormColumnLayout
- extends java.lang.Object
An abstract layout manager to set the vertical position and height of a set of components based on unique, ordered, non-sequential column numbers, layout size, and component minimum and preferred sizes.
Basic Design:
Each FormColumnLayout is responsible for a single column of components, which may be in the form of label/field pairs, or single components spanning the entire column.
Each component or pair of components is stored in a SegmentLayout.
Columns are linked together by their SegmentLayouts' links to other Columns' SegmentLayouts.
Each Column calculates its minimum and preferred locations as the maximum of its Segments' minimum and preferred locations.
FormColumnLayout sets its actual location on the basis of a percentage distance from its minimum location to its preferred location; the percentage is calculated by ColumnLeader (see FormLayout inner class).
- Since:
- PingOO 2.0
- Version:
- 2.0
- Author:
- Byron Hawkins (bhawkins@oz.net), Fabrice Bouyé (bouye@cur-archamps.fr)
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
m_minLocation
protected int m_minLocation
m_prefLocation
protected int m_prefLocation
m_currLocation
protected int m_currLocation
- Last layed out position.
m_labelWidth
private int m_labelWidth
m_columnIndex
private int m_columnIndex
m_containingLayout
protected FormLayout m_containingLayout
m_segments
protected FormLayout.ExtendedVector m_segments
- SegmentLayout
FormColumnLayout
public FormColumnLayout(int index,
FormLayout containingLayout)
addSegment
private FormColumnLayout.SegmentLayout addSegment(int segmentIndex)
findMinimumLocation
protected void findMinimumLocation()
- Max of segments' min locations.
findPreferredLocation
protected void findPreferredLocation()
- max of segments' pref locations.
findIntermediateLocation
protected void findIntermediateLocation(double pct)
- "pct" of the way from min to pref location findMinimumLocation() and findPreferredLocation() are not called here, because they are recursive and lengthy; these are called by ColumnLeader in preparation for the call to this method.
setMinimumLocation
protected void setMinimumLocation(int minLoc)
- Hook for subclasses that behave differently here.
setPreferredLocation
protected void setPreferredLocation(int prefLoc)
- Hook for subclasses that behave differently here.
doLayout
protected void doLayout()
getMinimumLocation
public int getMinimumLocation()
getPreferredLocation
public int getPreferredLocation()
getCurrentLocation
private int getCurrentLocation()
getIndex
public int getIndex()
calculateLabelWidth
private void calculateLabelWidth()