jwo.landserf.process
Class LSThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--jwo.landserf.process.LSThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CombineRastersThread, ContourThread, DemToTinThread, DispRasterThread, DrainageNetworkThread, ExportToHubThread, FracSurfaceThread, ImportFromHubThread, InterpolateThread, OpenThread, PolySurfaceThread, SaveThread, ScaleParamThread, SurfaceNetworkThread, SurfParamThread, TinToDemThread, TransRastThread, TriangulateThread

public abstract class LSThread
extends Thread

Abstract thread class for performing simultaneous tasks. Extends the standard Thread class by reporting progress in a status bar that may be attached to an AWT frame.

Version:
1.8.0, 12th December, 1999.
Author:
Jo Wood
See Also:
StatusBar

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LSThread(String startMessage, GISFrame gf)
          Creates thread and stores status bar to report progress.
LSThread(String startMessage, StatusBar sb)
          Creates thread and stores status bar to report progress.
LSThread(String startMessage, StatusBar sb, Component c)
          Creates thread and stores status bar and component to control pointer changes.
 
Method Summary
abstract  void doProcessing()
          Abstract method that will contain processing.
 void run()
          Starts the thread's processing and reports on progress.
 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,
                StatusBar sb)
Creates thread and stores status bar to report progress.

Parameters:
startMessage - Message to display when thread starts.
sb - Status bar that will report thread's progress.

LSThread

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

Parameters:
startMessage - Message to display when thread starts.
gf - GUIFrame that issued the thread.

LSThread

public LSThread(String startMessage,
                StatusBar sb,
                Component c)
Creates thread and stores status bar and component to control pointer changes.

Parameters:
startMessage - Message to display when thread starts.
sb - Status bar that will report thread's progress.
c - Component that changes pointer when in focus.
Method Detail

run

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

Specified by:
run in interface Runnable
Overrides:
run in class Thread

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. Can be used for displaying error messages if process has exited abnormally.

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