|
Jazz API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.umd.cs.jazz.ZSceneGraphObject
|
+--edu.umd.cs.jazz.ZNode
|
+--edu.umd.cs.jazz.ZGroup
ZGroup is the basic hierarchial node. It has zero or more child nodes.
| Field Summary | |
static boolean |
childrenFindable_DEFAULT
|
static boolean |
childrenPickable_DEFAULT
|
static boolean |
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 | |
ZGroup()
Constructs an empty ZGroup. |
|
ZGroup(ZNode child)
Constructs a new group node with the specified node as a child of the new group. |
|
| Method Summary | |
void |
addChild(ZNode child)
Add a node to be a new child of this group node. |
void |
addGroupListener(ZGroupListener l)
Adds the specified group listener to receive group events from this node |
java.lang.Object |
clone()
Duplicates the current node by using the copy constructor. |
protected void |
computeBounds()
Recomputes and caches the bounds for this node. |
java.lang.String |
dump()
Generate a string that represents this object for debugging. |
void |
duplicateObject(ZGroup refNode)
Copies all object information from the reference object into the current object. |
protected void |
fireGroupEvent(int id,
ZNode child)
Notifies all listeners that have registered interest for notification on this event type. |
ZNode |
getChild(int i)
Returns the i'th child of this node. |
ZNode[] |
getChildren()
Return a copy of the array of children of this node. |
boolean |
getChildrenFindable()
Determines if this node finds its children. |
java.util.Iterator |
getChildrenIterator()
Return an iterator over the children of this group in the proper order. |
boolean |
getChildrenPickable()
Determines if this node picks its children. |
int |
getNumChildren()
Return the number of children of this group node. |
boolean |
hasOneChild()
Determines if this group node can have no more than one child |
int |
indexOf(ZNode child)
Searches for the first occurence of the given child in the children of this node. |
void |
insertAbove(ZNode child)
Insert this group node above the specified node. |
void |
lower(ZNode child)
Lowers the specified child node within the drawing order of this node's children, so it gets rendered below (before) all of its siblings. |
void |
lowerTo(ZNode child,
ZNode beforeNode)
Lowers the specified child node within the drawing order of this node's siblings, so it gets rendered below (before) the specified node. |
boolean |
pick(java.awt.geom.Rectangle2D rect,
ZSceneGraphPath path)
Returns the first object under the specified rectangle (if there is one) in the subtree rooted with this as searched in reverse (front-to-back) order. |
void |
raise(ZNode child)
Raises the specified child node within the drawing order of this node's children, so it gets rendered above (after) all of its siblings. |
void |
raiseTo(ZNode child,
ZNode afterNode)
Raises the specified child node within the drawing order of this node's siblings, so it gets rendered above (after) the specified node. |
void |
remove()
Remove this node from the tree, merging the nodes above and below it. |
void |
removeChild(ZNode child)
Remove the specified child node from this group node. |
void |
removeGroupListener(ZGroupListener l)
Removes the specified group listener so that it no longer receives group events from this group. |
void |
render(ZRenderContext renderContext)
Renders this node which results in its children getting painted. |
void |
setChildrenFindable(boolean childrenFindable)
Specifies whether this node should find its children. |
void |
setChildrenPickable(boolean childrenPickable)
Specifies whether this node should pick its children. |
void |
setHasOneChild(boolean oneChild)
Specifies if this group is only allowed to have a maxium of one child. |
void |
setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
Set some state of this object as it gets read back in. |
void |
trimToSize()
Trims the capacity of the array that stores the children list points to the actual number of points. |
protected void |
updateVolatility()
Internal method to compute and cache the volatility of a node, to recursively call the parents to compute volatility. |
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.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 |
public static final boolean childrenPickable_DEFAULT
public static final boolean childrenFindable_DEFAULT
public static final boolean hasOneChild_DEFAULT
| Constructor Detail |
public ZGroup()
public ZGroup(ZNode child)
child - Child of the new group node.| Method Detail |
public void duplicateObject(ZGroup refNode)
refNode - The reference node to copypublic java.lang.Object clone()
In particular, all the children of this node will be cloned so that the entire subtree rooted at this group node will be duplicated.
ZNode.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)public void trimToSize()
public void insertAbove(ZNode child)
child - the child node that this node should go above.public int indexOf(ZNode child)
child - The child to search forpublic void remove()
public void addChild(ZNode child)
If this group has 'hasOneChild' set, and if adding this child would result in there being more than one child, then a ZTooManyChildrenException is thrown.
child - The new child node.public void removeChild(ZNode child)
child - The child to be removed.public ZNode[] getChildren()
public java.util.Iterator getChildrenIterator()
public ZNode getChild(int i)
public int getNumChildren()
public void raise(ZNode child)
public void raiseTo(ZNode child,
ZNode afterNode)
If the specified reference node is null, then this node is raised to be the last node rendered of its siblings (i.e., equivalent to calling {link #raise}
afterNode - The node to raise this node after.public void lower(ZNode child)
public void lowerTo(ZNode child,
ZNode beforeNode)
If the specified reference node is null, then this node is lowered to be the first node rendered of its siblings (i.e., equivalent to calling {link #lower}
beforeNode - The node to lower this node before.protected void updateVolatility()
ZSceneGraphObject.setVolatileBounds(boolean),
ZSceneGraphObject.getVolatileBounds()public void setChildrenPickable(boolean childrenPickable)
childrenPickable - True if this node should pick its childrenZDrawingSurface.pick(int, int)public final boolean getChildrenPickable()
public void setChildrenFindable(boolean childrenFindable)
childrenFindable - True if this node should find its childrenZDrawingSurface.findNodes(edu.umd.cs.jazz.util.ZFindFilter)public final boolean getChildrenFindable()
public void setHasOneChild(boolean oneChild)
Jazz provides ZSceneGraphEditor to manage these decorator chains, and that class should be examined for more information.
oneChild - True if this node can have no more than one childZSceneGraphEditorpublic final boolean hasOneChild()
ZSceneGraphEditorpublic void render(ZRenderContext renderContext)
The transform, clip, and composite will be set appropriately when this object is rendered. It is up to this object to restore the transform, clip, and composite of the Graphics2D if this node changes any of them. However, the color, font, and stroke are unspecified by Jazz. This object should set those things if they are used, but they do not need to be restored.
renderContext - The graphics context to use for rendering.protected void computeBounds()
public void addGroupListener(ZGroupListener l)
l - the group listenerpublic void removeGroupListener(ZGroupListener l)
l - the group listener
protected void fireGroupEvent(int id,
ZNode child)
id - The event id (NODE_ADDED, NODE_REMOVED)child - The child being added or removed from this nodeEventListenerList
public boolean pick(java.awt.geom.Rectangle2D rect,
ZSceneGraphPath path)
If childrenPickable is false, then this will never return a child as the picked node. Instead, this node will be returned if any children are picked. If no children are picked, then this will return null.
rect - Coordinates of pick rectangle in local coordinatesmag - The magnification of the camera being picked within.public java.lang.String dump()
ZDebug.dump(edu.umd.cs.jazz.ZNode)
public void writeObject(ZObjectOutputStream out)
throws java.io.IOException
out - The stream that this object writes into
public void writeObjectRecurse(ZObjectOutputStream out)
throws java.io.IOException
out - The stream that this object writes into
public void setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
fieldType - The fully qualified type of the fieldfieldName - The name of the fieldfieldValue - The value of the field
|
Jazz API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||