jpl.mipl.jade.jadis
Class StereoLayout

java.lang.Object
  extended by javax.swing.OverlayLayout
      extended by jpl.mipl.jade.jadis.StereoLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable

public class StereoLayout
extends OverlayLayout

A layout manager that manages two children as "left" and "right" views. It extends Swing's OverlayLayout which allows multiple children to be displayed simultaneously. Users don't directly instantiate this class. Used by StereoJPanel.

See Also:
OverlayLayout, StereoJPanel, Serialized Form

Field Summary
static String BOTH
          Constant to specify components location to be the only view or both of Stereo Layout.
static String LEFT
          Constant to specify components location to be the left view of Stereo Layout.
static String RIGHT
          Constant to specify components location to be the right view of Stereo Layout.
 
Constructor Summary
StereoLayout(Container target)
          Default constructor, just calls superclass.
 
Method Summary
 void addLayoutComponent(Component comp, Object constraints)
          Adds the specified component to the layout, using the specified constraint object.
 void addLayoutComponent(String name, Component comp)
          Deprecated. replaced by addLayoutComponent(Component, Object).
 Object getConstraints(Component comp)
          Gets the constraints for the specified component
 Component getLayoutComponent(Container target, Object constraints)
          Gets the component that corresponds to the given constraint location based on the target Container's component orientation
 void removeLayoutComponent(Component comp)
          Removes the specified component from the layout.
 String toString()
          Returns a string representation of the state of this stack layout.
 
Methods inherited from class javax.swing.OverlayLayout
getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, layoutContainer, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final String LEFT
Constant to specify components location to be the left view of Stereo Layout.

See Also:
Constant Field Values

RIGHT

public static final String RIGHT
Constant to specify components location to be the right view of Stereo Layout.

See Also:
Constant Field Values

BOTH

public static final String BOTH
Constant to specify components location to be the only view or both of Stereo Layout.

See Also:
Constant Field Values
Constructor Detail

StereoLayout

public StereoLayout(Container target)
Default constructor, just calls superclass.

Parameters:
target - Container
Method Detail

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
Adds the specified component to the layout, using the specified constraint object. For Stereo layouts, the constraint must be one of the following constants: LEFT, RIGHT, BOTH

This method This method is called when a component is added to a container using the Container.add method with the same argument types.

Specified by:
addLayoutComponent in interface LayoutManager2
Overrides:
addLayoutComponent in class OverlayLayout
Parameters:
comp - the component to be added.
constraints - an object that specifies how and where the component is added to the layout.
Throws:
IllegalArgumentException - if the constraint object is not a string, or if it not one of the five specified constants.
Since:
JDK1.1
See Also:
Container.add(java.awt.Component, java.lang.Object)

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Deprecated. replaced by addLayoutComponent(Component, Object).

Specified by:
addLayoutComponent in interface LayoutManager
Overrides:
addLayoutComponent in class OverlayLayout

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface LayoutManager
Overrides:
removeLayoutComponent in class OverlayLayout
Parameters:
comp - the component to be removed.
See Also:
Container.remove(java.awt.Component), Container.removeAll()

getLayoutComponent

public Component getLayoutComponent(Container target,
                                    Object constraints)
Gets the component that corresponds to the given constraint location based on the target Container's component orientation

Parameters:
constraints - the desired absolute position, one of MONO, one of LEFT, RIGHT,
target - the Container using this BorderLayout
Returns:
the component at the given location, or null if the location is empty
Throws:
IllegalArgumentException - if the constraint object is not one of the five specified constants
NullPointerException - if the target parameter is null
Since:
1.5
See Also:
addLayoutComponent(java.awt.Component, java.lang.Object)

getConstraints

public Object getConstraints(Component comp)
Gets the constraints for the specified component

Parameters:
comp - the component to be queried
Returns:
the constraint for the specified component, or null if component is null or is not present in this layout
Since:
1.5
See Also:
addLayoutComponent(java.awt.Component, java.lang.Object)

toString

public String toString()
Returns a string representation of the state of this stack layout.

Overrides:
toString in class Object
Returns:
a string representation of this layout.