|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.graph.BasicNodeController
ptolemy.vergil.basic.LocatableNodeController
public class 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 | |
---|---|
protected boolean |
_decoratable
A flag indicating that the figures associated with this controller can be decorated to indicate that they are derived. |
private LocatableNodeDragInteractor |
_dragInteractor
The drag interactor, which is remembered so we can change the snap resolution. |
static java.awt.Color |
CLASS_ELEMENT_HIGHLIGHT_COLOR
A fourth argument would this highlight translucent, which would enable combination with other highlights. |
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 static CompositeFigure |
_getCompositeFigure(Figure nf)
Get the CompositeFigure from the given Figure. |
protected boolean |
_hide(java.lang.Object node)
In this base class, return true if the specified node contains a parameter named "_hide" with value true or an attribute that is not a parameter named "_hide". |
protected boolean |
_isPropertySet(NamedObj object,
java.lang.String name)
Return true if the property of the specified name is set for the specified object. |
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 final java.awt.Color CLASS_ELEMENT_HIGHLIGHT_COLOR
protected boolean _decoratable
private LocatableNodeDragInteractor _dragInteractor
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 NodeController
addNode
in class BasicNodeController
public Figure drawNode(java.lang.Object node)
drawNode
in interface NodeController
drawNode
in class BasicNodeController
public double[] getLocation(java.lang.Object node)
node
- The node.
setLocation(Object, double[])
public boolean hasLocation(java.lang.Object node)
node
- The node.
public void locateFigure(java.lang.Object node)
node
- The object to locate.public void setLocation(java.lang.Object node, double[] location) throws IllegalActionException
node
- The nodelocation
- The location
IllegalActionException
- Not thrown in this base class.getLocation(Object)
public void setSnapResolution(double resolution)
resolution
- The snap resolution.protected void _drawChildren(java.lang.Object node)
_drawChildren
in class BasicNodeController
node
- The node with children to render.protected static CompositeFigure _getCompositeFigure(Figure nf)
nf
- The figure that should be a CompositeFigure itself, or be a
TerminalFigure whose getFigure() method returns a CompositeFigure.
protected boolean _hide(java.lang.Object node)
node
- The node
protected boolean _isPropertySet(NamedObj object, java.lang.String name)
object
- The object.name
- The property name.
protected Figure _renderNode(java.lang.Object node)
_renderNode
in class BasicNodeController
node
- The node to render.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |