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.
-
componentList
- This list contains all of the components that have been added
to the parent.
-
currentLeaf
- This is the current leaf being visited by this iterator.
-
hgap
- The horizontal gap in pixels.
-
parent
- This is the parent container into which the components are being
added.
-
root
- This is the root of the wizard tree.
-
vgap
- The vertical gap in pixels.
-
IteratorLayout(WizardTreeManager)
- Creates a new iterator layout with gaps of size
zero.
-
IteratorLayout(WizardTreeManager, int, int)
- Creates a new iterator layout with the specified horizontal and
vertical gaps.
-
addLayoutComponent(Component, Object)
- Adds the specified component to this iterator layout.
-
addLayoutComponent(String, Component)
-
Deprecated.
-
addSubtree(Container, WizardComponent)
- Adds the leaves of the specified subtree to the container so
they can be visited correctly.
-
cancel()
- Visits the leaf in the tree that is referenced by
the current leaf for a cancel operation.
-
getConsoleMode()
- Says whether we should do console interaction or not
-
getCurrentPanel()
- Returns the currently displayed panel.
-
getHgap()
- Gets the horizontal gap.
-
getLayoutAlignmentX(Container)
- Returns the alignment along the x axis.
-
getLayoutAlignmentY(Container)
- Returns the alignment along the y axis.
-
getRoot()
- Returns the root of the panel tree currently being manipulated by this
iterator.
-
getVgap()
- Gets the vertical gap.
-
invalidateLayout(Container)
- Invalidates the layout, indicating that if the layout manager
has cached information it should be discarded.
-
isTraversingForward()
- Returns true if the user pressed "next" to get to the current
panel, false if the user pressed "back".
-
layoutContainer(Container)
- Lays out the specified container using this iterator layout.
-
maximumLayoutSize(Container)
- Returns the maximum dimensions for this layout
-
minimumLayoutSize(Container)
- Determines the minimum size for the specified panel.
-
next()
- Visits the next leaf in the tree.
-
preferredLayoutSize(Container)
- Determines the preferred size of the container argument using
this iterator layout.
-
previous()
- Visits the previous leaf in the tree.
-
removeLayoutComponent(Component)
- Removes the specified component from the layout.
-
removeSubtree(Container, WizardComponent)
- Removes the leaves of the specified subtree to the container so
they can be visited correctly.
-
run()
- This thread is started to run the wizard in automatic mode.
-
setConsoleMode(boolean)
- Says whether we should do console interaction or not
-
setCurrentLeaf(WizardComponent)
- Visits the specified leaf.
-
setHgap(int)
- Sets the horizontal gap.
-
setRoot(Container, WizardComposite)
- Sets the root of the wizard client tree.
-
setRoot(Container, WizardComposite, String, String)
- Sets the root of the wizard client tree.
-
setVgap(int)
- Sets the vertical gap.
-
warpToLeaf(WizardComponent)
- Visits the specified WizardComponent.
hgap
protected int hgap
- The horizontal gap in pixels.
vgap
protected int vgap
- The vertical gap in pixels.
componentList
protected Vector componentList
- This list contains all of the components that have been added
to the parent.
root
protected WizardComposite root
- This is the root of the wizard tree.
currentLeaf
protected WizardComponent currentLeaf
- This is the current leaf being visited by this iterator.
parent
protected Container parent
- This is the parent container into which the components are being
added.
IteratorLayout
public IteratorLayout(WizardTreeManager manager)
- Creates a new iterator layout with gaps of size
zero.
- Parameters:
- manager - The WizardTreeManager.
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.
getConsoleMode
public synchronized boolean getConsoleMode()
- Says whether we should do console interaction or not
- Returns:
- true if we are doing console interaction or not
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.
getHgap
public int getHgap()
- Gets the horizontal gap.
- Returns:
- The horizontal gap.
getVgap
public int getVgap()
- Gets the vertical gap.
- Returns:
- The vertical gap.
setHgap
public void setHgap(int hgap)
- Sets the horizontal gap.
- Parameters:
- hgap - The horizontal gap.
setVgap
public void setVgap(int vgap)
- Sets the vertical gap.
- Parameters:
- vgap - The vertical gap.
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.
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- Note: addLayoutComponent() is deprecated.
replaced by
addLayoutComponent(Component, Object)
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- Removes the specified component from the layout.
- Parameters:
- comp - The component to be removed.
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.
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.
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.
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.
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.
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.
layoutContainer
public void layoutContainer(Container parent)
- Lays out the specified container using this iterator layout.
- Parameters:
- parent - The parent container.
getRoot
public WizardComposite getRoot()
- Returns the root of the panel tree currently being manipulated by this
iterator.
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.
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.
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.
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.
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.
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.
warpToLeaf
public void warpToLeaf(WizardComponent newLeaf)
- Visits the specified WizardComponent.
- Parameters:
- newLeaf - The new leaf to visit.
next
public void next()
- Visits the next leaf in the tree. The next leaf will
be displayed in the parent container.
previous
public void previous()
- Visits the previous leaf in the tree. The previous
leaf will be displayed in the parent container.
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.
getCurrentPanel
public WizardComponent getCurrentPanel()
- Returns the currently displayed panel.
- Returns:
- The panel currently being displayed.
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