Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class uk.co.ist.mwt.FormLayoutManager

java.lang.Object
  |
  +--uk.co.ist.mwt.MarginLayoutManager
        |
        +--uk.co.ist.mwt.FormLayoutManager

public class FormLayoutManager
extends MarginLayoutManager
implements uk.co.ist.mwt.FormConstants
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...

See Also:
Serialized Form

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
int getFractionBase()
          Accessor for the fraction base (the denominator in the fraction for which position values are the numerator)
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
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.
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
addLayoutComponent, getMarginHeight, getMarginWidth, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setMarginHeight, setMarginWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

FormLayoutManager

public FormLayoutManager()
Constructor - sets up appropriate defaults
Method Detail

setFractionBase

public void setFractionBase(int fb)
Method to set the fraction base (the denominator in the fraction for which position values are the numerator)
Parameters:
fb - the new fraction base

getFractionBase

public int getFractionBase()
Accessor for the fraction base (the denominator in the fraction for which position values are the numerator)

constrain

public void constrain(java.awt.Component child,
                      FormLayoutConstraints constr)
Method to set the constraints on a particular child component
Parameters:
child - the child component
constr - the constraints to give it, or null for default constraints

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the container.
Parameters:
parent - the component which needs to be laid out
Overrides:
layoutContainer in class MarginLayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Method to find the minimum size of the parent container with this layout
Parameters:
parent - the component to be laid out
Returns:
the minimum size
Overrides:
minimumLayoutSize in class MarginLayoutManager
See Also:
preferredLayoutSize

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Method to find the preferred size of the parent container with this layout.
Parameters:
parent - the component to be laid out
Returns:
the preferred size
Overrides:
preferredLayoutSize in class MarginLayoutManager
See Also:
minimumLayoutSize

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Remove a component from the layout manager's records. This is used to keep the record of each Component's constraints from storing constraints for components which have been removed from the parent Container.
Parameters:
comp - the component to remove.
Overrides:
removeLayoutComponent in class MarginLayoutManager
See Also:
addLayoutComponent

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Add a component to the layout manager's records. Bot used for this layout manager.
Parameters:
comp - would be the component to add.
name - would be the name with which to add the component.
Overrides:
addLayoutComponent in class MarginLayoutManager
See Also:
removeLayoutComponent

Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD