Package diva.graph
Class BasicNodeController
- java.lang.Object
-
- diva.graph.BasicNodeController
-
- All Implemented Interfaces:
NodeController
- Direct Known Subclasses:
LocatableNodeController
public class BasicNodeController extends java.lang.Object implements NodeController
A basic node controller implementation, intended for use as a controller for graphs containing only one node type. This class can also be subclassed to control a specific type of node in graphs that have multiple node types.- Version:
- $Id$
- Author:
- Steve Neuendorffer
- Pt.AcceptedRating:
- Red
-
-
Constructor Summary
Constructors Constructor Description BasicNodeController(GraphController controller)Create a new basic controller with default node and edge interactors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_drawChildren(java.lang.Object node)Draw the children of the given node.protected Figure_renderNode(java.lang.Object node)Render the given node using the node renderer.voidaddNode(java.lang.Object node)Given a node, add it to this graph editor and perform a layout on the new node.voidaddNode(java.lang.Object node, double x, double y)Add the node to this graph editor and render it at the given location.voidaddNode(java.lang.Object node, java.lang.Object parent)Add the node to this graph editor, inside the given parent node and place it where convenientvoidaddNode(java.lang.Object node, java.lang.Object parent, double x, double y)Add the node to this graph editor, inside the given parent node and render it at the given location relative to its parent.voidclearNode(java.lang.Object node)Remove the figure for the given node.FiguredrawNode(java.lang.Object node)Render the given node and add the resulting figure to the foreground layer of the graph pane.FiguredrawNode(java.lang.Object node, java.lang.Object parent)Render the given node and add the resulting figure to the given node's figure, which is assumed to be a CompositeFigure in the controller's graph pane.GraphControllergetController()Return the graph controller containing this controller.InteractorgetNodeInteractor()Return the node interactor associated with this controller.NodeRenderergetNodeRenderer()Return the node renderer associated with this controller.voidremoveNode(java.lang.Object node)Remove the node.voidsetNodeInteractor(Interactor interactor)Set the node interactor for this controllervoidsetNodeRenderer(NodeRenderer renderer)Set the node renderer for this controller
-
-
-
Constructor Detail
-
BasicNodeController
public BasicNodeController(GraphController controller)
Create a new basic controller with default node and edge interactors.
-
-
Method Detail
-
addNode
public void addNode(java.lang.Object node)
Given a node, add it to this graph editor and perform a layout on the new node.- Specified by:
addNodein interfaceNodeController
-
addNode
public void addNode(java.lang.Object node, double x, double y)Add the node to this graph editor and render it at the given location.- Specified by:
addNodein interfaceNodeController
-
addNode
public void addNode(java.lang.Object node, java.lang.Object parent)Add the node to this graph editor, inside the given parent node and place it where convenient- Specified by:
addNodein interfaceNodeController
-
addNode
public void addNode(java.lang.Object node, java.lang.Object parent, double x, double y)Add the node to this graph editor, inside the given parent node and render it at the given location relative to its parent.- Specified by:
addNodein interfaceNodeController
-
clearNode
public void clearNode(java.lang.Object node)
Remove the figure for the given node.- Specified by:
clearNodein interfaceNodeController
-
drawNode
public Figure drawNode(java.lang.Object node)
Render the given node and add the resulting figure to the foreground layer of the graph pane. If the node was previously rendered, then infer the new location of the figure from the old.- Specified by:
drawNodein interfaceNodeController
-
drawNode
public Figure drawNode(java.lang.Object node, java.lang.Object parent)
Render the given node and add the resulting figure to the given node's figure, which is assumed to be a CompositeFigure in the controller's graph pane.- Specified by:
drawNodein interfaceNodeController
-
getController
public GraphController getController()
Return the graph controller containing this controller.- Specified by:
getControllerin interfaceNodeController
-
getNodeInteractor
public Interactor getNodeInteractor()
Return the node interactor associated with this controller.- Specified by:
getNodeInteractorin interfaceNodeController
-
getNodeRenderer
public NodeRenderer getNodeRenderer()
Return the node renderer associated with this controller.- Specified by:
getNodeRendererin interfaceNodeController
-
removeNode
public void removeNode(java.lang.Object node)
Remove the node.- Specified by:
removeNodein interfaceNodeController
-
setNodeInteractor
public void setNodeInteractor(Interactor interactor)
Set the node interactor for this controller- Specified by:
setNodeInteractorin interfaceNodeController
-
setNodeRenderer
public void setNodeRenderer(NodeRenderer renderer)
Set the node renderer for this controller- Specified by:
setNodeRendererin interfaceNodeController
-
_renderNode
protected Figure _renderNode(java.lang.Object node)
Render the given node using the node renderer. Set the interactor of the resulting figure to the node interactor.
-
_drawChildren
protected void _drawChildren(java.lang.Object node)
Draw the children of the given node.
-
-