aminePlatform.util.graph
Class RelaxGraph

java.lang.Object
  extended byaminePlatform.util.graph.RelaxGraph

public class RelaxGraph
extends java.lang.Object

Title : RelaxGraph

Description : RelaxGraph is an adaptation of a class (ForceDirectedLayout) defined by Salvo Jesus in his Open Source OpenJGraph soft.


Constructor Summary
RelaxGraph(VisualGraph vGraph)
           
 
Method Summary
 void addFixedNode(VisualNode vNode)
          Adds a VisuaLNode that will not be moved from its position during the layout operation of ForceDirectedLayout.
 void doRelaxGraph(Lexicon lexicon)
           
 double getEletricalRepulsion()
          Returns the eletrical repulsion between all vertices The default value is 400.
 double getIncrement()
          Returns the increment by which the vertices gets closer to the equilibrium or closer to the force.
 double getSpringLength()
          Returns the desired spring length for all edges.
 double getStiffness()
          Returns the stiffness for all edges.
 boolean isInitialized()
          Determines if the graph has been initially laid out.
 boolean isNodeFixed(VisualNode vNode)
          Returns true if the specified VisualNode has a fixed position.
 void removeFixedNode(VisualNode vNode)
          Removes a VisualNode from the list of VisualVertices that has a fixed position.
 void setEletricalRepulsion(double repulsion)
          Sets the value of the electrical repulsion between all vertices
 void setIncrement(double increment)
          Sets the increment by which the vertices gets close to the equilibrium or gets closer to the direction of the force.
 void setSpringLength(double length)
          Sets the desired length of the spring among all edges
 void setStiffness(double stiffness)
          Sets the value of stiffness among all edges
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelaxGraph

public RelaxGraph(VisualGraph vGraph)
Method Detail

getSpringLength

public double getSpringLength()
Returns the desired spring length for all edges. The default value is 50.


getStiffness

public double getStiffness()
Returns the stiffness for all edges. The default value is 50.


getEletricalRepulsion

public double getEletricalRepulsion()
Returns the eletrical repulsion between all vertices The default value is 400.


getIncrement

public double getIncrement()
Returns the increment by which the vertices gets closer to the equilibrium or closer to the force. The default value is 0.50.


setSpringLength

public void setSpringLength(double length)
Sets the desired length of the spring among all edges


setStiffness

public void setStiffness(double stiffness)
Sets the value of stiffness among all edges


setEletricalRepulsion

public void setEletricalRepulsion(double repulsion)
Sets the value of the electrical repulsion between all vertices


setIncrement

public void setIncrement(double increment)
Sets the increment by which the vertices gets close to the equilibrium or gets closer to the direction of the force. This must be a number > 0 and <= 1. The higher the value, the faster the layout reaches equilibrium.


addFixedNode

public void addFixedNode(VisualNode vNode)
Adds a VisuaLNode that will not be moved from its position during the layout operation of ForceDirectedLayout.


isNodeFixed

public boolean isNodeFixed(VisualNode vNode)
Returns true if the specified VisualNode has a fixed position.


removeFixedNode

public void removeFixedNode(VisualNode vNode)
Removes a VisualNode from the list of VisualVertices that has a fixed position.


isInitialized

public boolean isInitialized()
Determines if the graph has been initially laid out. This method should be called prior to any painting to be done by the graph layout manager, as most internal variables are only initialized during layout.

Returns:
True if the graph has at least been laid out once.

doRelaxGraph

public void doRelaxGraph(Lexicon lexicon)