edu.uci.ics.jung.algorithms.layout.util
Class VisRunner

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.util.VisRunner
All Implemented Interfaces:
Relaxer, Runnable

public class VisRunner
extends Object
implements Relaxer, Runnable

Implementation of a relaxer thread for layouts. Extracted from the VisualizationModel in previous versions of JUNG.

Author:
Tom Nelson - tomnelson@dev.java.net

Field Summary
protected  boolean manualSuspend
           
 Object pauseObject
          Used for synchronization.
protected  IterativeContext process
           
protected  boolean running
           
protected  long sleepTime
          how long the relaxer thread pauses between iteration loops.
protected  boolean stop
           
protected  Thread thread
           
 
Constructor Summary
VisRunner(IterativeContext process)
          Creates an instance for the specified process.
 
Method Summary
 long getSleepTime()
           
 void pause()
          Make the relaxer thread wait.
 void prerelax()
          Execute a loop of steps in the calling thread, firing no events.
 void relax()
          Execute a loop of steps in a new Thread, firing an event after each step.
 void resume()
          Make the relaxer thread resume.
 void run()
           
 void setSleepTime(long sleepTime)
          Sets the sleep time.
 void stop()
          Set flags to stop the relaxer thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

running

protected boolean running

process

protected IterativeContext process

stop

protected boolean stop

manualSuspend

protected boolean manualSuspend

thread

protected Thread thread

sleepTime

protected long sleepTime
how long the relaxer thread pauses between iteration loops.


pauseObject

public Object pauseObject
Used for synchronization.

Constructor Detail

VisRunner

public VisRunner(IterativeContext process)
Creates an instance for the specified process.

Method Detail

getSleepTime

public long getSleepTime()
Returns:
the relaxerThreadSleepTime

setSleepTime

public void setSleepTime(long sleepTime)
Description copied from interface: Relaxer
Sets the sleep time.

Specified by:
setSleepTime in interface Relaxer
Parameters:
sleepTime - the sleep time to set for this thread

prerelax

public void prerelax()
Description copied from interface: Relaxer
Execute a loop of steps in the calling thread, firing no events.

Specified by:
prerelax in interface Relaxer

pause

public void pause()
Description copied from interface: Relaxer
Make the relaxer thread wait.

Specified by:
pause in interface Relaxer

relax

public void relax()
Description copied from interface: Relaxer
Execute a loop of steps in a new Thread, firing an event after each step.

Specified by:
relax in interface Relaxer

resume

public void resume()
Description copied from interface: Relaxer
Make the relaxer thread resume.

Specified by:
resume in interface Relaxer

stop

public void stop()
Description copied from interface: Relaxer
Set flags to stop the relaxer thread.

Specified by:
stop in interface Relaxer

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2009. All Rights Reserved.