Class VisRunner
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.layout.util.VisRunner
-
- All Implemented Interfaces:
Relaxer
,java.lang.Runnable
public class VisRunner extends java.lang.Object implements Relaxer, java.lang.Runnable
Implementation of a relaxer thread for layouts. Extracted from theVisualizationModel
in previous versions of JUNG.- Author:
- Tom Nelson - tomnelson@dev.java.net
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
manualSuspend
java.lang.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 java.lang.Thread
thread
-
Constructor Summary
Constructors Constructor Description VisRunner(IterativeContext process)
Creates an instance for the specified process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
void
stop()
Set flags to stop the relaxer thread.
-
-
-
Field Detail
-
running
protected boolean running
-
process
protected IterativeContext process
-
stop
protected boolean stop
-
manualSuspend
protected boolean manualSuspend
-
thread
protected java.lang.Thread thread
-
sleepTime
protected long sleepTime
how long the relaxer thread pauses between iteration loops.
-
pauseObject
public java.lang.Object pauseObject
Used for synchronization.
-
-
Constructor Detail
-
VisRunner
public VisRunner(IterativeContext process)
Creates an instance for the specified process.- Parameters:
process
- the process (generally a layout) for which this instance is created
-
-
Method Detail
-
getSleepTime
public long getSleepTime()
- Returns:
- the relaxerThreadSleepTime
-
setSleepTime
public void setSleepTime(long sleepTime)
- Specified by:
setSleepTime
in interfaceRelaxer
- 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.
-
pause
public void pause()
Description copied from interface:Relaxer
Make the relaxer thread wait.
-
relax
public void relax()
Description copied from interface:Relaxer
Execute a loop of steps in a new Thread, firing an event after each step.
-
resume
public void resume()
Description copied from interface:Relaxer
Make the relaxer thread resume.
-
stop
public void stop()
Description copied from interface:Relaxer
Set flags to stop the relaxer thread.
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
-