com.objectwave.tools.propertyEditor
Class AbstractLayout

java.lang.Object
  |
  +--com.objectwave.tools.propertyEditor.AbstractLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable
Direct Known Subclasses:
DeckLayout, FieldLayout

public abstract class AbstractLayout
extends java.lang.Object
implements java.awt.LayoutManager2, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  int hgap
           
protected  int vgap
           
 
Constructor Summary
AbstractLayout()
           
AbstractLayout(int hgap, int vgap)
           
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
          Add the specified component from the layout.
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
 int getHgap()
          Get the horizontal gap between components.
 float getLayoutAlignmentX(java.awt.Container parent)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY(java.awt.Container parent)
          Returns the alignment along the y axis.
 int getVgap()
          Get the vertical gap between components.
 void invalidateLayout(java.awt.Container target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
          Returns the maximum dimensions for this layout given the component in the specified target container.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component from the layout.
 void setHgap(int gap)
          Set the horizontal gap between components.
 void setVgap(int gap)
          Set the vertical gap between components.
 java.lang.String toString()
          Return a string representation of the layout manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.LayoutManager
layoutContainer, minimumLayoutSize, preferredLayoutSize
 

Field Detail

hgap

protected int hgap

vgap

protected int vgap
Constructor Detail

AbstractLayout

public AbstractLayout()

AbstractLayout

public AbstractLayout(int hgap,
                      int vgap)
Method Detail

addLayoutComponent

public void addLayoutComponent(java.awt.Component comp,
                               java.lang.Object constraints)
Add the specified component from the layout. By default, we let the Container handle this directly.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager2
Parameters:
comp - The component to be added
constraints - The constraints to apply when laying out.

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the specified component with the specified name to the layout. By default, we call the more recent addLayoutComponent method with an object constraint argument. The name is passed through directly.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - The name of the component
comp - The component to be added

getHgap

public int getHgap()
Get the horizontal gap between components.


getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container parent)
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container parent)
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2

getVgap

public int getVgap()
Get the vertical gap between components.


invalidateLayout

public void invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Specified by:
invalidateLayout in interface java.awt.LayoutManager2

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions for this layout given the component in the specified target container.

Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2
Parameters:
target - The component which needs to be laid out

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. By default, we let the Container handle this directly.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - the component to be removed

setHgap

public void setHgap(int gap)
Set the horizontal gap between components.

Parameters:
gap - The horizontal gap to be set

setVgap

public void setVgap(int gap)
Set the vertical gap between components.

Parameters:
gap - The vertical gap to be set

toString

public java.lang.String toString()
Return a string representation of the layout manager

Overrides:
toString in class java.lang.Object