|
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
|
+--edu.umd.cs.jazz.ZTransformGroup
|
+--edu.umd.cs.jazz.ZConstraintGroup
|
+--edu.umd.cs.jazz.ZStickyGroup
ZStickyGroup is a constraint node that forces the child to always be rendered at a place dependent on the camera view. There are two types of sticky constraints:
The simplest way to make an object sticky is to use the static makeSticky() method. Alternatively, an application can make one manually by creating a constraint group over a sub-tree that should be sticky. The following code creates a sticky rectangle using this node.
ZRectangle rect;
ZVisualLeaf leaf;
ZStickyGroup sticky;
rect = new ZRectangle(0, 0, 50, 50);
leaf = new ZVisualLeaf(rect);
sticky = new ZStickyGroup(camera, leaf);
layer.addChild(sticky);
| Field Summary | |
static int |
constraintType_DEFAULT
|
static int |
STICKY
The type for a Sticky constraint |
static float |
stickyPointX_DEFAULT
|
static float |
stickyPointY_DEFAULT
|
static int |
STICKYZ
The type for a Sticky Z constraint |
| Fields inherited from class edu.umd.cs.jazz.ZConstraintGroup |
camera |
| Fields inherited from class edu.umd.cs.jazz.ZGroup |
childrenFindable_DEFAULT,
childrenPickable_DEFAULT,
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 | |
ZStickyGroup()
Constructs a new sticky group. |
|
ZStickyGroup(ZCamera camera)
Constructs a new sticky group with a specified camera. |
|
ZStickyGroup(ZCamera camera,
ZNode child)
Constructs a new sticky group with a specified camera that decorates the specified child. |
|
ZStickyGroup(ZNode child)
Constructs a new sticky group that decorates the specified child. |
|
| Method Summary | |
java.lang.Object |
clone()
Duplicates the current node by using the copy constructor. |
java.awt.geom.AffineTransform |
computeStickyTransform()
Computes the Sticky constraint that defines the child to not move even as the camera view changes. |
protected java.awt.geom.AffineTransform |
computeStickyZTransform()
Computes the Sticky Z constraint that defines the child to keep a constant magnification even as the camera magnification changes. |
java.awt.geom.AffineTransform |
computeTransform()
Computes the constraint that defines the child to not move even as the camera view changes. |
java.lang.String |
dump()
Generate a string that represents this object for debugging. |
void |
duplicateObject(ZStickyGroup refNode)
Copies all object information from the reference object into the current object. |
int |
getConstraintType()
Determine the type of constraint that this node implements. |
java.awt.Dimension |
getStickyPoint()
Returns a Dimension specifying a point on the sticky object that remains fixed as the scene is zoomed (for StickyZ only). |
static ZStickyGroup |
makeSticky(ZNode node,
ZCamera camera,
int constraintType)
Make the specified node sticky by adding a sticky node above the specified node. |
static void |
makeUnSticky(ZNode node)
Make the specified node unsticky. |
void |
setConstraintType(int constraintType)
Set the type of constraint that this node implements. |
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 |
setStickyPoint(float x,
float y)
Specifies a point on the unit square of the sticky object that will remain fixed when the scene is zoomed (for StickyZ only). |
void |
writeObject(ZObjectOutputStream out)
Write out all of this object's state. |
| Methods inherited from class edu.umd.cs.jazz.ZConstraintGroup |
duplicateObject,
finalize,
getCamera,
init,
setCamera,
updateTransform,
writeObjectRecurse |
| Methods inherited from class edu.umd.cs.jazz.ZTransformGroup |
addTransformListener,
animate,
animate,
animate,
animate,
computeBounds,
computeInverseTransform,
computeScale,
concatenate,
duplicateObject,
fireTransformEvent,
getInverseTransform,
getLocalToGlobalTransform,
getMatrix,
getRotation,
getScale,
getTransform,
getTranslateX,
getTranslateY,
getTranslation,
lerp,
lerp,
pick,
position,
position,
preConcatenate,
removeTransformListener,
render,
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.ZGroup |
addChild,
addGroupListener,
duplicateObject,
fireGroupEvent,
getChild,
getChildren,
getChildrenFindable,
getChildrenIterator,
getChildrenPickable,
getNumChildren,
hasOneChild,
indexOf,
insertAbove,
lower,
lowerTo,
raise,
raiseTo,
remove,
removeChild,
removeGroupListener,
setChildrenFindable,
setChildrenPickable,
setHasOneChild,
trimToSize,
updateVolatility |
| Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
duplicateObject,
getBounds,
getVolatileBounds,
reshape,
setVolatileBounds |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int STICKY
public static final int STICKYZ
public static float stickyPointX_DEFAULT
public static float stickyPointY_DEFAULT
public static int constraintType_DEFAULT
| Constructor Detail |
public ZStickyGroup()
public ZStickyGroup(ZCamera camera)
camera - The camera the node is related to.public ZStickyGroup(ZNode child)
child - The child that should go directly below this node.
public ZStickyGroup(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 duplicateObject(ZStickyGroup refNode)
refNode - The reference node to copypublic java.lang.Object clone()
ZNode.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)
public static ZStickyGroup makeSticky(ZNode node,
ZCamera camera,
int constraintType)
If the node has a transform decorator, then the sticky node is added above the transform node.
node - The node to make stickycamera - The camera that the node is sticky relative toconstraintType - The constraint type for this node (STICKY or STICKYZ).public static void makeUnSticky(ZNode node)
node - The node to make unsticky
public void setStickyPoint(float x,
float y)
x - X coordinate of the sticky point of the sticky object.y - Y coordinate of the sticky point of the sticky object.public java.awt.Dimension getStickyPoint()
public void setConstraintType(int constraintType)
constraintType - The constraint type for this node.public int getConstraintType()
public java.awt.geom.AffineTransform computeTransform()
public java.awt.geom.AffineTransform computeStickyTransform()
protected java.awt.geom.AffineTransform computeStickyZTransform()
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 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 | |||||||||