Force-Directed Edge Bundling
 All Classes Functions
CanvasPanel Class Reference

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< EdgegetEdges ()
 Returns the Edges of the graph. More...
 
ArrayList< NodegetNodes ()
 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...
 

Detailed Description

This class represents the canvas on which the graph is drawn.

Author
Kurt Leimer

Definition at line 20 of file CanvasPanel.java.

Member Function Documentation

void CanvasPanel.addEdge ( int  startNodeIndex,
int  endNodeIndex 
)

Adds an Edge to the graph.

Parameters
startNodeIndexThe index of the start Node of the Edge.
endNodeIndexThe index of the end Node of the Edge.

Definition at line 207 of file CanvasPanel.java.

void CanvasPanel.addNode ( int  x,
int  y 
)

Adds a Node to the graph.

Parameters
xThe x-coordinate of the Node.
yThe y-coordinate of the Node.

Definition at line 216 of file CanvasPanel.java.

void CanvasPanel.bundleEdges ( int  stiffness,
boolean  animate 
)

Performs the edge bundling process.

Parameters
stiffnessThe stiffness of the Edges.
animateDetermines whether the bundling is animated.

Definition at line 241 of file CanvasPanel.java.

boolean CanvasPanel.clickedEdge ( MouseEvent  e,
Edge  edge 
)
private

Checks whether the user clicked on the specified Edge.

Parameters
eThe mouse-click event.
edgeThe Edge which is checked.
Returns
true if the user clicked on the Edge, false otherwise.

Definition at line 345 of file CanvasPanel.java.

boolean CanvasPanel.clickedNode ( MouseEvent  e,
Node  node 
)
private

Checks whether the user clicked on the specified Node.

Parameters
eThe mouse-click event.
nodeThe Node which is checked.
Returns
true if the user clicked on the Node, false otherwise.

Definition at line 356 of file CanvasPanel.java.

ArrayList<Edge> CanvasPanel.getEdges ( )

Returns the Edges of the graph.

Returns
the Edges of the graph.

Definition at line 224 of file CanvasPanel.java.

ArrayList<Node> CanvasPanel.getNodes ( )

Returns the Nodes of the graph.

Returns
the Nodes of the graph.

Definition at line 232 of file CanvasPanel.java.


The documentation for this class was generated from the following file: