WebObjects 5.2

com.webobjects.eointerface.swing
Class EOViewLayout

java.lang.Object
  |
  +--com.webobjects.eointerface.swing.EOViewLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable

public class EOViewLayout
extends Object
implements LayoutManager2, Serializable

An EOViewLayout is an AWT layout manager which offers "spring" resizing (like Cocoa views). EOViewLayout implements the geometry options available in Interface Builder's Size inspector. The size of a Component embedded in a Container using this layout scheme will be a function of both its autosizing mask and its initial size.

See Also:
Serialized Form

Field Summary
static int BothSizable
          This constant is used to specify that both width and height of a component may be adjusted.
static int HeightSizable
          This constant is used to specify that a component's height may be adjusted.
static int MaxXMargin
          This constant is used to specify that the distance between a component's right edge and that of its parent may be adjusted.
static int MaxYMargin
          This constant is used to specify that the distance between a component's bottom edge and that of its parent may be adjusted.
static int MinXMargin
          This constant is used to specify that the distance between a component's left edge and that of its parent may be adjusted.
static int MinYMargin
          This constant is used to specify that the distance between a component's top edge and that of its parent may be adjusted.
static int WidthSizable
          This constant is used to specify that a component's width may be adjusted.
 
Constructor Summary
EOViewLayout()
          Constructs a new EOViewLayout.
 
Method Summary
 void addLayoutComponent(Component component, Object constraints)
          Registers component with the EOViewLayout.
 void addLayoutComponent(String name, Component component)
          Does nothing.
 int autosizingMask(Component component)
          Returns the autosizing mask of a component layed out by the EOViewLayout.
 float getLayoutAlignmentX(Container container)
          Returns the alingment of the component container along the x axis.
 float getLayoutAlignmentY(Container container)
          Returns the alingment of the component container along the y axis.
 void invalidateLayout(Container container)
          Does nothing.
 Dimension lastKnownSize(Component component)
          Returns the "last known size" of a component layed out by the EOViewLayout.
 void layoutContainer(Container container)
          Lays out the subcomponents of the component container.
 Dimension maximumLayoutSize(Container container)
          Returns the maximum size of the component container.
 Dimension minimumLayoutSize(Container container)
          Returns the minimum size of the component container.
 Dimension preferredLayoutSize(Container container)
          Returns the preferred size of the component container.
 void removeLayoutComponent(Component component)
          Unregisters component from the EOViewLayout.
 void setAutosizingMask(Component component, int autosizingMask)
          Sets the autosizing mask of a component layed out by the EOViewLayout to autosizingMask.
 void setLastKnownSize(Component component, Dimension size)
          Sets the "last known size" of a component layed out by the EOViewLayout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BothSizable

public static final int BothSizable
This constant is used to specify that both width and height of a component may be adjusted.

HeightSizable

public static final int HeightSizable
This constant is used to specify that a component's height may be adjusted.

MaxXMargin

public static final int MaxXMargin
This constant is used to specify that the distance between a component's right edge and that of its parent may be adjusted.

MaxYMargin

public static final int MaxYMargin
This constant is used to specify that the distance between a component's bottom edge and that of its parent may be adjusted.

MinXMargin

public static final int MinXMargin
This constant is used to specify that the distance between a component's left edge and that of its parent may be adjusted.

MinYMargin

public static final int MinYMargin
This constant is used to specify that the distance between a component's top edge and that of its parent may be adjusted.

WidthSizable

public static final int WidthSizable
This constant is used to specify that a component's width may be adjusted.
Constructor Detail

EOViewLayout

public EOViewLayout()
Constructs a new EOViewLayout.
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component component)
Does nothing.
Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name -  
component -  

addLayoutComponent

public void addLayoutComponent(Component component,
                               Object constraints)
Registers component with the EOViewLayout. constraints should be an Integer object representing the autosizing mask for component.
Specified by:
addLayoutComponent in interface LayoutManager2
Parameters:
component - the component
constraints - an Integer representing the autosizing mask for the component

autosizingMask

public int autosizingMask(Component component)
Returns the autosizing mask of a component layed out by the EOViewLayout. The mask is some bitwise combination of the following constants: MaxXMargin, MinXMargin, MaxYMargin, MinYMargin, WidthSizable, HeightSizable, and BothSizable.
Parameters:
component - the component
Returns:
the autosizing mask of the component
See Also:
MaxXMargin, MinXMargin, MaxYMargin, MinYMargin, WidthSizable, HeightSizable, BothSizable

getLayoutAlignmentX

public float getLayoutAlignmentX(Container container)
Returns the alingment of the component container along the x axis.
Specified by:
getLayoutAlignmentX in interface LayoutManager2
Parameters:
container - the component
Returns:
the alignment

getLayoutAlignmentY

public float getLayoutAlignmentY(Container container)
Returns the alingment of the component container along the y axis.
Specified by:
getLayoutAlignmentY in interface LayoutManager2
Parameters:
container - the component
Returns:
the alignment

invalidateLayout

public void invalidateLayout(Container container)
Does nothing.
Specified by:
invalidateLayout in interface LayoutManager2
Parameters:
container -  

lastKnownSize

public Dimension lastKnownSize(Component component)
Returns the "last known size" of a component layed out by the EOViewLayout. This size is the basis for the size adjustment of the component next time the component's parent is resized.
Parameters:
component - the component
Returns:
the last known size of the comonent

layoutContainer

public void layoutContainer(Container container)
Lays out the subcomponents of the component container. Adjusts the locations and sizes of the subcomponents according to the autosizing masks registered for them.
Specified by:
layoutContainer in interface LayoutManager
Parameters:
container - the component to lay out

maximumLayoutSize

public Dimension maximumLayoutSize(Container container)
Returns the maximum size of the component container.
Specified by:
maximumLayoutSize in interface LayoutManager2
Parameters:
container - the component
Returns:
the maximum size

minimumLayoutSize

public Dimension minimumLayoutSize(Container container)
Returns the minimum size of the component container.
Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
container - the component
Returns:
the minimum size

preferredLayoutSize

public Dimension preferredLayoutSize(Container container)
Returns the preferred size of the component container.
Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
container - the component
Returns:
the preferred size

removeLayoutComponent

public void removeLayoutComponent(Component component)
Unregisters component from the EOViewLayout.
Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
component - the component

setAutosizingMask

public void setAutosizingMask(Component component,
                              int autosizingMask)
Sets the autosizing mask of a component layed out by the EOViewLayout to autosizingMask. This information is subsequently used by the receiver to calculate the new location and dimensions of component whenever its parent is resized. The mask should be some bitwise combination of the following constants: MaxXMargin, MinXMargin, MaxYMargin, MinYMargin, WidthSizable, HeightSizable, and BothSizable.
Parameters:
component - the component
autosizingMask - the autosizing mask of the component
See Also:
MaxXMargin, MinXMargin, MaxYMargin, MinYMargin, WidthSizable, HeightSizable, BothSizable

setLastKnownSize

public void setLastKnownSize(Component component,
                             Dimension size)
Sets the "last known size" of a component layed out by the EOViewLayout. This size is the basis for the size adjustment of the component next time the component's parent is resized. You can use this method to explicitly register new dimensions of a component with the layout manager. This might be necessary for example if you change the location and dimension of components programmatically, without relying on the EOViewLayout.
Parameters:
component - the component
size - the last known size of the comonent

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.