|
||||||||||
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 | +--edu.umd.cs.jazz.ZVisualGroup
ZVisualGroup is a group node that has a visual components that can be rendered. It has two visual components (either or both of which could be null) which get rendered before and after the node's children, respectively.
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.
Field Summary | |
static boolean |
visualComponentPickable_DEFAULT
|
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 | |
ZVisualGroup()
Constructs a new empty visual group node. |
|
ZVisualGroup(ZNode child)
Constructs a new visual group node with the specified node as a child of the new group. |
|
ZVisualGroup(ZNode child,
ZVisualComponent newFrontVisualComponent,
ZVisualComponent newBackVisualComponent)
Constructs a new ZVisualGroup with the specified visual components, and specified node as a child of the new group. |
|
ZVisualGroup(ZVisualComponent newFrontVisualComponent,
ZVisualComponent newBackVisualComponent)
Constructs a new ZVisualGroup with the specified visual components. |
Method Summary | |
protected void |
computeBounds()
Recomputes and caches the bounds for this node. |
protected java.lang.Object |
duplicateObject()
Returns a clone of this object. |
ZVisualComponent |
getBackVisualComponent()
Return the back visual component associated with this leaf, or null if none. |
ZBounds |
getBackVisualComponentBounds()
Return a copy of the bounds of this node's back visual component in local coordinates. |
ZBounds |
getBackVisualComponentGlobalBounds()
Return a copy of the bounds of this node's back visual component in global coordinates. |
ZVisualComponent |
getFrontVisualComponent()
Return the front visual component associated with this leaf, or null if none. |
ZBounds |
getFrontVisualComponentBounds()
Return a copy of the bounds of this node's front visual component in local coordinates. |
ZBounds |
getFrontVisualComponentGlobalBounds()
Return a copy of the bounds of this node's front visual component in global coordinates. |
ZBounds |
getShallowBounds()
Return the bounds of this ZGroup without taking the groups children into consideration. |
boolean |
isBackVisualComponentPickable()
Determines if this node's back visual component is pickable. |
boolean |
isFrontVisualComponentPickable()
Determines if this node's front visual component is pickable. |
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 |
render(ZRenderContext renderContext)
Renders this node which results in the node's visual component getting rendered, followed by its children getting rendered. |
void |
setBackVisualComponent(ZVisualComponent newBackVisualComponent)
Set the back visual component associated with this group node. |
void |
setBackVisualComponentPickable(boolean backVisualComponentPickable)
Specifies whether this node's back visual component is pickable. |
void |
setFrontVisualComponent(ZVisualComponent newFrontVisualComponent)
Set the front visual component associated with this group node. |
void |
setFrontVisualComponentPickable(boolean frontVisualComponentPickable)
Specifies whether this node's front visual component is pickable. |
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. |
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.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 |
Field Detail |
public static final boolean visualComponentPickable_DEFAULT
Constructor Detail |
public ZVisualGroup()
public ZVisualGroup(ZNode child)
child
- Child of the new group node.public ZVisualGroup(ZVisualComponent newFrontVisualComponent, ZVisualComponent newBackVisualComponent)
newFrontVisualComponent
- The new front visual component that this group displays.newBackVisualComponent
- The new back visual component that this group displays.public ZVisualGroup(ZNode child, ZVisualComponent newFrontVisualComponent, ZVisualComponent newBackVisualComponent)
child
- Child of the new group node.newFrontVisualComponent
- The new front visual component that this group displays.newBackVisualComponent
- The new back visual component that this group displays.Method Detail |
protected java.lang.Object duplicateObject()
duplicateObject
in class ZGroup
ZSceneGraphObject.duplicateObject()
public void setFrontVisualComponent(ZVisualComponent newFrontVisualComponent)
newFrontVisualComponent
- The new front visual component for this node.setBackVisualComponent(edu.umd.cs.jazz.ZVisualComponent)
public final ZVisualComponent getFrontVisualComponent()
public void setBackVisualComponent(ZVisualComponent newBackVisualComponent)
newBackVisualComponent
- The new back visual component for this node.setFrontVisualComponent(edu.umd.cs.jazz.ZVisualComponent)
public final ZVisualComponent getBackVisualComponent()
protected void updateVolatility()
updateVolatility
in class ZGroup
ZSceneGraphObject.setVolatileBounds(boolean)
,
ZGroup.getVolatileBounds()
public void setFrontVisualComponentPickable(boolean frontVisualComponentPickable)
pickable
- True if this node's front visual component should be pickable.public final boolean isFrontVisualComponentPickable()
public void setBackVisualComponentPickable(boolean backVisualComponentPickable)
pickable
- True if this node's back visual component should be pickable.public final boolean isBackVisualComponentPickable()
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 ZGroup
renderContext
- The graphics context to use for rendering.protected void computeBounds()
computeBounds
in class ZGroup
public boolean pick(java.awt.geom.Rectangle2D rect, ZSceneGraphPath path)
This first checks the front visual component for picking, then the children, and then the back visual component. However, the visual components can be ignored for picking if they are set to not be pickable.
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, or one of this node's visual components is picked. Else, it will return null.
pick
in class ZGroup
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 ZBounds getFrontVisualComponentBounds()
public ZBounds getFrontVisualComponentGlobalBounds()
public ZBounds getBackVisualComponentBounds()
public ZBounds getBackVisualComponentGlobalBounds()
public ZBounds getShallowBounds()
getShallowBounds
in class ZGroup
public void writeObject(ZObjectOutputStream out) throws java.io.IOException
writeObject
in interface ZSerializable
writeObject
in class ZGroup
out
- The stream that this object writes intopublic void writeObjectRecurse(ZObjectOutputStream out) throws java.io.IOException
writeObjectRecurse
in interface ZSerializable
writeObjectRecurse
in class ZGroup
out
- The stream that this object writes intopublic void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
setState
in interface ZSerializable
setState
in class ZGroup
fieldType
- The fully qualified type of the fieldfieldName
- The name of the fieldfieldValue
- The value of the field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |