org.globus.cog.gui.grapheditor.canvas.views.layouts
Class ExtendedSpringLayout

java.lang.Object
  extended byorg.globus.cog.gui.grapheditor.canvas.views.layouts.ExtendedSpringLayout
All Implemented Interfaces:
GraphLayoutEngine

public class ExtendedSpringLayout
extends Object
implements GraphLayoutEngine

Adds distribution of edges around the node so they tend to have equal angles between them. Incoming edges will be coming from above, while outgoing edges will go downwards. The behaviour can be easily reversed by turning your monitor upside-down


Constructor Summary
ExtendedSpringLayout()
           
 
Method Summary
 void dampen(Point p)
           
 Hashtable layoutGraph(GraphInterface graph, Hashtable fixedNodes)
          This method takes a graph and a Hashtable with the nodes that cannot be moved and returns a Hashtable with the coordinates of the nodes after doing the layout.
 void setAngularSpringConstant(double ak)
           
 void setDampeningFactor(double visc)
           
 void setPreferredEdgeLength(double len)
           
 void setRepulsionConstant(double rk)
           
 void setRepulsionDistance(double c)
           
 void setSpringConstant(double k)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedSpringLayout

public ExtendedSpringLayout()
Method Detail

setPreferredEdgeLength

public void setPreferredEdgeLength(double len)

setRepulsionDistance

public void setRepulsionDistance(double c)

setSpringConstant

public void setSpringConstant(double k)

setRepulsionConstant

public void setRepulsionConstant(double rk)

setAngularSpringConstant

public void setAngularSpringConstant(double ak)

setDampeningFactor

public void setDampeningFactor(double visc)

layoutGraph

public Hashtable layoutGraph(GraphInterface graph,
                             Hashtable fixedNodes)
Description copied from interface: GraphLayoutEngine
This method takes a graph and a Hashtable with the nodes that cannot be moved and returns a Hashtable with the coordinates of the nodes after doing the layout.

Specified by:
layoutGraph in interface GraphLayoutEngine
Parameters:
graph - The graph that needs to be layed out
fixedNodes - A Hashtable containing Node objects as keys, and Points as elements, which specify the coordinates of the non-movable nodes
Returns:
a Hashtable with Node objects as keys and Point objects as coordinates for the nodes.

dampen

public void dampen(Point p)