Geometry-Based Edge Clustering
 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 ()
 Performs the edge bundling process.
 
void clearAll ()
 Clears the canvas, including the graph and control mesh.
 
void clearMesh ()
 Clears the control mesh.
 
void connectAll ()
 Connects all Nodes with each other.
 
void createMesh (int dx, int dy)
 Performs the automatic control mesh creation. More...
 
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...
 
double gaussProb (double x)
 Calculates the probability of x according to the standard normal distribution. More...
 
ArrayList< Double > kde (ArrayList< Double > angles)
 Calculates the distribution of the specified angles with kernel density estimation. More...
 
ArrayList< EdgecreateConstraints (ArrayList< GridRegion > regions)
 Automatically creates the constraints for the Constrained Delaunay Triangulation according to the specified regions. More...
 
ArrayList< GridRegioncreateRegions (int width, int height, GridCell[][] cellArray)
 Creates the GridRegions which are used for the automatic mesh generation. More...
 
GridCell createCell (int x, int y, int dx, int dy)
 Creates a GridCell with a primary direction of the Edges that pass through. More...
 

Detailed Description

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

Author
Kurt Leimer

Definition at line 26 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 337 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 346 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 498 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 509 of file CanvasPanel.java.

GridCell CanvasPanel.createCell ( int  x,
int  y,
int  dx,
int  dy 
)
private

Creates a GridCell with a primary direction of the Edges that pass through.

Parameters
xThe cell array index in x-direction.
yThe cell array index in y-direction.
dxThe size of the cell in x-direction.
dyThe size of the cell in y-direction.
Returns
a GridCell with a primary direction.

Definition at line 647 of file CanvasPanel.java.

ArrayList<Edge> CanvasPanel.createConstraints ( ArrayList< GridRegion regions)
private

Automatically creates the constraints for the Constrained Delaunay Triangulation according to the specified regions.

Parameters
regionsThe regions used for the creation of the constraints.
Returns
The constraints for the Constrained Delaunay Triangulation.

Definition at line 553 of file CanvasPanel.java.

void CanvasPanel.createMesh ( int  dx,
int  dy 
)

Performs the automatic control mesh creation.

Parameters
dxThe cell size in x-direction.
dyThe cell size in y-direction.

Definition at line 437 of file CanvasPanel.java.

ArrayList<GridRegion> CanvasPanel.createRegions ( int  width,
int  height,
GridCell  cellArray[][] 
)
private

Creates the GridRegions which are used for the automatic mesh generation.

Parameters
widthThe width of the cell array.
heightThe height of the cell array.
cellArrayThe cell array which contains GridCells with a primary direction.
Returns
the GridRegions which are used for the automatic mesh generation.

Definition at line 586 of file CanvasPanel.java.

double CanvasPanel.gaussProb ( double  x)
private

Calculates the probability of x according to the standard normal distribution.

Parameters
xThe value whose probability is calculated.
Returns
the probability of x.

Definition at line 519 of file CanvasPanel.java.

ArrayList<Edge> CanvasPanel.getEdges ( )

Returns the Edges of the graph.

Returns
the Edges of the graph.

Definition at line 354 of file CanvasPanel.java.

ArrayList<Node> CanvasPanel.getNodes ( )

Returns the Nodes of the graph.

Returns
the Nodes of the graph.

Definition at line 362 of file CanvasPanel.java.

ArrayList<Double> CanvasPanel.kde ( ArrayList< Double >  angles)
private

Calculates the distribution of the specified angles with kernel density estimation.

Parameters
anglesThe angles whose distributions is calculated.
Returns
the distribution of the specified angles.

Definition at line 528 of file CanvasPanel.java.


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