All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.core.IteratorLayout

java.lang.Object
   |
   +----com.sun.wizards.core.IteratorLayout

public class IteratorLayout
extends Object
implements LayoutManager2, Serializable, Runnable
The IteratorLayout is a layout manager for a container. It iterates through a tree of WizardComponents using the tree traversal methods next and previous.


Variable Index

 o componentList
This list contains all of the components that have been added to the parent.
 o currentLeaf
This is the current leaf being visited by this iterator.
 o hgap
The horizontal gap in pixels.
 o parent
This is the parent container into which the components are being added.
 o root
This is the root of the wizard tree.
 o vgap
The vertical gap in pixels.

Constructor Index

 o IteratorLayout(WizardTreeManager)
Creates a new iterator layout with gaps of size zero.
 o IteratorLayout(WizardTreeManager, int, int)
Creates a new iterator layout with the specified horizontal and vertical gaps.

Method Index

 o addLayoutComponent(Component, Object)
Adds the specified component to this iterator layout.
 o addLayoutComponent(String, Component)
Deprecated.
 o addSubtree(Container, WizardComponent)
Adds the leaves of the specified subtree to the container so they can be visited correctly.
 o cancel()
Visits the leaf in the tree that is referenced by the current leaf for a cancel operation.
 o getConsoleMode()
Says whether we should do console interaction or not
 o getCurrentPanel()
Returns the currently displayed panel.
 o getHgap()
Gets the horizontal gap.
 o getLayoutAlignmentX(Container)
Returns the alignment along the x axis.
 o getLayoutAlignmentY(Container)
Returns the alignment along the y axis.
 o getRoot()
Returns the root of the panel tree currently being manipulated by this iterator.
 o getVgap()
Gets the vertical gap.
 o invalidateLayout(Container)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 o isTraversingForward()
Returns true if the user pressed "next" to get to the current panel, false if the user pressed "back".
 o layoutContainer(Container)
Lays out the specified container using this iterator layout.
 o maximumLayoutSize(Container)
Returns the maximum dimensions for this layout
 o minimumLayoutSize(Container)
Determines the minimum size for the specified panel.
 o next()
Visits the next leaf in the tree.
 o preferredLayoutSize(Container)
Determines the preferred size of the container argument using this iterator layout.
 o previous()
Visits the previous leaf in the tree.
 o removeLayoutComponent(Component)
Removes the specified component from the layout.
 o removeSubtree(Container, WizardComponent)
Removes the leaves of the specified subtree to the container so they can be visited correctly.
 o run()
This thread is started to run the wizard in automatic mode.
 o setConsoleMode(boolean)
Says whether we should do console interaction or not
 o setCurrentLeaf(WizardComponent)
Visits the specified leaf.
 o setHgap(int)
Sets the horizontal gap.
 o setRoot(Container, WizardComposite)
Sets the root of the wizard client tree.
 o setRoot(Container, WizardComposite, String, String)
Sets the root of the wizard client tree.
 o setVgap(int)
Sets the vertical gap.
 o warpToLeaf(WizardComponent)
Visits the specified WizardComponent.

Variables

 o hgap
 protected int hgap
The horizontal gap in pixels.

 o vgap
 protected int vgap
The vertical gap in pixels.

 o componentList
 protected Vector componentList
This list contains all of the components that have been added to the parent.

 o root
 protected WizardComposite root
This is the root of the wizard tree.

 o currentLeaf
 protected WizardComponent currentLeaf
This is the current leaf being visited by this iterator.

 o parent
 protected Container parent
This is the parent container into which the components are being added.

Constructors

 o IteratorLayout
 public IteratorLayout(WizardTreeManager manager)
Creates a new iterator layout with gaps of size zero.

Parameters:
manager - The WizardTreeManager.
 o IteratorLayout
 public IteratorLayout(WizardTreeManager manager,
                       int hgap,
                       int vgap)
Creates a new iterator layout with the specified horizontal and vertical gaps.

Parameters:
manager - The WizardTreeManager.
hgap - The horizontal gap.
vgap - The vertical gap.

Methods

 o getConsoleMode
 public synchronized boolean getConsoleMode()
Says whether we should do console interaction or not

Returns:
true if we are doing console interaction or not
 o setConsoleMode
 public synchronized void setConsoleMode(boolean consoleMode)
Says whether we should do console interaction or not

Parameters:
consoleMode - whether we should do console interactio or not. Passing true tells the iterator to call each WizardComponent's consoleInteraction() method.
 o getHgap
 public int getHgap()
Gets the horizontal gap.

Returns:
The horizontal gap.
 o getVgap
 public int getVgap()
Gets the vertical gap.

Returns:
The vertical gap.
 o setHgap
 public void setHgap(int hgap)
Sets the horizontal gap.

Parameters:
hgap - The horizontal gap.
 o setVgap
 public void setVgap(int vgap)
Sets the vertical gap.

Parameters:
vgap - The vertical gap.
 o addLayoutComponent
 public void addLayoutComponent(Component comp,
                                Object constraints)
Adds the specified component to this iterator layout. An application should use the setRoot method to set the root of the tree.

Parameters:
comp - The component to be added.
constraints - This should be null.
 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
Note: addLayoutComponent() is deprecated. replaced by addLayoutComponent(Component, Object)

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

Parameters:
comp - The component to be removed.
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using this iterator layout.

Parameters:
parent - The parent container.
Returns:
The preferred dimensions to lay out the subcomponents.
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container parent)
Determines the minimum size for the specified panel.

Parameters:
parent - The parent container.
Returns:
The minimum dimensions to lay out the subcomponents.
 o maximumLayoutSize
 public Dimension maximumLayoutSize(Container parent)
Returns the maximum dimensions for this layout

Parameters:
parent - The parent container.
Returns:
The maximum dimensions to lay out the subcomponents.
 o getLayoutAlignmentX
 public float getLayoutAlignmentX(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 sohuld 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.

Parameters:
parent - The parent container.
Returns:
The horizontal alignment.
 o getLayoutAlignmentY
 public float getLayoutAlignmentY(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 sohuld 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.

Parameters:
parent - The parent container.
Returns:
The vertical alignment.
 o invalidateLayout
 public void invalidateLayout(Container parent)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Parameters:
parent - The parent container.
 o layoutContainer
 public void layoutContainer(Container parent)
Lays out the specified container using this iterator layout.

Parameters:
parent - The parent container.
 o getRoot
 public WizardComposite getRoot()
Returns the root of the panel tree currently being manipulated by this iterator.

 o setRoot
 public void setRoot(Container parent,
                     WizardComposite root)
Sets the root of the wizard client tree. This should be called only after the tree has been completely created. If the tree must grow at runtime, use addSubtree to ensure that the panels are added to the container correctly.

Parameters:
parent - The parent container.
root - The root of the wizard client tree.
 o setRoot
 public void setRoot(Container parent,
                     WizardComposite root,
                     String firstPanel,
                     String lastPanel)
Sets the root of the wizard client tree. This should be called only after the tree has been completely created. If the tree must grow at runtime, use addSubtree to ensure that the panels are added to the container correctly.

Parameters:
parent - The parent container.
root - The root of the wizard client tree.
firstPanel - The first panel of the wizard that should be displayed.
lastPanel - The last panel of the wizard that should be displayed.
 o run
 public void run()
This thread is started to run the wizard in automatic mode. This thread should be used whenever the panels being visited should not be displayed.

 o addSubtree
 public void addSubtree(Container parent,
                        WizardComponent subtreeRoot)
Adds the leaves of the specified subtree to the container so they can be visited correctly.

Parameters:
parent - The parent container.
subtreeRoot - The root of the subtree.
 o removeSubtree
 public void removeSubtree(Container parent,
                           WizardComponent subtreeRoot)
Removes the leaves of the specified subtree to the container so they can be visited correctly.

Parameters:
parent - The parent container.
subtreeRoot - The root of the subtree.
 o setCurrentLeaf
 protected void setCurrentLeaf(WizardComponent newLeaf)
Visits the specified leaf. This should not be called from an application. An application should visit leaves using next and previous.

Parameters:
newLeaf - The leaf to be visited.
 o warpToLeaf
 public void warpToLeaf(WizardComponent newLeaf)
Visits the specified WizardComponent.

Parameters:
newLeaf - The new leaf to visit.
 o next
 public void next()
Visits the next leaf in the tree. The next leaf will be displayed in the parent container.

 o previous
 public void previous()
Visits the previous leaf in the tree. The previous leaf will be displayed in the parent container.

 o cancel
 public void cancel()
Visits the leaf in the tree that is referenced by the current leaf for a cancel operation. The current leaf has the option of whether the cancel operation should move forward in the tree, or backward.

 o getCurrentPanel
 public WizardComponent getCurrentPanel()
Returns the currently displayed panel.

Returns:
The panel currently being displayed.
 o isTraversingForward
 public boolean isTraversingForward()
Returns true if the user pressed "next" to get to the current panel, false if the user pressed "back".


All Packages  Class Hierarchy  This Package  Previous  Next  Index