|
|||||||||
| 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
ZVisualComponentDecorator is the base class used to create a visual component decorator. Normally, a node has a single visual component. However, with the use of this class, it is possible to form a linear chain of visual components. Typically the last element of the chain represents the primary visual component that gets drawn, and all the other elements of the chain are decorators that somehow modify the primary visual component. Two standard decorators that are part of Jazz are ZSelectionDecorator and ZLinkDecorator. This class defines the minimum components of a visual component decorator, and will typically be extended by an application for any specific decorator. This class defines a child pointer to reference the next element of the chain, implements child manipulation methods, and wraps the paint, computeLocalBounds, pick and io methods.
| Field Summary | |
protected ZVisualComponent |
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 | |
ZVisualComponentDecorator()
Constructs a new ZVisualComponentDecorator |
|
ZVisualComponentDecorator(ZVisualComponent c)
Constructs a new ZVisualComponentDecorator that decorates the specified child. |
|
ZVisualComponentDecorator(ZVisualComponentDecorator dec)
Constructs a new ZVisualComponentDecorator that is a copy of the specified decorator component (i.e., a "copy constructor"). |
|
| Method Summary | |
java.lang.Object |
clone()
Duplicates the current visual component decorator by using the copy constructor. |
protected void |
computeLocalBounds()
Calls the child's computeLocalBounds method. |
ZVisualComponent |
getChild()
|
void |
insertAbove(ZVisualComponent c)
Insert this decorator in the chain above the specified child visual component. |
void |
paint(ZRenderContext renderContext)
Calls the child's paint method |
boolean |
pick(java.awt.geom.Rectangle2D rect)
Returns true if the specified rectangle is on the child. |
void |
remove()
Remove this decorator from the visual component chain. |
void |
setChild(ZVisualComponent v)
|
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(ZVisualComponent c)
|
java.lang.String |
toString()
Generate a string that represents this object for debugging. |
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.ZVisualComponent |
damage,
damage,
findNode,
findVisualComponent,
getLocalBounds,
getParent,
isFindable,
isPickable,
isSelected,
isVolatile,
pickBounds,
select,
select,
setFindable,
setParent,
setPickable,
setSelected,
setVolatile,
unselect,
updateBounds,
updateChildBounds,
updateLocalBounds,
updateVolatility |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected ZVisualComponent child
| Constructor Detail |
public ZVisualComponentDecorator()
public ZVisualComponentDecorator(ZVisualComponentDecorator dec)
public ZVisualComponentDecorator(ZVisualComponent c)
child - The child that should go directly below this decorator.| Method Detail |
public java.lang.Object clone()
ZVisualComponentDecorator(ZVisualComponentDecorator)public void insertAbove(ZVisualComponent c)
c - the child visual component that this decorator should go above.public void remove()
public ZVisualComponent getChild()
public void setChild(ZVisualComponent v)
public void setVisualComponent(ZVisualComponent c)
public void paint(ZRenderContext renderContext)
g2 - The graphics context to paint into.protected void computeLocalBounds()
public boolean pick(java.awt.geom.Rectangle2D rect)
rect - Pick rectangle in object coordinates.public java.lang.String toString()
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 | ||||||||