uk.co.ist.mwt
Class MarginLayoutManager

java.lang.Object
  |
  +--uk.co.ist.mwt.MarginLayoutManager
Direct Known Subclasses:
DlogTemplateLayout, DrawingAreaLayout, FormLayoutManager, FrameLayoutManager, PanedWindowLayout, RowColLayout, SelectionBoxLayout

public abstract class MarginLayoutManager
extends java.lang.Object
implements java.awt.LayoutManager, java.io.Serializable

Most of the Motif emulation layout managers have various properties in common; these are inherited from MarginLayoutManager

See Also:
Serialized Form

Field Summary
protected  int marginHeight
          The minimum spacing in pixels between the top of the parent Container and the top of the child component nearest the top when the Container is its preferred size
protected  int marginWidth
          The minimum spacing in pixels between the left of the parent Container and the rightmost side of the rightmost child component when the Container is its preferred size
 
Constructor Summary
MarginLayoutManager()
           
 
Method Summary
abstract  void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Add a component to the layout manager's records.
 int getMarginHeight()
          Get accessor for the margin height attribute
 int getMarginWidth()
          Get accessor for the margin width attribute
abstract  void layoutContainer(java.awt.Container parent)
          Lays out the container.
abstract  java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Method to find the minimum size of the parent container with this layout
abstract  java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Method to find the preferred size of the parent container with this layout
abstract  void removeLayoutComponent(java.awt.Component comp)
          Remove a component from the layout manager's records.
 void setMarginHeight(int height)
          Set accessor for the margin height attribute
 void setMarginWidth(int width)
          Set accessor for the margin width attribute
protected  java.awt.Dimension sizeOfComponent(java.awt.Component c, boolean minimum)
          Calculates how large a component wants to be.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marginWidth

protected int marginWidth
The minimum spacing in pixels between the left of the parent Container and the rightmost side of the rightmost child component when the Container is its preferred size

marginHeight

protected int marginHeight
The minimum spacing in pixels between the top of the parent Container and the top of the child component nearest the top when the Container is its preferred size
Constructor Detail

MarginLayoutManager

public MarginLayoutManager()
Method Detail

setMarginWidth

public void setMarginWidth(int width)
Set accessor for the margin width attribute
Parameters:
width - the new margin width
See Also:
getMarginWidth(), getMarginHeight(), setMarginHeight(int)

getMarginWidth

public int getMarginWidth()
Get accessor for the margin width attribute
Returns:
the current margin width
See Also:
setMarginWidth(int), getMarginHeight(), setMarginHeight(int)

setMarginHeight

public void setMarginHeight(int height)
Set accessor for the margin height attribute
Parameters:
height - the new margin height
See Also:
getMarginHeight(), getMarginWidth(), setMarginWidth(int)

getMarginHeight

public int getMarginHeight()
Get accessor for the margin height attribute
Returns:
the current margin height
See Also:
setMarginHeight(int), getMarginWidth(), setMarginWidth(int)

layoutContainer

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

minimumLayoutSize

public abstract java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Method to find the minimum size of the parent container with this layout
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
preferredLayoutSize(java.awt.Container)

preferredLayoutSize

public abstract java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Method to find the preferred size of the parent container with this layout
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
minimumLayoutSize(java.awt.Container)

removeLayoutComponent

public abstract void removeLayoutComponent(java.awt.Component comp)
Remove a component from the layout manager's records.
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - would be the component to remove.
See Also:
addLayoutComponent(java.lang.String, java.awt.Component)

addLayoutComponent

public abstract void addLayoutComponent(java.lang.String name,
                                        java.awt.Component comp)
Add a component to the layout manager's records.
Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - would be the component to add.
name - would be the name with which to add the component.
See Also:
removeLayoutComponent(java.awt.Component)

sizeOfComponent

protected java.awt.Dimension sizeOfComponent(java.awt.Component c,
                                             boolean minimum)
Calculates how large a component wants to be. The minimumLayoutSize method and the preferredLayoutSize method are identical but for the size-finding method called on their children in many of our layout managers; this routine makes it possible to use the same code for both.
Parameters:
c - the component whose size we want
minimum - true if the minimum size is wanted; false if preferred size is wanted
Returns:
the desired size