Class VisRunner
java.lang.Object
edu.uci.ics.jung.algorithms.layout.util.VisRunner
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
FieldsModifier and TypeFieldDescriptionprotected booleanUsed for synchronization.protected IterativeContextprotected booleanprotected longhow long the relaxer thread pauses between iteration loops.protected booleanprotected Thread -
Constructor Summary
ConstructorsConstructorDescriptionVisRunner(IterativeContext process) Creates an instance for the specified process. -
Method Summary
Modifier and TypeMethodDescriptionlongvoidpause()Make the relaxer thread wait.voidprerelax()Execute a loop of steps in the calling thread, firing no events.voidrelax()Execute a loop of steps in a new Thread, firing an event after each step.voidresume()Make the relaxer thread resume.voidrun()voidsetSleepTime(long sleepTime) voidstop()Set flags to stop the relaxer thread.
-
Field Details
-
running
protected boolean running -
process
-
stop
protected boolean stop -
manualSuspend
protected boolean manualSuspend -
thread
-
sleepTime
protected long sleepTimehow long the relaxer thread pauses between iteration loops. -
pauseObject
Used for synchronization.
-
-
Constructor Details
-
VisRunner
Creates an instance for the specified process.- Parameters:
process- the process (generally a layout) for which this instance is created
-
-
Method Details
-
getSleepTime
public long getSleepTime()- Returns:
- the relaxerThreadSleepTime
-
setSleepTime
public void setSleepTime(long sleepTime) - Specified by:
setSleepTimein interfaceRelaxer- Parameters:
sleepTime- the sleep time to set for this thread
-
prerelax
public void prerelax()Description copied from interface:RelaxerExecute a loop of steps in the calling thread, firing no events. -
pause
public void pause()Description copied from interface:RelaxerMake the relaxer thread wait. -
relax
public void relax()Description copied from interface:RelaxerExecute a loop of steps in a new Thread, firing an event after each step. -
resume
public void resume()Description copied from interface:RelaxerMake the relaxer thread resume. -
stop
public void stop()Description copied from interface:RelaxerSet flags to stop the relaxer thread. -
run
public void run()
-