|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--edu.umd.cs.jazz.scenegraph.ZVisualComponent
|
+--edu.umd.cs.jazz.scenegraph.ZVisualComponentDecorator
|
+--edu.umd.cs.jazz.component.ZConstraintDecorator
ZConstraintDecorator is a ZVisualComponent decorator that applies a simple constraint to the child that modifies the transform, effectively controlling where it is in space. The constraint can be dependent on the camera so that the child moves whenever the camera view changes. A subclass must define the constraint that specifies the relationship between the child and the camera.
computeTransform()| Field Summary | |
protected ZCamera |
camera
The camera the child is related to |
| Fields inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponentDecorator |
child |
| Fields inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponent |
cacheVolatile,
findable,
findable_DEFAULT,
isVolatile,
localBounds,
localBoundsDirty,
parent,
pickable,
pickable_DEFAULT,
selected |
| Constructor Summary | |
ZConstraintDecorator()
Constructs a new constraint decorator This constructor does not specify a camera to be used in calculating the constraint. |
|
ZConstraintDecorator(ZCamera camera)
Constructs a new constraint decorator with a specified camera. |
|
ZConstraintDecorator(ZCamera camera,
ZVisualComponent child)
Constructs a new constraint decorator with a specified camera that decorates the specified child. |
|
ZConstraintDecorator(ZConstraintDecorator constraint)
Constructs a new ZConstraintDecorator that is a duplicate of the reference one, i.e., a "copy constructor" |
|
| Method Summary | |
void |
applyInverseTransform()
Applies the inverse of the constraint transform to the associated node of this decorator. |
void |
applyTransform()
Applies the constraint transform to the associated node of this decorator. |
java.lang.Object |
clone()
Duplicates the current ZConstraintDecorator by using the copy constructor. |
protected void |
computeLocalBounds()
Compute the bounds based on the child's bounds - but modified according to the constraint. |
protected java.awt.geom.AffineTransform |
computeTransform()
This defines the constraint that specifies where the child gets rendered. |
ZCamera |
getCamera()
Get the camera that this component is related to. |
void |
insertAbove(ZVisualComponent c)
Overrides the method to insert this decorator into the decorator chain so that the volatility of the component will be updated. |
boolean |
isVolatile()
All constrained objects are volatile - their bounds change depending on the particular constraint, and thus must not be cached. |
void |
paint(ZRenderContext renderContext)
Paints the child, but applies the constraint so that it appears in the right place. |
boolean |
pick(java.awt.geom.Rectangle2D rect)
Returns true if the child is picked. |
void |
remove()
Overrides the method to remove this decorator from the decorator chain so that the volatility of the component will be updated. |
void |
setCamera(ZCamera camera)
Get the camera that this component is related to |
void |
setParent(ZScenegraphObject aParent)
Overrides the method to remove this decorator from the decorator chain so that the volatility of the component will be updated. |
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 |
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.scenegraph.ZVisualComponentDecorator |
getChild,
setChild,
setVisualComponent,
toString |
| Methods inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponent |
damage,
damage,
findNode,
findVisualComponent,
getLocalBounds,
getParent,
isFindable,
isPickable,
isSelected,
pickBounds,
select,
select,
setFindable,
setPickable,
setSelected,
setVolatile,
transformChanged,
unselect,
updateBounds,
updateChildBounds,
updateLocalBounds,
updateVolatility |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected ZCamera camera
| Constructor Detail |
public ZConstraintDecorator()
setCamera(edu.umd.cs.jazz.scenegraph.ZCamera)public ZConstraintDecorator(ZCamera camera)
camera - The camera the component is related to.
public ZConstraintDecorator(ZCamera camera,
ZVisualComponent child)
camera - The camera the component is related to.child - The child that should go directly below this decorator.public ZConstraintDecorator(ZConstraintDecorator constraint)
constraint - Reference constraint decorator| Method Detail |
public java.lang.Object clone()
ZConstraintDecorator(ZConstraintDecorator)public ZCamera getCamera()
public void setCamera(ZCamera camera)
camera - The new camerapublic boolean isVolatile()
public void insertAbove(ZVisualComponent c)
public void remove()
public void setParent(ZScenegraphObject aParent)
public boolean pick(java.awt.geom.Rectangle2D rect)
renderContext - The render context to paint into.public void paint(ZRenderContext renderContext)
renderContext - The render context to paint into.protected void computeLocalBounds()
protected java.awt.geom.AffineTransform computeTransform()
When sub-classes define this, they must carefully consider the chain of transforms that may have been applied to the current graphics. The transform that this method returns is concatenated to the current graphics transform. The current graphics transform typically contains a sequence of transforms (camera transform, node 1 transform, node 2 transform, ...).
For example, if the current transform is: [C T1 T2], and you want to create a sticky object by undoing the camera transform, you must concatenate [T2inv T1inv Cinv T1 T2] because concatenating that onto the current transform results in [T1 T2].
public void applyInverseTransform()
public void applyTransform()
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
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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||