cz.cuni.jagrlib
Class RedrawTimer

java.lang.Object
  extended by java.lang.Thread
      extended by cz.cuni.jagrlib.RedrawTimer
All Implemented Interfaces:
java.lang.Runnable

public class RedrawTimer
extends java.lang.Thread

Timer object capable of periodic redrawing the attached GraphicsViewer window.

Since:
0.25
See Also:
RedrawTimer.java

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean cont
          "Continue" flag for activity-period of the timer.
static long DEFAULT_PERIOD
          Default redraw-period in milliseconds.
protected  long period
          Actual timer period in milliseconds.
protected  GraphicsViewer preview
          Preview window or null if timer is not active.
protected  java.lang.String title
          Title to be set to the preview window (null means "no change").
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RedrawTimer()
          Sets thread name for debugging identification.
 
Method Summary
 void run()
          Executive method of the timer.
 void setTitle(java.lang.String tit)
          Set window title.
 void startTimer(GraphicsViewer preview, long period)
          Start redraw timer.
 void stopTimer()
          Stop redraw timer.
 
Methods inherited from class java.lang.Thread
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PERIOD

public static final long DEFAULT_PERIOD
Default redraw-period in milliseconds.

See Also:
Constant Field Values

preview

protected GraphicsViewer preview
Preview window or null if timer is not active.


title

protected java.lang.String title
Title to be set to the preview window (null means "no change").


cont

protected boolean cont
"Continue" flag for activity-period of the timer.


period

protected long period
Actual timer period in milliseconds.

Constructor Detail

RedrawTimer

public RedrawTimer()
Sets thread name for debugging identification.

Method Detail

run

public void run()
Executive method of the timer.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

startTimer

public void startTimer(GraphicsViewer preview,
                       long period)
Start redraw timer.

Parameters:
preview - Preview window which will be redrawn perodically.
period - Redraw period in milliseconds.
See Also:
stopTimer()

stopTimer

public void stopTimer()
Stop redraw timer.


setTitle

public void setTitle(java.lang.String tit)
Set window title.