org.wilmascope.forcelayout
Class FixedOrigin

java.lang.Object
  extended by org.wilmascope.patterns.Prototype
      extended by org.wilmascope.forcelayout.Force
          extended by org.wilmascope.forcelayout.FixedOrigin
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class FixedOrigin
extends Force

Force that attracts either one or all of the nodes to the centre of the graph space. Simply keeps the graph centred, stops it drifting off the screen.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.wilmascope.forcelayout.Force
strengthConstant
 
Constructor Summary
FixedOrigin(float strengthConstant)
           
 
Method Summary
 void calculate()
          Calculate the origin centering deltas for all the nodes, or if a CentreNode has been specified the just for that centre node.
 void setCentreNode(Node node)
          Node specified will be drawn to the origin.
 void setCluster(Cluster root)
           
 
Methods inherited from class org.wilmascope.forcelayout.Force
getStrengthConstant, setStrengthConstant, toString
 
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
 

Constructor Detail

FixedOrigin

public FixedOrigin(float strengthConstant)
Method Detail

setCluster

public void setCluster(Cluster root)
Specified by:
setCluster in class Force

calculate

public void calculate()
Calculate the origin centering deltas for all the nodes, or if a CentreNode has been specified the just for that centre node.

Specified by:
calculate in class Force

setCentreNode

public void setCentreNode(Node node)
Node specified will be drawn to the origin.

Parameters:
node - Node around which the graph will be centred.