ini.trakem2.display
Class AbstractRepaintThread

java.lang.Object
  extended by java.lang.Thread
      extended by ini.trakem2.display.AbstractRepaintThread
All Implemented Interfaces:
java.lang.Runnable

public abstract class AbstractRepaintThread
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  AbstractOffscreenThread off
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractRepaintThread(java.awt.Component target, java.lang.String name, AbstractOffscreenThread off)
           
 
Method Summary
protected abstract  void handleUpdateGraphics(java.awt.Component target, java.awt.Rectangle clipRect)
          Child classes need to extend this method for handling the need of recreating offscreen images.
 void paint(java.awt.Rectangle clipRect)
          Queue a new request for painting, updating offscreen graphics.
 void paint(java.awt.Rectangle clipRect, boolean update_graphics)
          Queue a new request for painting.
 void quit()
          Will gracefully kill this thread by breaking its infinite wait-for-event loop, and also call cancel on all registered offscreen threads.
 void run()
           
 void waitForOffs()
          Waits until the offscreen thread is finished with the current cycle.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, 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

off

protected final AbstractOffscreenThread off
Constructor Detail

AbstractRepaintThread

public AbstractRepaintThread(java.awt.Component target,
                             java.lang.String name,
                             AbstractOffscreenThread off)
Method Detail

paint

public final void paint(java.awt.Rectangle clipRect)
Queue a new request for painting, updating offscreen graphics.


paint

public void paint(java.awt.Rectangle clipRect,
                  boolean update_graphics)
Queue a new request for painting.


quit

public void quit()
Will gracefully kill this thread by breaking its infinite wait-for-event loop, and also call cancel on all registered offscreen threads.


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

handleUpdateGraphics

protected abstract void handleUpdateGraphics(java.awt.Component target,
                                             java.awt.Rectangle clipRect)
Child classes need to extend this method for handling the need of recreating offscreen images.


waitForOffs

public void waitForOffs()
Waits until the offscreen thread is finished with the current cycle.