|
||||||||||
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.ZTransformGroup | +--edu.umd.cs.jazz.ZConstraintGroup
ZConstraintGroup is a transform group that changes its transform based on a computation defined in a specified method. Every time the camera view is changed, the method is called, recomputing the transform. Thus, depending on the algorithm chosen, various dynamic behaviors can be created.
Sub-classes must override the ZTransformGroup.getTransform()
method of ZTransformGroup.getTransform()
to define a new transform.
This class stores a reference
to a camera so, for example, a sub-class could define a constraint
dependent on the camera so that the children move whenever the camera view changes.
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.
ZStickyGroup
, Serialized FormField Summary | |
protected ZCamera |
camera
The camera the constraint is related to |
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 | |
ZConstraintGroup()
Constructs a new constraint group. |
|
ZConstraintGroup(ZCamera camera)
Constructs a new constraint group with a specified camera. |
|
ZConstraintGroup(ZCamera camera,
ZNode child)
Constructs a new constraint group with a specified camera that decorates the specified child. |
|
ZConstraintGroup(ZNode child)
Constructs a new constraint group that decorates the specified child. |
Method Summary | |
java.awt.geom.AffineTransform |
computeTransform()
Computes the constraint that defines the child to not move even as the camera view changes. |
void |
finalize()
Disposes of this constraint group when it is no longer used. |
ZCamera |
getCamera()
Get the camera that this node is related to. |
protected void |
init(ZCamera camera)
Internal method to help node construction. |
void |
setCamera(ZCamera camera)
Set the camera that this node is related to |
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 |
updateObjectReferences(ZObjectReferenceTable objRefTable)
Called to update internal object references after a clone operation by ZSceneGraphObject.clone() . |
protected void |
updateTransform()
Internal method to recompute the constraint transform. |
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.ZTransformGroup |
addTransformListener, animate, animate, animate, animate, computeBounds, computeInverseTransform, computeScale, concatenate, dump, duplicateObject, getInverseTransform, getLocalToGlobalTransform, getMatrix, getRotation, getScale, getTransform, getTransformReference, getTranslateX, getTranslateY, getTranslation, lerp, pick, position, position, preConcatenate, removeTransformListener, render, repaint, repaint, rotate, rotate, rotate, rotate, scale, scale, scale, scale, setRotation, setRotation, setRotation, setRotation, setScale, setScale, setScale, setScale, setTransform, setTransform, setTranslateX, setTranslateY, setTranslation, setTranslation, transform, transform, translate, translate |
Methods inherited from class edu.umd.cs.jazz.ZNode |
addClientProperty, addNodeListener, editor, getClientProperty, getGlobalBounds, getGlobalToLocalTransform, getParent, getRoot, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, putClientProperty, raise, raiseTo, remove, repaint, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, setSelectable, updateBounds, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ZCamera camera
Constructor Detail |
public ZConstraintGroup()
setCamera(edu.umd.cs.jazz.ZCamera)
public ZConstraintGroup(ZCamera camera)
camera
- The camera the node is related to.public ZConstraintGroup(ZNode child)
child
- The child that should go directly below this node.public ZConstraintGroup(ZCamera camera, ZNode child)
camera
- The camera the node is related to.child
- The child that should go directly below this node.Method Detail |
public void finalize()
finalize
in class java.lang.Object
protected void init(ZCamera camera)
protected void updateObjectReferences(ZObjectReferenceTable objRefTable)
ZSceneGraphObject.clone()
.updateObjectReferences
in class ZNode
ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)
public java.awt.geom.AffineTransform computeTransform()
protected void updateTransform()
public ZCamera getCamera()
public void setCamera(ZCamera camera)
camera
- The new camerapublic void writeObject(ZObjectOutputStream out) throws java.io.IOException
writeObject
in class ZTransformGroup
out
- The stream that this object writes intopublic void writeObjectRecurse(ZObjectOutputStream out) throws java.io.IOException
writeObjectRecurse
in class ZTransformGroup
out
- The stream that this object writes intopublic void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
setState
in class ZTransformGroup
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 |