edu.umd.cs.jazz
Class ZInvisibleGroup

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

public class ZInvisibleGroup
extends ZGroup
implements ZSerializable, java.io.Serializable

ZInvisibleGroup is a group node that completely hides its descendents. It does not render anything, nor does it pick or find any children. In addition, an invisible group always has empty bounds. An invisible group can be inserted into a scenegraph when a portion of the tree needs to be temporarily hidden.

ZSceneGraphEditor provides a convenience mechanism to locate, create and manage nodes of this type.

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:
Ben Bederson
See Also:
Serialized Form

Fields inherited from class edu.umd.cs.jazz.ZGroup
children, childrenFindable_DEFAULT, childrenPickable_DEFAULT, hasOneChild_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZNode
findable_DEFAULT, pickable_DEFAULT, savable_DEFAULT, selectable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject
bounds, listenerList, volatileBounds, volatileBounds_DEFAULT
 
Constructor Summary
ZInvisibleGroup()
          Constructs a new empty invisible group node.
ZInvisibleGroup(ZNode child)
          Constructs a new invisible group node with the specified node as a child of the new group.
 
Method Summary
protected  void computeBounds()
          An invisible group always has empty bounds.
protected  int findNodes(ZFindFilter filter, java.util.ArrayList nodes)
          In invisible node never is found, nor are any of its children.
 boolean pick(java.awt.geom.Rectangle2D rect, ZSceneGraphPath path)
          An invisible node never gets picked, nor does it pick any of its children.
 void render(ZRenderContext renderContext)
          An invisible node does not get rendered at all, nor do any of its children.
static void setVisible(ZNode node, boolean visible)
          Make the sub-tree rooted at the specified node invisible or visible.
 
Methods inherited from class edu.umd.cs.jazz.ZGroup
addChild, addChildImpl, addChildren, addGroupListener, childAddedNotification, childRemovedNotification, dump, duplicateObject, extract, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getChildrenReference, getNumChildren, getShallowBounds, getVolatileBounds, hasOneChild, indexOf, insertAbove, iterator, lower, lowerTo, raise, raiseTo, removeAllChildren, removeChild, removeChild, removeChild, removeChildImpl, removeGroupListener, removeNodeListener, setChildrenFindable, setChildrenPickable, setHasOneChild, setState, trimToSize, updateHasNodeListener, updateVolatility, writeObject, writeObjectRecurse
 
Methods inherited from class edu.umd.cs.jazz.ZNode
addClientProperty, addNodeListener, editor, getClientProperty, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, putClientProperty, raise, raiseTo, remove, repaint, repaint, repaint, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, setSelectable, updateBounds, updateObjectReferences, writeReplace
 
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject
addMouseListener, addMouseMotionListener, clone, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getListenerList, hasLisenerOfType, hasMouseListener, processMouseEvent, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, setVolatileBounds
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.jazz.io.ZSerializable
setState, writeObject, writeObjectRecurse
 

Constructor Detail

ZInvisibleGroup

public ZInvisibleGroup()
Constructs a new empty invisible group node.

ZInvisibleGroup

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

setVisible

public static void setVisible(ZNode node,
                              boolean visible)
Make the sub-tree rooted at the specified node invisible or visible. If the node is being made invisible, this inserts an invisible node above that node (if there isn't already one there.) If it is being made visible, then an invisible nodes directly above the specified node is removed if there is one.
Parameters:
node - the node to make invisible

render

public void render(ZRenderContext renderContext)
An invisible node does not get rendered at all, nor do any of its children.
Overrides:
render in class ZGroup
Parameters:
renderContext - The graphics context to use for rendering.

computeBounds

protected void computeBounds()
An invisible group always has empty bounds.
Overrides:
computeBounds in class ZGroup

pick

public boolean pick(java.awt.geom.Rectangle2D rect,
                    ZSceneGraphPath path)
An invisible node never gets picked, nor does it pick any of its children.
Overrides:
pick in class ZGroup
Parameters:
rect - Coordinates of pick rectangle in local coordinates
path - The path through the scenegraph to the picked node. Modified by this call.
Returns:
The picked node, or null if none

findNodes

protected int findNodes(ZFindFilter filter,
                        java.util.ArrayList nodes)
In invisible node never is found, nor are any of its children.
Overrides:
findNodes in class ZGroup
Parameters:
filter - The filter that decides whether or not to include individual nodes in the find list
nodes - the accumulation list (results will be place here).
Returns:
the number of nodes searched


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