jwo.landserf.process
Class LSThread

java.lang.Object
  extended byjava.lang.Thread
      extended byjwo.landserf.process.LSThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CombineThread, ContourThread, DeleteThread, DemToTinThread, DispThread, FracSurfaceThread, FuzzyFeatureThread, OpenThread, PeakClassificationThread, PitRemovalThread, PointDensityThread, PolySurfaceThread, ProjectionThread, RectifyThread, SaveThread, ScaleParamThread, SurfNetworkThread, SurfParamThread, TinPointsThread, TinToDemThread, TransRastThread, UpdateThread, VectorToRasterThread, View3dThread, VoidRemovalThread

public abstract class LSThread
extends Thread

Processing thread that times itself and allows messages to be logged. Any class that inherits this must place the body of the thread in the doProcessing method.

Version:
2.1, 26th February, 2004.
Author:
Jo Wood

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LSThread(String startMessage, GISFrame gisFrame)
          Creates thread and stores status bar to report progress.
 
Method Summary
abstract  void doProcessing()
          Abstract method that will contain processing.
 void resetTimer()
          Resets the timer for threads that have GUI processes that shouldn't contribute to the time of the process.
 void run()
          Starts the thread's processing and reports on progress.
 void setErrorMessage(String m)
          Sets an error message to be displayed once the thread has completed.
 void setMessage(String m)
          Sets the final message once the processing has been completed.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Constructor Detail

LSThread

public LSThread(String startMessage,
                GISFrame gisFrame)
Creates thread and stores status bar to report progress.

Parameters:
startMessage - Message to display when thread starts.
gisFrame - Frame that called the thread.
Method Detail

run

public void run()
Starts the thread's processing and reports on progress. Overrides the superclass' method.


resetTimer

public void resetTimer()
Resets the timer for threads that have GUI processes that shouldn't contribute to the time of the process.


doProcessing

public abstract void doProcessing()
Abstract method that will contain processing.


setMessage

public void setMessage(String m)
Sets the final message once the processing has been completed.

Parameters:
m - Message to display when processing has been completed.

setErrorMessage

public void setErrorMessage(String m)
Sets an error message to be displayed once the thread has completed.

Parameters:
m - Error message to display.


Copyright Jo Wood, 1996-2004, last modified, 3rd September, 2004