public class LocatableNodeController extends BasicNodeController
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) |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_decoratable
A flag indicating that the figures associated with this
controller can be decorated to indicate that they are derived.
|
static java.awt.Color |
CLASS_ELEMENT_HIGHLIGHT_COLOR
A fourth argument would this highlight translucent, which would enable
combination with other highlights.
|
| Constructor and Description |
|---|
LocatableNodeController(GraphController controller)
Create an instance associated with the specified graph controller.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addNode, addNode, addNode, clearNode, drawNode, getController, getNodeInteractor, getNodeRenderer, removeNode, setNodeInteractor, setNodeRendererpublic static final java.awt.Color CLASS_ELEMENT_HIGHLIGHT_COLOR
protected boolean _decoratable
public LocatableNodeController(GraphController controller)
controller - The graph controller.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)
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 locationIllegalActionException - 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 BasicNodeControllernode - 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 nodeprotected 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 BasicNodeControllernode - The node to render.