Force-Directed Edge Bundling
|
This class represents the canvas on which the graph is drawn. More...
Inherits JPanel.
Public Member Functions | |
CanvasPanel (MainWindow window) | |
Creates the panel. | |
void | addEdge (int startNodeIndex, int endNodeIndex) |
Adds an Edge to the graph. More... | |
void | addNode (int x, int y) |
Adds a Node to the graph. More... | |
ArrayList< Edge > | getEdges () |
Returns the Edges of the graph. More... | |
ArrayList< Node > | getNodes () |
Returns the Nodes of the graph. More... | |
void | bundleEdges (int stiffness, boolean animate) |
Performs the edge bundling process. More... | |
void | clearAll () |
Clears the canvas and the graph. | |
void | connectAll () |
Connects all Nodes with each other. | |
void | unbundleEdges () |
Unbundles the Edges of the graph. | |
Private Member Functions | |
void | addListeners () |
Adds ActionListeners to the canvas. | |
boolean | clickedEdge (MouseEvent e, Edge edge) |
Checks whether the user clicked on the specified Edge. More... | |
boolean | clickedNode (MouseEvent e, Node node) |
Checks whether the user clicked on the specified Node. More... | |
This class represents the canvas on which the graph is drawn.
Definition at line 20 of file CanvasPanel.java.
void CanvasPanel.addEdge | ( | int | startNodeIndex, |
int | endNodeIndex | ||
) |
void CanvasPanel.addNode | ( | int | x, |
int | y | ||
) |
Adds a Node to the graph.
Definition at line 216 of file CanvasPanel.java.
void CanvasPanel.bundleEdges | ( | int | stiffness, |
boolean | animate | ||
) |
Performs the edge bundling process.
stiffness | The stiffness of the Edges. |
animate | Determines whether the bundling is animated. |
Definition at line 241 of file CanvasPanel.java.
|
private |
Checks whether the user clicked on the specified Edge.
e | The mouse-click event. |
edge | The Edge which is checked. |
Definition at line 345 of file CanvasPanel.java.
|
private |
Checks whether the user clicked on the specified Node.
e | The mouse-click event. |
node | The Node which is checked. |
Definition at line 356 of file CanvasPanel.java.
ArrayList<Edge> CanvasPanel.getEdges | ( | ) |
Returns the Edges of the graph.
Definition at line 224 of file CanvasPanel.java.
ArrayList<Node> CanvasPanel.getNodes | ( | ) |
Returns the Nodes of the graph.
Definition at line 232 of file CanvasPanel.java.