public abstract class EdgeController extends Object
Edge controllers assume that each edge is represented by a single Connector on the canvas. (If the edge is composite, then of course it's Connector also has sub-connectors, corresponding to child nodes and edges.) The mapping between connectors and edge objects is set up in the same manner as NodeController (@see NodeController).
This class has one abstract method which must be implemented by application-specific subclasses, renderEdge(). This method creates a Figure given a edge. A second method, drawEdgeChildren(), should be overridden by any subclass that manages composite edges.
Finally, concrete subclasses that want to change the default interactor will do so in the subclass' constructor. Subclass constructors must always call super() to ensure that the controller is properly initialized.
Modifier and Type | Class and Description |
---|---|
protected class |
EdgeController.EdgeDropper
An inner class that handles interactive changes to connectivity.
|
protected class |
EdgeController.EdgeTarget
An inner class that is used as the target for connectors
|
Constructor and Description |
---|
EdgeController(GraphController controller)
Create a new edge controller with basic interaction.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Object edge,
Object parent)
Add an edge that to the graph, and draw it on the canvas.
|
void |
addEdge(Object edge,
Object parent,
Object tail,
Object head)
Add an edge to the model and render it on the canvas.
|
void |
bind(Object edge,
Connector connector)
Create or overwrite a binding from an edge to a connector.
|
void |
drawEdge(Object edge,
Object parent,
Site tailSite,
Site headSite)
Draw the edge inside the given parent, and between the
two given sites.
|
void |
drawEdgeChildren(Object parent,
Figure container)
Draw the children of the given edge.
|
Connector |
getConnector(Object node)
Get the connector corresponding to the given edge.
|
ConnectorTarget |
getConnectorTarget()
Get the target used to find sites on nodes to connect to.
|
GraphController |
getController()
Get the graph controller that this controller is contained in.
|
Interactor |
getEdgeInteractor()
Get the interactor given to edge figures.
|
void |
removeEdge(Object edge)
Remove the given edge, and its associated figure.
|
abstract Connector |
renderEdge(Object edge,
Object parent,
FigureContainer container,
Site tailSite,
Site headSite)
Render a visual representation of the given edge, between the given
head and tail sites, and add it to the given figure container.
|
void |
setConnectorTarget(ConnectorTarget t)
Set the target used to find sites on nodes to connect to.
|
void |
setEdgeInteractor(Interactor interactor)
Set the interactor given to edge figures.
|
void |
setHead(Object edge,
Object head)
Set the head of an edge to the given node.
|
void |
setTail(Object edge,
Object tail)
Set the tail of an edge to the given node.
|
void |
unbind(Object edge,
Connector connector)
Remove a binding from an edge to a connector.
|
void |
undrawEdge(Object edge)
Remove the figure associated with the given edge.
|
public EdgeController(GraphController controller)
public void addEdge(Object edge, Object parent)
public void addEdge(Object edge, Object parent, Object tail, Object head)
public void bind(Object edge, Connector connector)
public void drawEdge(Object edge, Object parent, Site tailSite, Site headSite)
public void drawEdgeChildren(Object parent, Figure container)
public ConnectorTarget getConnectorTarget()
public GraphController getController()
public Connector getConnector(Object node)
public Interactor getEdgeInteractor()
public void removeEdge(Object edge)
public void setConnectorTarget(ConnectorTarget t)
public void setEdgeInteractor(Interactor interactor)
public abstract Connector renderEdge(Object edge, Object parent, FigureContainer container, Site tailSite, Site headSite)
public void setHead(Object edge, Object head)
public void setTail(Object edge, Object tail)
public void unbind(Object edge, Connector connector)
public void undrawEdge(Object edge)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.