edu.umd.cs.jazz.component
Class ZLinkDecorator
java.lang.Object
|
+--edu.umd.cs.jazz.scenegraph.ZVisualComponent
|
+--edu.umd.cs.jazz.scenegraph.ZVisualComponentDecorator
|
+--edu.umd.cs.jazz.component.ZLinkDecorator
- public class ZLinkDecorator
- extends ZVisualComponentDecorator
- implements ZSerializable
ZLinkDecorator is a ZVisualComponent decorator that creates a spatial hyperlink from this
visual component chain to somewhere else.
It can link to a ZNode, or to a specific bounds on the scenegraph. It has
methods to visually show that there is a link (typically used by an application when the user
mouses over the visual component), and to follow a link.
ZLinkDecorator indicates the link by simply drawing an arrowed line from the source
to the destination of the link. Applications should extend this class and replace the
show() method to make a different visual indication of the link.
- See Also:
ZVisualComponent
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,
transformChanged,
unselect,
updateBounds,
updateChildBounds,
updateLocalBounds,
updateVolatility |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
LINK_ANIMATION_TIME
protected static final int LINK_ANIMATION_TIME
DEFAULT_CONNECTOR_WIDTH
protected static final int DEFAULT_CONNECTOR_WIDTH
nodeColor
protected static java.awt.Color nodeColor
boundsColor
protected static java.awt.Color boundsColor
destNode
protected ZNode destNode
destBounds
protected java.awt.geom.Rectangle2D destBounds
connector
protected ZPolyline connector
connectorNode
protected ZNode connectorNode
xp
protected float[] xp
yp
protected float[] yp
ZLinkDecorator
public ZLinkDecorator()
- Constructs a new ZLinkDecorator
ZLinkDecorator
public ZLinkDecorator(ZNode src)
ZLinkDecorator
public ZLinkDecorator(ZLinkDecorator link)
- Constructs a new ZLinkDecorator that is a duplicate of the reference link, i.e., a "copy constructor"
- Parameters:
link
- Reference link
clone
public java.lang.Object clone()
- Duplicates the current ZLinkDecorator by using the copy constructor.
See the copy constructor comments for complete information about what is duplicated.
- Overrides:
- clone in class ZVisualComponentDecorator
- See Also:
ZLinkDecorator(ZLinkDecorator)
remove
public void remove()
- Remove this decorator from the visual component chain.
- Overrides:
- remove in class ZVisualComponentDecorator
setSrc
public void setSrc(ZNode src)
setDest
public void setDest(ZNode dest)
setDest
public void setDest(java.awt.geom.Rectangle2D bounds)
updateConnectorPts
public void updateConnectorPts()
setSrcPt
protected void setSrcPt(float x,
float y)
setDestPt
public void setDestPt(float x,
float y)
updateConnectorWidth
public void updateConnectorWidth(ZCamera camera)
show
public void show(ZCamera camera)
createConnector
public ZPolyline createConnector()
hide
public void hide()
follow
public void follow(ZSurface surface)
setState
public 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.
After the object is created with its default no-arg constructor,
this method will be called on the object once for each bit of state
that was written out through calls to ZObjectOutputStream.writeState()
within the writeObject method.
- Specified by:
- setState in interface ZSerializable
- Parameters:
fieldType
- The fully qualified type of the fieldfieldName
- The name of the fieldfieldValue
- The value of the field- Overrides:
- setState in class ZVisualComponentDecorator
writeObject
public void writeObject(ZObjectOutputStream out)
throws java.io.IOException
- Write out all of this object's state.
- Specified by:
- writeObject in interface ZSerializable
- Parameters:
out
- The stream that this object writes into- Overrides:
- writeObject in class ZVisualComponentDecorator
writeObjectRecurse
public void writeObjectRecurse(ZObjectOutputStream out)
throws java.io.IOException
- Specify which objects this object references in order to write out the scenegraph properly
- Specified by:
- writeObjectRecurse in interface ZSerializable
- Parameters:
out
- The stream that this object writes into- Overrides:
- writeObjectRecurse in class ZVisualComponentDecorator