Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jgraph.layout
Class SpringEmbeddedLayoutAlgorithm  view SpringEmbeddedLayoutAlgorithm download SpringEmbeddedLayoutAlgorithm.java

java.lang.Object
  extended bycom.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

Field Summary
protected  ProgressDialog dlgProgress
          Progressbar is shown while the algorithm is running
static java.lang.String SPRING_EMBEDDED_DISP
          Key for an attribute.
static java.lang.String SPRING_EMBEDDED_POS
          Key for an attribute.
 
Constructor Summary
SpringEmbeddedLayoutAlgorithm()
           
 
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
 

Field Detail

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

Constructor Detail

SpringEmbeddedLayoutAlgorithm

public SpringEmbeddedLayoutAlgorithm()
Method Detail

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.