|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZSceneGraphObject | +--edu.umd.cs.jazz.ZNode | +--edu.umd.cs.jazz.ZLeaf | +--edu.umd.cs.jazz.ZVisualLeaf
Field Summary | |
protected ZList.ZVisualComponentList |
visualComponents The visual components associated with this leaf. |
Fields inherited from class edu.umd.cs.jazz.ZNode |
editorFactory, findable_DEFAULT, parent, pickable_DEFAULT, savable_DEFAULT, selectable_DEFAULT |
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds, inTransaction, invalidBounds, invalidVolatileBounds, listenerList, volatileBounds, volatileBounds_DEFAULT |
Constructor Summary | |
ZVisualLeaf() Constructs a new empty visual leaf node. |
|
ZVisualLeaf(ZVisualComponent visualComponent) Constructs a new visual leaf node with the specified visual component. |
Method Summary | |
void |
addVisualComponent(ZVisualComponent visualComponent) Add a new visual component to this leaf node. |
void |
addVisualComponents(java.util.Collection aVisualComponentCollection) Add a collection of new visual components to this leaf node. |
void |
clearVisualComponents() Remove all visual components from this visual leaf. |
protected void |
computeBounds() Recomputes and caches the bounds for this node. |
protected void |
computeVolatileBounds() Compute volatileBoundsCache for visualComponents. |
protected java.lang.Object |
duplicateObject() Returns a clone of this object. |
ZVisualComponent |
getFirstVisualComponent() Return the first visual component associated with this leaf, or null if there are none. |
java.util.Collection |
getHandles() Return the handles associated with this leaf. |
int |
getNumVisualComponents() Return the number of visual components of this visual leaf. |
ZVisualComponent |
getVisualComponent(int i) Returns the i'th visual component of this node. |
ZBounds |
getVisualComponentBounds() Return a copy of the bounds of this node's visual components in local coordinates. |
ZBounds |
getVisualComponentGlobalBounds() Return a copy of the bounds of this node's visual components in global coordinates. |
ZVisualComponent[] |
getVisualComponents() Return the visual components associated with this visual leaf. |
boolean |
getVolatileBounds() Determines if this node is volatile. |
int |
indexOf(ZVisualComponent vis) Returns the index of the specified visual component or -1 if the visual component has not been added to this leaf |
protected void |
markInTransaction() Mark this object and all its visualComponents as being part of a transaction. |
protected void |
markNotInTransaction() Mark this object and all its visualComponents as not being part of a transaction. |
boolean |
pick(java.awt.geom.Rectangle2D rect, ZSceneGraphPath path) Returns true if any of this node's visual components are under the specified rectangle, and builds a ZSceneGraphPath to the node. |
void |
removeVisualComponent(ZVisualComponent visualComponent) Remove a visual component from this leaf node. |
void |
render(ZRenderContext renderContext) Renders this node which results its visual components getting painted. |
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 |
setVisualComponent(int i, ZVisualComponent visualComponent) Replace the i'th visual component associated with this leaf node. |
void |
setVisualComponent(ZVisualComponent visualComponent) Set the visual component associated with this leaf node. |
void |
trimToSize() Trims the capacity of the array that stores the visual components list to the actual number of points. |
protected void |
updateObjectReferences(ZObjectReferenceTable objRefTable) Called to update internal object references after a clone operation by ZSceneGraphObject.clone() . |
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.ZNode |
addNodeListener, editor, extract, findNodes, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, raise, raiseTo, remove, removeNodeListener, repaint, repaint, 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, dump, endTransaction, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getClientProperty, getListenerList, hasLisenerOfType, hasListenerOfType, hasMouseListener, processMouseEvent, putClientProperty, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, startTransaction |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ZList.ZVisualComponentList visualComponents
Constructor Detail |
public ZVisualLeaf()
public ZVisualLeaf(ZVisualComponent visualComponent)
visualComponent
- The new visual component that this leaf displays.Method Detail |
public void addVisualComponent(ZVisualComponent visualComponent)
visualComponent
- The visual component to be added.public void addVisualComponents(java.util.Collection aVisualComponentCollection)
aVisualComponentCollection
- The collection to be added.public void clearVisualComponents()
protected void computeBounds()
computeBounds
in class ZSceneGraphObject
protected java.lang.Object duplicateObject()
duplicateObject
in class ZNode
ZSceneGraphObject.duplicateObject()
public final ZVisualComponent getFirstVisualComponent()
public java.util.Collection getHandles()
getHandles
in class ZSceneGraphObject
public int getNumVisualComponents()
public ZVisualComponent getVisualComponent(int i)
public ZBounds getVisualComponentBounds()
public ZBounds getVisualComponentGlobalBounds()
public final ZVisualComponent[] getVisualComponents()
public boolean getVolatileBounds()
ZNode.setVolatileBounds(boolean)
. All parents of this node are also volatile when this is volatile.
Volatile objects are those objects that change regularly, such as an object that is animated, or one whose rendering depends on its context.
getVolatileBounds
in class ZSceneGraphObject
ZNode.setVolatileBounds(boolean)
protected void computeVolatileBounds()
computeVolatileBounds
in class ZSceneGraphObject
public int indexOf(ZVisualComponent vis)
public boolean pick(java.awt.geom.Rectangle2D rect, ZSceneGraphPath path)
pick
in class ZNode
rect
- Coordinates of pick rectangle in local coordinatespath
- The path through the scenegraph to the picked node. Modified by this call.ZDrawingSurface.pick(int, int)
public void removeVisualComponent(ZVisualComponent visualComponent)
visualComponent
- The visual component to be removed.public 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.
render
in class ZNode
renderContext
- The graphics context to use for rendering.public void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
setState
in interface ZSerializable
setState
in class ZNode
fieldType
- The fully qualified type of the fieldfieldName
- The name of the fieldfieldValue
- The value of the fieldpublic void setVisualComponent(int i, ZVisualComponent visualComponent)
i
- The index of the visual component to replacevisualComponent
- The new visual component for this node.public void setVisualComponent(ZVisualComponent visualComponent)
visualComponent
- The new visual component for this node.public void trimToSize()
trimToSize
in class ZSceneGraphObject
protected void updateObjectReferences(ZObjectReferenceTable objRefTable)
ZSceneGraphObject.clone()
.
updateObjectReferences
in class ZSceneGraphObject
objRefTable
- Table mapping from uncloned objects to their cloned versions.ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)
protected void markInTransaction()
markInTransaction
in class ZSceneGraphObject
protected void markNotInTransaction()
markNotInTransaction
in class ZSceneGraphObject
public void writeObject(ZObjectOutputStream out) throws java.io.IOException
writeObject
in interface ZSerializable
writeObject
in class ZNode
out
- The stream that this object writes intojava.io.IOException
public void writeObjectRecurse(ZObjectOutputStream out) throws java.io.IOException
writeObjectRecurse
in interface ZSerializable
writeObjectRecurse
in class ZSceneGraphObject
out
- The stream that this object writes intojava.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |