edu.umd.cs.jazz
Class ZSelectionManager

java.lang.Object
  |
  +--edu.umd.cs.jazz.ZSelectionManager

public class ZSelectionManager
extends java.lang.Object

ZSelectionManager allows for registration of ZGroupListener instances with addGroupListener(). Registered ZGroupListener instances will be notified when items are added or removed from the current selection for a given camera.

Note that this class should not be instantiated.

Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

Author:
Antony Courtney, Yale University
, Lance Good, University of Maryland , Benjamin Bederson, University of Maryland
See Also:
ZSelectionModifyHandler, ZSelectionDeleteHandler, ZSelectionMoveHandler, ZSelectionScaleHandler

Method Summary
static void addGroupListener(ZGroupListener l)
          Add a ZGroupListener, registered for group selection events on all cameras
static void addGroupListener(ZGroupListener l, ZCamera camera)
          Add a ZGroupListener, registered for group selection events on the given camera
protected static void fireGroupEvent(int id, ZGroup group, ZNode child)
          Notifies all listeners that have registered interest for notification on this event type.
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 void removeGroupListener(ZGroupListener l)
          Remove a ZGroupListener, registered for group selection events on all cameras
static void removeGroupListener(ZGroupListener l, ZCamera camera)
           
static ZSelectionGroup select(ZNode node)
          Select the specified node.
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addGroupListener

public static void addGroupListener(ZGroupListener l)
Add a ZGroupListener, registered for group selection events on all cameras

Parameters:
l - The listener to add

removeGroupListener

public static void removeGroupListener(ZGroupListener l)
Remove a ZGroupListener, registered for group selection events on all cameras

Parameters:
l - The listener to remove

addGroupListener

public static void addGroupListener(ZGroupListener l,
                                    ZCamera camera)
Add a ZGroupListener, registered for group selection events on the given camera

Parameters:
l - The listener to add
camera - The camera on which to listen for selection events

removeGroupListener

public static void removeGroupListener(ZGroupListener l,
                                       ZCamera camera)

fireGroupEvent

protected static void fireGroupEvent(int id,
                                     ZGroup group,
                                     ZNode child)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. The listener list is processed in last to first order.

Parameters:
id - The event id (NODE_ADDED, NODE_REMOVED)
child - The child being added or removed from this node
See Also:
EventListenerList

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 ZSceneGraphEditor for more information. You can also obtain all the selected nodes for a given camera, (for example, ZCanvas.getCamera()) using getSelectedNodes(ZCamera)

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. You can also obtain all the selected nodes in the subtree of rooted at given ZNode using, getSelectedNodes(ZNode)

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.


Copyright 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.