|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdiva.graph.BasicNodeController
ptolemy.vergil.basic.LocatableNodeController
This node controller provides interaction techniques for nodes that are locations. This is common when the node has some concept of its graphical location, but does not know about the figure that it is associated with. This class provides the connection between the figure's notion of location and the node's concept of location.
When nodes are drawn, they are automatically placed at the coordinate given by the location. A LocatableNodeDragInteractor is used to update the location of the node as the figure moves.
| Red (johnr) |
| Red (eal) |
| Field Summary | |
static java.awt.Color |
CLASS_ELEMENT_HIGHLIGHT_COLOR
|
| Constructor Summary | |
LocatableNodeController(GraphController controller)
Create an instance associated with the specified graph controller. |
|
| Method Summary | |
protected void |
_drawChildren(java.lang.Object node)
Render the children of the specified node. |
protected boolean |
_hide(java.lang.Object node)
In this base class, return true if the specified node contains an attribute named "_hide". |
protected Figure |
_renderNode(java.lang.Object node)
Render the specified node. |
void |
addNode(java.lang.Object node,
double x,
double y)
Add a node to this graph editor and render it at the given location. |
Figure |
drawNode(java.lang.Object node)
Draw the node at its location. |
double[] |
getLocation(java.lang.Object node)
Return the desired location of this node. |
boolean |
hasLocation(java.lang.Object node)
Return true if the node is associated with a desired location. |
void |
locateFigure(java.lang.Object node)
Move the node's figure to the location specified in the node's semantic object, if that object is an instance of Locatable. |
void |
setLocation(java.lang.Object node,
double[] location)
Set the desired location of this node. |
void |
setSnapResolution(double resolution)
Specify the snap resolution. |
| Methods inherited from class diva.graph.BasicNodeController |
addNode, addNode, addNode, clearNode, drawNode, getController, getNodeInteractor, getNodeRenderer, removeNode, setNodeInteractor, setNodeRenderer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.awt.Color CLASS_ELEMENT_HIGHLIGHT_COLOR
| Constructor Detail |
public LocatableNodeController(GraphController controller)
controller - The graph controller.| Method Detail |
public void addNode(java.lang.Object node,
double x,
double y)
addNode in interface NodeControlleraddNode in class BasicNodeControllerpublic Figure drawNode(java.lang.Object node)
drawNode in interface NodeControllerdrawNode in class BasicNodeControllerpublic double[] getLocation(java.lang.Object node)
public boolean hasLocation(java.lang.Object node)
public void locateFigure(java.lang.Object node)
node - The object to locate.
public void setLocation(java.lang.Object node,
double[] location)
throws IllegalActionException
IllegalActionException - Not thrown in this base class.public void setSnapResolution(double resolution)
resolution - The snap resolution.protected void _drawChildren(java.lang.Object node)
_drawChildren in class BasicNodeControllernode - The node with children to render.protected Figure _renderNode(java.lang.Object node)
_renderNode in class BasicNodeControllernode - The node to render.protected boolean _hide(java.lang.Object node)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||