|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdiva.graph.BasicNodeController
public class BasicNodeController
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.
| Red |
| Field Summary | |
|---|---|
private GraphController |
_controller
|
private Interactor |
_interactor
|
private NodeRenderer |
_renderer
|
| Constructor Summary | |
|---|---|
BasicNodeController(GraphController controller)
Create a new basic controller with default node and edge interactors. |
|
| Method Summary | |
|---|---|
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. |
void |
addNode(java.lang.Object node)
Given a node, add it to this graph editor and perform a layout on the new node. |
void |
addNode(java.lang.Object node,
double x,
double y)
Add the node to this graph editor and render it at the given location. |
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 |
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. |
void |
clearNode(java.lang.Object node)
Remove the figure for the given node. |
Figure |
drawNode(java.lang.Object node)
Render the given node and add the resulting figure to the foreground layer of the graph pane. |
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. |
GraphController |
getController()
Return the graph controller containing this controller. |
Interactor |
getNodeInteractor()
Return the node interactor associated with this controller. |
NodeRenderer |
getNodeRenderer()
Return the node renderer associated with this controller. |
void |
removeNode(java.lang.Object node)
Remove the node. |
void |
setNodeInteractor(Interactor interactor)
Set the node interactor for this controller |
void |
setNodeRenderer(NodeRenderer renderer)
Set the node renderer for this controller |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Interactor _interactor
private NodeRenderer _renderer
private GraphController _controller
| Constructor Detail |
|---|
public BasicNodeController(GraphController controller)
| Method Detail |
|---|
public void addNode(java.lang.Object node)
addNode in interface NodeController
public void addNode(java.lang.Object node,
double x,
double y)
addNode in interface NodeController
public void addNode(java.lang.Object node,
java.lang.Object parent)
addNode in interface NodeController
public void addNode(java.lang.Object node,
java.lang.Object parent,
double x,
double y)
addNode in interface NodeControllerpublic void clearNode(java.lang.Object node)
clearNode in interface NodeControllerpublic Figure drawNode(java.lang.Object node)
drawNode in interface NodeController
public Figure drawNode(java.lang.Object node,
java.lang.Object parent)
drawNode in interface NodeControllerpublic GraphController getController()
getController in interface NodeControllerpublic Interactor getNodeInteractor()
getNodeInteractor in interface NodeControllerpublic NodeRenderer getNodeRenderer()
getNodeRenderer in interface NodeControllerpublic void removeNode(java.lang.Object node)
removeNode in interface NodeControllerpublic void setNodeInteractor(Interactor interactor)
setNodeInteractor in interface NodeControllerpublic void setNodeRenderer(NodeRenderer renderer)
setNodeRenderer in interface NodeControllerprotected Figure _renderNode(java.lang.Object node)
protected void _drawChildren(java.lang.Object node)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||