mxGraph
|
Fast organic layout algorithm. More...
Public Member Functions | |
mxFastOrganicLayout (mxGraph graph) | |
Constructs a new fast organic layout for the specified graph. More... | |
bool | IsCellIgnored (Object cell) |
Returns true if the given cell should be ignored by the layout algorithm. This implementation returns false if the cell is a vertex and has at least one connected edge. More... | |
void | move (Object cell, double x, double y) |
Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. index) so that the outcome of the layou will position the vertex as close to the point (x, y) as possible. More... | |
void | execute (Object parent) |
Executes the fast organic layout. More... | |
Protected Member Functions | |
void | reduceTemperature () |
Reduces the temperature of the layout from an initial setting in a linear fashion to zero. More... | |
void | calcPositions () |
Takes the displacements calculated for each cell and applies them to the local cache of cell positions. Limits the displacement to the current temperature. More... | |
void | calcAttraction () |
Calculates the attractive forces between all laid out nodes linked by edges More... | |
void | calcRepulsion () |
Calculates the repulsive forces between all laid out nodes More... | |
Protected Attributes | |
mxGraph | graph |
Holds the enclosing graph. More... | |
double | forceConstant = 50 |
The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. The value equates to the average radius there is of free space around each node. Default is 50. More... | |
double | forceConstantSquared = 0 |
Cache of forceConstant^2 for performance. More... | |
double | minDistanceLimit = 2 |
Minimal distance limit. Default is 2. Prevents of dividing by zero. More... | |
double | minDistanceLimitSquared = 0 |
Cached version of minDistanceLimit squared. More... | |
double | initialTemp = 200 |
Start value of temperature. Default is 200. More... | |
double | temperature = 0 |
Temperature to limit displacement at later stages of layout. More... | |
int | maxIterations = 0 |
Total number of iterations to run the layout though. More... | |
int | iteration = 0 |
Current iteration count. More... | |
Object[] | vertexArray |
An array of all vertices to be laid out. More... | |
double[] | dispX |
An array of locally stored X co-ordinate displacements for the vertices. More... | |
double[] | dispY |
An array of locally stored Y co-ordinate displacements for the vertices. More... | |
double[][] | cellLocation |
An array of locally stored co-ordinate positions for the vertices. More... | |
double[] | radius |
The approximate radius of each cell, nodes only. More... | |
double[] | radiusSquared |
The approximate radius squared of each cell, nodes only. More... | |
bool[] | isMoveable |
Array of booleans representing the movable states of the vertices. More... | |
int[][] | neighbours |
Local copy of cell neighbours. More... | |
bool | allowedToRun = true |
Boolean flag that specifies if the layout is allowed to run. If this is set to false, then the layout exits in the following iteration. More... | |
Dictionary< object, int > | indices = new Dictionary<object, int>() |
Maps from vertices to indices. More... | |
Random | random = new Random() |
Random number generator. More... | |
Properties | |
bool | IsAllowedToRun [get, set] |
Flag to stop a running layout run. More... | |
int | MaxIterations [get, set] |
Maximum number of iterations. More... | |
double | ForceConstant [get, set] |
Force constant to be used for the springs. More... | |
double | MinDistanceLimit [get, set] |
Minimum distance between nodes. More... | |
double | InitialTemp [get, set] |
Initial temperature. More... | |
Fast organic layout algorithm.
|
inline |
Constructs a new fast organic layout for the specified graph.
graph |
|
inlineprotected |
Calculates the attractive forces between all laid out nodes linked by edges
|
inlineprotected |
Takes the displacements calculated for each cell and applies them to the local cache of cell positions. Limits the displacement to the current temperature.
|
inlineprotected |
Calculates the repulsive forces between all laid out nodes
|
inline |
Executes the fast organic layout.
parent |
Implements com.mxgraph.mxIGraphLayout.
References com.mxgraph.mxIGraphModel.BeginUpdate(), com.mxgraph.mxGeometry.Clone(), com.mxgraph.mxIGraphModel.EndUpdate(), com.mxgraph.mxIGraphModel.GetChildAt(), com.mxgraph.mxIGraphModel.GetChildCount(), com.mxgraph.mxGraphModel.GetEdges(), com.mxgraph.mxIGraphModel.GetGeometry(), com.mxgraph.mxGraphModel.GetOpposites(), com.mxgraph.mxRectangle.Height, com.mxgraph.mxGraph.IsCellMovable(), com.mxgraph.mxGraph.Model, com.mxgraph.mxIGraphModel.SetGeometry(), com.mxgraph.mxGraph.Snap(), com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
|
inline |
Returns true if the given cell should be ignored by the layout algorithm. This implementation returns false if the cell is a vertex and has at least one connected edge.
cell | Object that represents the cell. |
References com.mxgraph.mxIGraphModel.GetEdgeCount(), com.mxgraph.mxIGraphModel.IsVertex(), and com.mxgraph.mxGraph.Model.
|
inline |
Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. index) so that the outcome of the layou will position the vertex as close to the point (x, y) as possible.
Not yet implemented.
cell | |
x | |
y |
Implements com.mxgraph.mxIGraphLayout.
|
inlineprotected |
Reduces the temperature of the layout from an initial setting in a linear fashion to zero.
|
protected |
Boolean flag that specifies if the layout is allowed to run. If this is set to false, then the layout exits in the following iteration.
|
protected |
An array of locally stored co-ordinate positions for the vertices.
|
protected |
An array of locally stored X co-ordinate displacements for the vertices.
|
protected |
An array of locally stored Y co-ordinate displacements for the vertices.
|
protected |
The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. The value equates to the average radius there is of free space around each node. Default is 50.
|
protected |
Cache of forceConstant^2 for performance.
|
protected |
Holds the enclosing graph.
|
protected |
Maps from vertices to indices.
|
protected |
Start value of temperature. Default is 200.
|
protected |
Array of booleans representing the movable states of the vertices.
|
protected |
Current iteration count.
|
protected |
Total number of iterations to run the layout though.
|
protected |
Minimal distance limit. Default is 2. Prevents of dividing by zero.
|
protected |
Cached version of minDistanceLimit squared.
|
protected |
Local copy of cell neighbours.
|
protected |
The approximate radius of each cell, nodes only.
|
protected |
The approximate radius squared of each cell, nodes only.
|
protected |
Random number generator.
|
protected |
Temperature to limit displacement at later stages of layout.
|
protected |
An array of all vertices to be laid out.
|
getset |
Force constant to be used for the springs.
|
getset |
Initial temperature.
|
getset |
Flag to stop a running layout run.
|
getset |
Maximum number of iterations.
|
getset |
Minimum distance between nodes.