net.sf.sdedit.ui.components
Class DelayedActivity

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.sdedit.ui.components.DelayedActivity
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
RedrawThread

public abstract class DelayedActivity
extends Thread

A DelayedActivity is performed when a certain (changing) event has happened at some time and then has not happened again for a certain amount of time. That time is given by getDelay(), the activity to be performed is given by perform(). In order to indicate that the certain event has occurred, some caller must invoke indicateChange().

Author:
Markus Strauch

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected DelayedActivity()
           
 
Method Summary
protected abstract  int getDelay()
           
 void indicateChange()
           
protected abstract  void perform()
          Performs the desired activity if something has changed (as indicated by indicateChange(), the delay has passed and no change has been indicated in that time.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelayedActivity

protected DelayedActivity()
Method Detail

indicateChange

public void indicateChange()

run

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

getDelay

protected abstract int getDelay()

perform

protected abstract void perform()
Performs the desired activity if something has changed (as indicated by indicateChange(), the delay has passed and no change has been indicated in that time. This method is always invoked in a monitor that is guarded by the lock associated with this DelayedActivity.



Copyright © 2011. All Rights Reserved.