public abstract class AbstractGraphController extends Object implements GraphController
Constructor and Description |
---|
AbstractGraphController()
Construct a graph controller without a parent
pane.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Object edge,
Object node,
int end,
double x,
double y)
Add an edge to this graph editor and render it
from the given tail node to an autonomous site at the
given location.
|
void |
addEdge(Object edge,
Object tail,
Object head)
Add an edge to this graph between the given tail and head
nodes.
|
void |
addGraphViewListener(GraphViewListener l) |
void |
addNode(Object node)
Add the node to this graph editor and place it whereever convenient.
|
void |
addNode(Object node,
double x,
double y)
Add the node to this graph editor and render it
at the given location.
|
void |
addNode(Object node,
Object parent)
Add the node to this graph editor, inside the given parent node
at whatever position is convenient
|
void |
addNode(Object node,
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 |
clear()
Remove all figures from the display
|
void |
clearEdge(Object edge)
Remove the figure for the given edge.
|
void |
clearNode(Object node)
Remove the figure for the given node.
|
void |
dispatch(GraphViewEvent e)
Dispatch the given graph view event to all registered grpah view
listeners.
|
Figure |
drawEdge(Object edge)
Draw the given edge: create a figure, place it in the canvas,
and associate the figure with the edge.
|
Figure |
drawNode(Object node)
Draw the given node: create a figure, place it in the canvas,
and associate the figure with the node.
|
Figure |
drawNode(Object node,
Object parent)
Draw the given node: create a figure, place it in the figure of the
given parent node,
and associate the figure with the node.
|
abstract EdgeController |
getEdgeController(Object edge)
Given an edge, return the controller associated with that
edge.
|
Figure |
getFigure(Object semanticObj)
Return the figure associated with the given
semantic object (node or edge), or null
if there is no association.
|
GraphModel |
getGraphModel()
Return the graph being viewed.
|
GraphPane |
getGraphPane()
Return the graphics pane of this controller cast as a GraphPane.
|
abstract NodeController |
getNodeController(Object node)
Given an node, return the controller associated with that
node.
|
SelectionModel |
getSelectionModel()
Get the default selection model
|
protected abstract void |
initializeInteraction()
Initialize all interaction on the graph pane.
|
void |
removeEdge(Object edge)
Remove the given edge.
|
void |
removeGraphViewListener(GraphViewListener l)
Remove the given view listener.
|
void |
removeNode(Object node)
Remove the given node.
|
void |
rerender()
Render the current graph again by recreating the figures for all
nodes and edges, but do not alter the connectivity in the graph.
|
void |
rerenderEdge(Object edge)
Rerender the given edge by replacing its figure with a new figure.
|
void |
rerenderNode(Object node)
Rerender the given node by replacing its figure with a new
figure.
|
void |
setFigure(Object semanticObj,
Figure f)
Set the figure associated with the given semantic object (node
or edge).
|
void |
setGraphModel(GraphModel model)
Set the graph being viewed.
|
void |
setGraphPane(GraphPane pane)
Set the graph pane.
|
void |
setSelectionModel(SelectionModel m)
Set the default selection model.
|
public AbstractGraphController()
public void addEdge(Object edge, Object node, int end, double x, double y)
addEdge
in interface GraphController
GraphException
- If the connector target cannot return a
valid site on the node's figure.public void addEdge(Object edge, Object tail, Object head)
addEdge
in interface GraphController
public void addGraphViewListener(GraphViewListener l)
addGraphViewListener
in interface GraphController
public void addNode(Object node)
addNode
in interface GraphController
public void addNode(Object node, double x, double y)
addNode
in interface GraphController
public void addNode(Object node, Object parent)
addNode
in interface GraphController
public void addNode(Object node, Object parent, double x, double y)
addNode
in interface GraphController
public void clear()
clear
in interface GraphController
public void clearEdge(Object edge)
clearEdge
in interface GraphController
public void clearNode(Object node)
clearNode
in interface GraphController
public Figure drawEdge(Object edge)
drawEdge
in interface GraphController
public Figure drawNode(Object node)
drawNode
in interface GraphController
public Figure drawNode(Object node, Object parent)
drawNode
in interface GraphController
public abstract EdgeController getEdgeController(Object edge)
getEdgeController
in interface GraphController
public abstract NodeController getNodeController(Object node)
getNodeController
in interface GraphController
public GraphModel getGraphModel()
getGraphModel
in interface GraphController
public GraphPane getGraphPane()
getGraphPane
in interface GraphController
public Figure getFigure(Object semanticObj)
getFigure
in interface GraphController
public SelectionModel getSelectionModel()
getSelectionModel
in interface GraphController
public void removeEdge(Object edge)
removeEdge
in interface GraphController
public void removeGraphViewListener(GraphViewListener l)
removeGraphViewListener
in interface GraphController
public void removeNode(Object node)
removeNode
in interface GraphController
public void rerender()
rerender
in interface GraphController
public void rerenderEdge(Object edge)
rerenderEdge
in interface GraphController
public void rerenderNode(Object node)
rerenderNode
in interface GraphController
public void setGraphModel(GraphModel model)
setGraphModel
in interface GraphController
public void setFigure(Object semanticObj, Figure f)
setFigure
in interface GraphController
public void setGraphPane(GraphPane pane)
setGraphPane
in interface GraphController
public void setSelectionModel(SelectionModel m)
setSelectionModel
in interface GraphController
public void dispatch(GraphViewEvent e)
dispatch
in interface GraphController
protected abstract void initializeInteraction()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.