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
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. |
void |
repaint()
Because repaints are irrelevant - they are not passed up the scenegraph |
void |
repaint(ZBounds bounds)
Because repaints are irrelevant - they are not passed up the scenegraph |
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, addChildren, addGroupListener, childAddedNotification, childRemovedNotification, computeVolatileBounds, dump, duplicateObject, extract, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getChildrenReference, getNumChildren, getShallowBounds, getVolatileBounds, hasOneChild, indexOf, insertAbove, iterator, lower, lowerTo, markInTransaction, markNotInTransaction, raise, raiseTo, removeAllChildren, removeAllChildren, removeChild, removeChild, removeChild, removeChildImpl, removeGroupListener, removeNodeListener, setChildrenFindable, setChildrenPickable, setHasOneChild, setState, trimToSize, updateHasNodeListener, writeObject, writeObjectRecurse |
Methods inherited from class edu.umd.cs.jazz.ZNode |
addNodeListener, editor, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, raise, raiseTo, remove, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, setSelectable, setVolatileBounds, updateBounds, updateVolatility, writeReplace |
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
addClientProperty, addMouseListener, addMouseMotionListener, clone, endTransaction, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getClientProperty, getHandles, getListenerList, hasLisenerOfType, hasListenerOfType, hasMouseListener, processMouseEvent, putClientProperty, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, startTransaction, updateObjectReferences |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.
repaint
public void repaint()
-
Because repaints are irrelevant - they are not passed up the scenegraph
-
- Overrides:
repaint
in class ZNode
-
- See Also:
ZSceneGraphObject.reshape()
repaint
public void repaint(ZBounds bounds)
-
Because repaints are irrelevant - they are not passed up the scenegraph
-
- Overrides:
repaint
in class ZNode
-
- Parameters:
bounds
- The bounds to repaint
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
- See Also:
ZDrawingSurface.pick(int, int)
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
- See Also:
ZNode.isFindable()
, ZFindFilter
Copyright � 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.