|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.co.ist.mwt.MarginLayoutManager | +--uk.co.ist.mwt.FormLayoutManager
FormLayoutManagers are used to mimic the Motif XmForm widget. A detailed description of the workings of this widget would require more space than is available here. Basically, you need to constrain each child of the Container whose LayoutManager this is, using the constrain method, and then the resize behaviour will be appropriate.
To find out what 'appropriate' means, consult a good book on Motif...
Field Summary | |
protected uk.co.ist.mwt.FormLayoutGraphNode |
formBottom
The FormLayoutGraphNode representing the bottom of the form |
protected uk.co.ist.mwt.FormLayoutGraphNode |
formLeft
The FormLayoutGraphNode representing the left of the form |
protected uk.co.ist.mwt.FormLayoutGraphNode |
formRight
The FormLayoutGraphNode representing the right of the form |
protected uk.co.ist.mwt.FormLayoutGraphNode |
formTop
The FormLayoutGraphNode representing the top of the form |
Fields inherited from class uk.co.ist.mwt.MarginLayoutManager |
marginHeight,
marginWidth |
Fields inherited from interface uk.co.ist.mwt.FormConstants |
kAttachComponent,
kAttachForm,
kAttachNone,
kAttachOppositeComponent,
kAttachOppositeForm,
kAttachPosition,
kAttachSelf,
kUnknown |
Constructor Summary | |
FormLayoutManager()
Constructor - sets up appropriate defaults |
Method Summary | |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Add a component to the layout manager's records. |
void |
constrain(java.awt.Component child,
FormLayoutConstraints constr)
Method to set the constraints on a particular child component |
protected void |
convertSelfAttachments(java.awt.Rectangle bounds,
FormLayoutConstraints constr,
java.awt.Dimension parentSize)
Converts self attachments to position attachments when they are found. |
int |
getFractionBase()
Accessor for the fraction base (the denominator in the fraction for which position values are the numerator) |
protected java.awt.Dimension |
guessPreferredSize(java.util.Vector nodes)
Method to guess the preferred size of the form; when calculating the preferred size we use this for a first guess, then try to get something better through successive approximation. |
protected java.util.Vector |
initialiseGraph(java.awt.Component[] children,
java.awt.Dimension parentSize)
Method to set up the graph of FormLayoutGraphNodes needed for laying out and calculating the preferred size of a container using this layout manager |
void |
layoutContainer(java.awt.Container parent)
Lays out the container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Method to find the minimum size of the parent container with this layout |
protected void |
placeGraphNodes(java.util.Vector nodes)
Set the graph nodes position settings so that they reflect the positions in which the components should go. |
protected void |
positionComponents(java.util.Vector nodes)
Position the children of the container in the positions their graph nodes say they should be in. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Method to find the preferred size of the parent container with this layout. |
void |
removeLayoutComponent(java.awt.Component comp)
Remove a component from the layout manager's records. |
protected void |
setFormNodes(java.awt.Dimension parentSize)
Method to set up the graph nodes which represent the sides of the form |
void |
setFractionBase(int fb)
Method to set the fraction base (the denominator in the fraction for which position values are the numerator) |
Methods inherited from class uk.co.ist.mwt.MarginLayoutManager |
getMarginHeight,
getMarginWidth,
setMarginHeight,
setMarginWidth,
sizeOfComponent |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected uk.co.ist.mwt.FormLayoutGraphNode formTop
protected uk.co.ist.mwt.FormLayoutGraphNode formBottom
protected uk.co.ist.mwt.FormLayoutGraphNode formLeft
protected uk.co.ist.mwt.FormLayoutGraphNode formRight
Constructor Detail |
public FormLayoutManager()
Method Detail |
public void setFractionBase(int fb)
fb
- the new fraction basepublic int getFractionBase()
public void constrain(java.awt.Component child, FormLayoutConstraints constr)
child
- the child componentconstr
- the constraints to give it, or null for default
constraintspublic void layoutContainer(java.awt.Container parent)
parent
- the component which needs to be laid outprotected void placeGraphNodes(java.util.Vector nodes)
nodes
- a list of nodes to placeprotected void positionComponents(java.util.Vector nodes)
nodes
- a list of nodes to placepublic java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
parent
- the component to be laid outpreferredLayoutSize(java.awt.Container)
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
parent
- the component to be laid outminimumLayoutSize(java.awt.Container)
protected java.awt.Dimension guessPreferredSize(java.util.Vector nodes)
nodes
- the nodes to use during this guessingprotected java.util.Vector initialiseGraph(java.awt.Component[] children, java.awt.Dimension parentSize)
children
- the children of the container we're laying outparentSize
- the container's sizeprotected void setFormNodes(java.awt.Dimension parentSize)
protected void convertSelfAttachments(java.awt.Rectangle bounds, FormLayoutConstraints constr, java.awt.Dimension parentSize)
bounds
- the bounds of the child whose constraints we're
convertingconstr
- the constraints we're converting from using self
attachmentsparentSize
- the size of the parent containerpublic void removeLayoutComponent(java.awt.Component comp)
comp
- the component to remove.addLayoutComponent(java.lang.String, java.awt.Component)
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
comp
- would be the component to add.name
- would be the name with which to add the component.removeLayoutComponent(java.awt.Component)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |