com.jgraph.layout
Class SpringEmbeddedLayoutAlgorithm

java.lang.Object
com.jgraph.layout.SpringEmbeddedLayoutAlgorithm
- All Implemented Interfaces:
- LayoutAlgorithm
- public class SpringEmbeddedLayoutAlgorithm
- extends java.lang.Object
- implements LayoutAlgorithm
Arranges the nodes with the Spring Embedded Layout Algorithm.
The algorithm takes O(|V|^2 * |E|) time.
- Since:
- 1.2.2
- Version:
- 1.0 init
|
Method Summary |
protected double |
fa(double x,
double k)
calculates the attractive forces |
protected double |
fr(double x,
double k)
calculates the repulsive forces |
protected double |
norm(java.awt.Rectangle p)
Calculates the euklidische Norm
for the point p. |
void |
perform(JGraph jgraph,
boolean applyToAll,
java.util.Properties configuration)
The implementation of the layout algorithm. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SPRING_EMBEDDED_DISP
public static final java.lang.String SPRING_EMBEDDED_DISP
- Key for an attribute. The value for this key is
a Rectangle object and specifies the disposement.
- See Also:
- Constant Field Values
SPRING_EMBEDDED_POS
public static final java.lang.String SPRING_EMBEDDED_POS
- Key for an attribute. The value for this key is
a Rectangle object and specifies the calculated position.
- See Also:
- Constant Field Values
dlgProgress
protected ProgressDialog dlgProgress
- Progressbar is shown while the algorithm is running
SpringEmbeddedLayoutAlgorithm
public SpringEmbeddedLayoutAlgorithm()
perform
public void perform(JGraph jgraph,
boolean applyToAll,
java.util.Properties configuration)
- The implementation of the layout algorithm.
- Specified by:
perform in interface LayoutAlgorithm
fa
protected double fa(double x,
double k)
- calculates the attractive forces
fr
protected double fr(double x,
double k)
- calculates the repulsive forces
norm
protected double norm(java.awt.Rectangle p)
- Calculates the euklidische Norm
for the point p.