EDU.utwente.CoCompose.algorithm
Class ModelSpring
java.lang.Object
|
+--EDU.utwente.CoCompose.algorithm.ModelSpring
- All Implemented Interfaces:
- GraphAlgorithm, java.lang.Runnable
- public class ModelSpring
- extends java.lang.Object
- implements GraphAlgorithm, java.lang.Runnable
Model layout algorithm adapted from the EDU.auburn.VGJ.algorithm.shawn.Spring
algorithm to cope with CoCompose models. Class to implement Kamada and
Kawai's spring algorithm with modifications.
- Version:
- 0.1.10, 22 July 2003
- Author:
- Dennis Wagelaar, Shawn Lorae Stutzman
- See Also:
Spring
Constructor Summary |
ModelSpring()
Constructs a ModelSpring. |
Method Summary |
java.lang.String |
compute(Graph G,
GraphUpdate update)
Do not use. |
protected boolean |
doPass()
Does one algorithm pass. |
void |
run()
Runs the algorithm. |
void |
start(Graph G,
GraphUpdate update)
Starts the ModelSpring algorithm and runs it continuously in the background
until the stop method is called. |
void |
stop()
Stops the ModelSpring algorithm. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModelSpring
public ModelSpring()
- Constructs a ModelSpring.
doPass
protected boolean doPass()
throws java.lang.Exception
- Does one algorithm pass.
- Returns:
- True if the display needs to be updated.
- Throws:
java.lang.Exception
- if anything goes wrong, which happens if the model
changes.
compute
public java.lang.String compute(Graph G,
GraphUpdate update)
- Do not use. Use the start and stop method instead.
- Specified by:
compute
in interface GraphAlgorithm
- Parameters:
G
- The graph to apply this algorithm to.update
- The updatable graph display.- Returns:
- An error message or null.
start
public void start(Graph G,
GraphUpdate update)
throws CoComposeException
- Starts the ModelSpring algorithm and runs it continuously in the background
until the stop method is called.
- Parameters:
G
- The graph to apply this algorithm to.update
- The updatable graph display.- Throws:
CoComposeException
- if there was an error applying the algorithm.
stop
public void stop()
- Stops the ModelSpring algorithm.
run
public void run()
- Runs the algorithm. This method should not be called directly. Call start
instead.
- Specified by:
run
in interface java.lang.Runnable