com.jgraph.layout.organic
public class JGraphFastOrganicLayout extends Object implements JGraphLayout, JGraphLayout.Stoppable
forceConstant
,initialTemp
and
maxIteration
.forceConstant
is the constant k
in the paper and affects the radius around each node around which other nodes
would be in equilibrium. initialTemp
sets the start
temperature of the layout, lower values limit the displacement of each node
on each iteration. maxIteration
sets the total number of
iterations of the layout that occur.
Field Summary | |
---|---|
protected double[][] | cellLocation
An array of locally stored co-ordinate positions for the vertices |
protected double[] | dispX
An array of locally stored X co-ordinate displacements for the vertices |
protected double[] | dispY
An array of locally stored Y co-ordinate displacements for the vertices |
protected double | forceConstant
The force constant by which the attractive forces are divided and the
replusive forces are multiple by the square of. |
protected double | forceConstantSquared
Cache of forceConstant ^2 for performance |
protected double | initialTemp
Start value of temperature |
protected boolean[] | isMoveable
Local copy of isMoveable |
protected int | iteration
Current iteration count |
protected int | maxIterations
Total number of iterations to run the layout though |
protected double | minDistanceLimit
prevents from dividing with zero |
protected double | minDistanceLimitSquared
cached version of minDistanceLimit squared |
protected int[][] | neighbours
Local copy of cell neighbours |
protected JGraphLayoutProgress | progress
An object to monitor and control progress. |
protected double[] | radius
The approximate radius of each cell, nodes only |
protected double[] | radiusSquared
The approximate radius squared of each cell, nodes only |
protected double | temperature
Temperature to limit displacement at later stages of layout |
protected Object[] | vertexArray
An array of all vertices to be laid out |
Method Summary | |
---|---|
void | calcAttraction()
Calculates the attractive forces between all laid out nodes linked by
edges |
void | calcPositions()
Takes the displacements calculated for each cell and applies them to the
local cache of cell positions. |
void | calcRepulsion()
Calculates the repulsive forces between all laid out nodes |
double | getForceConstant() |
double | getInitialTemp() |
int | getMaxIterations() |
JGraphLayoutProgress | getProgress() |
void | run(JGraphFacade graph)
Executes the Fruchterman-Reingold layout using the graph description from
the specified facade
|
void | setForceConstant(double forceConstant) |
void | setInitialTemp(double initialTemp) |
void | setMaxIterations(int maxIterations) |
String | toString()
Returns Fast Organic , the name of this algorithm. |
forceConstant
^2 for performanceminDistanceLimit
squaredReturns: Returns the forceConstant.
Returns: Returns the initialTemp.
Returns: Returns the maxIterations.
Returns: Returns the progress.
Parameters: graph the facade describing the graph to be acted upon
Parameters: forceConstant The forceConstant to set.
Parameters: initialTemp The initialTemp to set.
Parameters: maxIterations The maxIterations to set.
Fast Organic
, the name of this algorithm.