Jazz API Documentation

edu.umd.cs.jazz
Class ZSelectionGroup

java.lang.Object
  |
  +--edu.umd.cs.jazz.ZSceneGraphObject
        |
        +--edu.umd.cs.jazz.ZNode
              |
              +--edu.umd.cs.jazz.ZGroup
                    |
                    +--edu.umd.cs.jazz.ZVisualGroup
                          |
                          +--edu.umd.cs.jazz.ZSelectionGroup
All Implemented Interfaces:
java.io.Serializable, ZSerializable

public class ZSelectionGroup
extends ZVisualGroup
implements ZSerializable, java.io.Serializable

ZSelectionGroup is a group node that represents the selection of a node. It shows it is selected by surrounding its children with a 1 pixel wide line. It provides utility methods of selecting, unselected nodes, and for determining the selected nodes in a sub-tree.

See Also:
Serialized Form

Field Summary
static java.awt.Color penColor_DEFAULT
           
 
Fields inherited from class edu.umd.cs.jazz.ZVisualGroup
visualComponentPickable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZGroup
childrenFindable_DEFAULT, childrenPickable_DEFAULT, hasOneChild_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZNode
findable_DEFAULT, listenerList, pickable_DEFAULT, savable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject
bounds, objRefTable, volatileBounds_DEFAULT
 
Constructor Summary
ZSelectionGroup()
          Constructs a new ZSelectionGroup.
ZSelectionGroup(ZNode child)
          Constructs a new select group node with the specified node as a child of the new group.
 
Method Summary
 java.lang.Object clone()
          Duplicates the current node by using the copy constructor.
protected  ZVisualComponent createSelectComponent()
          Internal method to create the visual component that represents the selection.
 void duplicateObject(ZSelectionGroup refNode)
          Copies all object information from the reference object into the current object.
 java.awt.Color getPenColor()
          Get the pen color that is used to render the selection.
static java.util.ArrayList getSelectedNodes(ZCamera camera)
          Return a list of the selected nodes in the portion of the scenegraph visible from the specified camera.
static java.util.ArrayList getSelectedNodes(ZNode node)
          Return a list of the selected nodes in the subtree rooted at the specified node (including the root if it is selected).
static boolean isSelected(ZNode node)
          Determine if the specified node is selected.
static ZSelectionGroup select(ZNode node)
          Select the specified node.
 void setPenColor(java.awt.Color color)
          Set the pen color that is used to render the selection.
static void unselect(ZNode node)
          Unselect the specified node.
static void unselectAll(ZCamera camera)
          Unselect all currently selected nodes in the portion of the scenegraph visible from the specified camera.
static void unselectAll(ZNode node)
          Unselect all currently selected nodes in the subtree rooted at the specified node (including the root if it is selected).
 void writeObject(ZObjectOutputStream out)
          Write out all of this object's state.
 void writeObjectRecurse(ZObjectOutputStream out)
          Specify which objects this object references in order to write out the scenegraph properly
 
Methods inherited from class edu.umd.cs.jazz.ZVisualGroup
computeBounds, duplicateObject, getBackVisualComponent, getBackVisualComponentBounds, getBackVisualComponentGlobalBounds, getFrontVisualComponent, getFrontVisualComponentBounds, getFrontVisualComponentGlobalBounds, isBackVisualComponentPickable, isFrontVisualComponentPickable, pick, render, setBackVisualComponent, setBackVisualComponentPickable, setFrontVisualComponent, setFrontVisualComponentPickable, setState, updateVolatility
 
Methods inherited from class edu.umd.cs.jazz.ZGroup
addChild, addGroupListener, dump, duplicateObject, fireGroupEvent, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getNumChildren, hasOneChild, indexOf, insertAbove, lower, lowerTo, raise, raiseTo, remove, removeChild, removeGroupListener, setChildrenFindable, setChildrenPickable, setHasOneChild, trimToSize
 
Methods inherited from class edu.umd.cs.jazz.ZNode
addClientProperty, addMouseListener, addMouseMotionListener, duplicateObject, editor, fireMouseEvent, getClientProperty, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, hasMouseListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, localToGlobal, localToGlobal, lower, lowerTo, putClientProperty, raise, raiseTo, removeMouseListener, removeMouseMotionListener, repaint, repaint, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, updateBounds, updateObjectReferences, writeReplace
 
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject
duplicateObject, getBounds, getVolatileBounds, reshape, setVolatileBounds
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

penColor_DEFAULT

public static final java.awt.Color penColor_DEFAULT
Constructor Detail

ZSelectionGroup

public ZSelectionGroup()
Constructs a new ZSelectionGroup. The node must be attached to a live scenegraph (a scenegraph that is currently visible) order for it to be visible.

ZSelectionGroup

public ZSelectionGroup(ZNode child)
Constructs a new select group node with the specified node as a child of the new group.
Parameters:
child - Child of the new group node.
Method Detail

duplicateObject

public void duplicateObject(ZSelectionGroup refNode)
Copies all object information from the reference object into the current object. This method is called from the clone method. All ZSceneGraphObjects objects contained by the object being duplicated are duplicated, except parents which are set to null. This results in the sub-tree rooted at this object being duplicated.
Parameters:
refNode - The reference node to copy

clone

public java.lang.Object clone()
Duplicates the current node by using the copy constructor. The portion of the reference node that is duplicated is that necessary to reuse the node in a new place within the scenegraph, but the new node is not inserted into any scenegraph. The node must be attached to a live scenegraph (a scenegraph that is currently visible) or be registered with a camera directly in order for it to be visible.
Overrides:
clone in class ZVisualGroup
Returns:
A copy of this node.
See Also:
ZNode.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)

getSelectedNodes

public static java.util.ArrayList getSelectedNodes(ZNode node)
Return a list of the selected nodes in the subtree rooted at the specified node (including the root if it is selected). Note that the nodes returned are the nodes at the bottom of the "decorator chain". See @link{ZSceneGraphEditor} for more information.
Parameters:
node - The subtree to check for selection
Returns:
The list of selected nodes.

getSelectedNodes

public static java.util.ArrayList getSelectedNodes(ZCamera camera)
Return a list of the selected nodes in the portion of the scenegraph visible from the specified camera. Note that the nodes returned are the nodes at the bottom of the "decorator chain". See @link{ZSceneGraphEditor} for more information.
Parameters:
camera - The camera to look through for selected nodes.
Returns:
The list of selected nodes.

select

public static ZSelectionGroup select(ZNode node)
Select the specified node. If the node is already selected, then do nothing. This manages the selection as a decorator as described in @link{ZSceneGraphEditor}.
Parameters:
node - the node to select
Returns:
the ZSelectionGroup that represents the selection

unselect

public static void unselect(ZNode node)
Unselect the specified node. If the node is not already selected, then do nothing. This manages the selection as a decorator as described in @link{ZNode}.
Parameters:
node - the node to unselect

unselectAll

public static void unselectAll(ZNode node)
Unselect all currently selected nodes in the subtree rooted at the specified node (including the root if it is selected). This manages the selection as a decorator as described in @link{ZNode}.
Parameters:
node - The subtree to check for selection

unselectAll

public static void unselectAll(ZCamera camera)
Unselect all currently selected nodes in the portion of the scenegraph visible from the specified camera. This manages the selection as a decorator as described in @link{ZNode}.
Parameters:
camera - The camera to look through for selected nodes.

isSelected

public static boolean isSelected(ZNode node)
Determine if the specified node is selected.
Returns:
true if the node is selected.

getPenColor

public java.awt.Color getPenColor()
Get the pen color that is used to render the selection.
Returns:
the pen color.

setPenColor

public void setPenColor(java.awt.Color color)
Set the pen color that is used to render the selection.
Parameters:
color - the pen color, or null if none.

createSelectComponent

protected ZVisualComponent createSelectComponent()
Internal method to create the visual component that represents the selection. Applications can change visual representation of a selected object by extending this class, and overriding this method.
Returns:
the visual component that represents the selection.

writeObject

public void writeObject(ZObjectOutputStream out)
                 throws java.io.IOException
Write out all of this object's state.
Specified by:
writeObject in interface ZSerializable
Overrides:
writeObject in class ZVisualGroup
Parameters:
out - The stream that this object writes into

writeObjectRecurse

public void writeObjectRecurse(ZObjectOutputStream out)
                        throws java.io.IOException
Specify which objects this object references in order to write out the scenegraph properly
Specified by:
writeObjectRecurse in interface ZSerializable
Overrides:
writeObjectRecurse in class ZVisualGroup
Parameters:
out - The stream that this object writes into

Jazz API Documentation