public class JGraphSpringLayout extends java.lang.Object implements JGraphLayout, JGraphLayout.Stoppable
JGraphLayout.Stoppable
Modifier and Type | Field and Description |
---|---|
protected double[] |
cellLocationX
Deprecated.
An array of locally stored X co-ordinate positions for the vertices
|
protected double[] |
cellLocationY
Deprecated.
An array of locally stored Y co-ordinate positions for the vertices
|
protected java.util.Map |
displacement
Deprecated.
Stores the temporary positions of each cell during the layout
|
protected double[] |
dispX
Deprecated.
An array of locally stored X co-ordinate displacements for the vertices
|
protected double[] |
dispY
Deprecated.
An array of locally stored Y co-ordinate displacements for the vertices
|
protected boolean[] |
isMoveable
Deprecated.
Local copy of isMoveable
|
protected int |
iteration
Deprecated.
current iteration number
|
protected int |
maxIterations
Deprecated.
total number of iterations to step through when running
|
protected int[][] |
neighbours
Deprecated.
Local copy of cell neighbours
|
protected JGraphLayoutProgress |
progress
Deprecated.
An object to monitor and control progress.
|
protected double |
replusiveForce
Deprecated.
The multiple by which the force replusive each pair of nodes scaled by
Increase to make nodes force further apart
|
protected double |
springForce
Deprecated.
The multiple of force applied to the attraction of springs
|
protected double |
springLength
Deprecated.
The natural length of the spring (edge) whereby it imparts no force
on either connected node
|
protected java.lang.Object[] |
vertexArray
Deprecated.
An array of all vertices to be laid out
|
VERSION
Constructor and Description |
---|
JGraphSpringLayout()
Deprecated.
Creates a new layout of 50 iterations
|
JGraphSpringLayout(int iterations)
Deprecated.
Creates a new spring layout to be executed over the specified number
of iterations
|
Modifier and Type | Method and Description |
---|---|
protected void |
attract()
Deprecated.
Calculates an attractive force between the cells connected by the
specified edge
|
int |
getMaxIterations()
Deprecated.
|
JGraphLayoutProgress |
getProgress()
Deprecated.
Returns the progress object that represents the progress of the
current layout run.
|
double |
getReplusiveForce()
Deprecated.
|
double |
getSpringForce()
Deprecated.
|
double |
getSpringLength()
Deprecated.
|
protected void |
reposition(JGraphFacade graph)
Deprecated.
repositions the specified cells using the positioning
data obtained through repulse and attract phases
|
protected void |
repulse()
Deprecated.
Calculates a repulsion force between the specified cells
and stores the cumulative displacement applied to each cell
|
void |
run(JGraphFacade graph)
Deprecated.
Executes the spring layout of the specified facade data
|
void |
setMaxIterations(int iterations)
Deprecated.
|
void |
setReplusiveForce(double replusiveForce)
Deprecated.
|
void |
setSpringForce(double springForce)
Deprecated.
|
void |
setSpringLength(double springLength)
Deprecated.
|
java.lang.String |
toString()
Deprecated.
Returns
Spring , the name of this algorithm. |
protected transient java.util.Map displacement
protected double replusiveForce
protected double springForce
protected double springLength
protected int iteration
protected int maxIterations
protected java.lang.Object[] vertexArray
protected double[] dispX
protected double[] dispY
protected double[] cellLocationX
protected double[] cellLocationY
protected boolean[] isMoveable
protected int[][] neighbours
protected JGraphLayoutProgress progress
public JGraphSpringLayout()
public JGraphSpringLayout(int iterations)
iterations
- the number of layout iterations to executepublic JGraphLayoutProgress getProgress()
JGraphLayout.Stoppable
By convention, the layout must check the isStopped method in its
inner-most loops and return immediately if the method returns
true
.
getProgress
in interface JGraphLayout.Stoppable
public void run(JGraphFacade graph)
run
in interface JGraphLayout
graph
- the description of the graph to be acted uponprotected void repulse()
protected void attract()
protected void reposition(JGraphFacade graph)
graph
- the description of the graph to be laid outpublic void setMaxIterations(int iterations)
iterations
- the value to set maxIterations
topublic int getMaxIterations()
public double getSpringLength()
public void setSpringLength(double springLength)
springLength
- The springLength to set.public double getSpringForce()
public void setSpringForce(double springForce)
springForce
- The springForce to set.public double getReplusiveForce()
public void setReplusiveForce(double replusiveForce)
replusiveForce
- The replusiveForce to set.public java.lang.String toString()
Spring
, the name of this algorithm.toString
in class java.lang.Object
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.