jwo.landserf.process
Class ProjectionThread

java.lang.Object
  extended by java.lang.Thread
      extended by jwo.landserf.process.LSThread
          extended by jwo.landserf.process.ProjectionThread
All Implemented Interfaces:
Runnable, Scriptable, JWInterruptionListener

public class ProjectionThread
extends LSThread
implements Scriptable

Reprojects a spatial object between coordinate systems.

Version:
2.3, 10th February, 2009.
Author:
Jo Wood

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
ProjectionThread(GISFrame gisFrame)
          Prepares the class for reprojecting a spatial object.
ProjectionThread(GISFrame gisFrame, SpatialObject spObject, int newProjType)
          Prepares the class for reprojecting the given spatial object using the given projection type .
 
Method Summary
 boolean doCommand(LSCommand command)
          Reprojects a spatial object in the given scripting parameters.
 void doProcessing()
          Reprojects the spatial object provided to the constructor.
 LSCommand getCommand()
          Reports the syntax required to allow objects to be reprojected via a scripting command.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects.
 SpatialObject getReprojectedSpatialObject()
          Retrieves the reprojected spatial object.
 Object getReturnedObject()
          Returns a spatial object that has been projected via scripting command.
 
Methods inherited from class jwo.landserf.process.LSThread
checkStoppedThread, interruptionRequested, resetTimer, run, setErrorMessage, setFinalMessage, setMessage
 
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
 

Constructor Detail

ProjectionThread

public ProjectionThread(GISFrame gisFrame)
Prepares the class for reprojecting a spatial object. This constructor is for use with scripting control as it does not define what object is to be projected.

Parameters:
gisFrame - Frame holding spatial objects and in which to report results.

ProjectionThread

public ProjectionThread(GISFrame gisFrame,
                        SpatialObject spObject,
                        int newProjType)
Prepares the class for reprojecting the given spatial object using the given projection type .

Parameters:
gisFrame - Frame holding spatial objects and in which to report results.
spObject - Spatial object to transform.
newProjType - Type of projection to perform.
Method Detail

getCommand

public LSCommand getCommand()
Reports the syntax required to allow objects to be reprojected via a scripting command.

Specified by:
getCommand in interface Scriptable
Returns:
Command syntax.

doCommand

public boolean doCommand(LSCommand command)
Reprojects a spatial object in the given scripting parameters.

Specified by:
doCommand in interface Scriptable
Parameters:
command - Command containing parameter values.
Returns:
True if file projected successfully. If false, the details of the problem are reported to the gisFrame.

getReturnedObject

public Object getReturnedObject()
Returns a spatial object that has been projected via scripting command. If command has yet to be issued this will return null.

Specified by:
getReturnedObject in interface Scriptable
Returns:
New spatial object or null if problems projecting or command has not yet been issued.

getGISFrame

public GISFrame getGISFrame()
Retrieves the GISFrame that can be used for storing multiple spatial objects.

Specified by:
getGISFrame in interface Scriptable
Returns:
GISFrame storing spatial objects.

doProcessing

public void doProcessing()
Reprojects the spatial object provided to the constructor. The newly created reprojected spatial object is added to the GISFrame provided to the constructor as either a primary raster or vector map. This can be retrieved directly via this class's method getReprojectedSpatialObject(), or by calling gisFrame.getRaster1(); or gisFrame.getVectorMap1();

Note that this method will be called automatically if this is run as a threaded process (e.g. myProjectionThread.start()). Alternatively it can be called directly as a non-threaded process.

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getReprojectedSpatialObject

public SpatialObject getReprojectedSpatialObject()
Retrieves the reprojected spatial object.

Returns:
Reprojected spatial object, or null if problem or process yet to take place.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009