Jazz API Documentation

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.io.Serializable, ZSerializable

public class ZInvisibleGroup
extends ZGroup
implements ZSerializable

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 the tree when an application wants to temporarily act as if a portion of the scenegraph doesn't exist.

See Also:
Serialized Form

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
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
 java.lang.Object clone()
          Duplicates the current node by using the copy constructor.
protected  void computeBounds()
          An invisible group always has empty bounds.
 void duplicateObject(ZInvisibleGroup refNode)
          Copies all object information from the reference object into the current object.
 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, addGroupListener, dump, duplicateObject, fireGroupEvent, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getNumChildren, hasOneChild, indexOf, insertAbove, lower, lowerTo, raise, raiseTo, remove, removeChild, removeGroupListener, setChildrenFindable, setChildrenPickable, setHasOneChild, setState, trimToSize, updateVolatility, writeObject, writeObjectRecurse
 
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
 

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

duplicateObject

public void duplicateObject(ZInvisibleGroup 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.

In particular, the visual component associated with this group gets duplicated along with the subtree.

Overrides:
clone in class ZGroup
Returns:
A copy of this node.
See Also:
ZNode.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)

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
mag - The magnification of the camera being picked within.
Returns:
The picked node, or null if none

Jazz API Documentation