org.wilmascope.forcelayout
Class Origin
java.lang.Object
org.wilmascope.patterns.Prototype
org.wilmascope.forcelayout.Force
org.wilmascope.forcelayout.Origin
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class Origin
- 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
Constructor Summary |
Origin(float strengthConstant)
|
Method Summary |
void |
calculate()
Calculate the origin centering deltas for all the nodes, or if a CentreNode
has been specified then just for that centre node. |
void |
setCentreNode(Node node)
Node specified will be drawn to the origin. |
void |
setCluster(Cluster root)
|
void |
setOriginNode(Node originNode)
set the origin point |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Origin
public Origin(float strengthConstant)
setCluster
public void setCluster(Cluster root)
- Specified by:
setCluster
in class Force
setOriginNode
public void setOriginNode(Node originNode)
- set the origin point
- Parameters:
originPoint
- the centroid!
calculate
public void calculate()
- Calculate the origin centering deltas for all the nodes, or if a CentreNode
has been specified then just for that centre node.
- Specified by:
calculate
in class Force
- Parameters:
nodes
- Nodes to which this force applies
setCentreNode
public void setCentreNode(Node node)
- Node specified will be drawn to the origin.
- Parameters:
node
- Node around which the graph will be centred.