org.wilmascope.forcelayout
Class Force

java.lang.Object
  extended by org.wilmascope.patterns.Prototype
      extended by org.wilmascope.forcelayout.Force
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DirectedField, FixedOrigin, Origin, Planar, Repulsion, RepulsionFADE, RepulsionlessSpring, RepulsionSpring, Spring

public abstract class Force
extends Prototype

Super class that any force must extend

See Also:
Serialized Form

Field Summary
protected  float strengthConstant
          The strength of the force
 
Constructor Summary
protected Force(float strengthConstant, java.lang.String name)
           
 
Method Summary
abstract  void calculate()
          Calculate the position deltas due to this force
 float getStrengthConstant()
          Query the current strength constant
abstract  void setCluster(Cluster root)
           
 void setStrengthConstant(float strengthConstant)
          Set the strength constant for this force
 java.lang.String toString()
          Return value of strengthConstant as a string
 
Methods inherited from class org.wilmascope.patterns.Prototype
clone, getTypeName, setTypeName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

strengthConstant

protected float strengthConstant
The strength of the force

Constructor Detail

Force

protected Force(float strengthConstant,
                java.lang.String name)
Method Detail

calculate

public abstract void calculate()
Calculate the position deltas due to this force

Parameters:
v - The graph elements to which this force applies

setStrengthConstant

public void setStrengthConstant(float strengthConstant)
Set the strength constant for this force

Parameters:
strengthConstant - new strength constant value

getStrengthConstant

public float getStrengthConstant()
Query the current strength constant

Returns:
the Strength Constant

toString

public java.lang.String toString()
Return value of strengthConstant as a string

Overrides:
toString in class java.lang.Object
Returns:
String strengthConstant

setCluster

public abstract void setCluster(Cluster root)