jwo.landserf.process
Class SaveThread

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

public class SaveThread
extends LSThread
implements Scriptable

Saves the currently selected spatial object(s) in the given format.

Version:
2.3, 13th September, 2008.
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
SaveThread(GISFrame gisFrame)
          Creates an object ready for saving but does not save any files.
SaveThread(GISFrame gisFrame, String outFile, int fileType)
          Creates an object ready for saving the current spatial object (defined in gisFrame) with the given name and in the given format.
SaveThread(GISFrame gisFrame, VectorStyles vectorStyles)
          Creates an object ready for saving but does not save any files.
 
Method Summary
 boolean doCommand(LSCommand command)
          Saves the file specified in the given scripting parameters.
 void doProcessing()
          Does the file conversion and saving.
 LSCommand getCommand()
          Reports the syntax required to allow files to be saved via a scripting command.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects and reporting messages.
 Object getReturnedObject()
          Always returns null since saving a spatial object does not create any new objects.
 
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

SaveThread

public SaveThread(GISFrame gisFrame)
Creates an object ready for saving but does not save any files. This is primarily used for saving files via the scripting interface.

Parameters:
gisFrame - Frame in which to report results.

SaveThread

public SaveThread(GISFrame gisFrame,
                  VectorStyles vectorStyles)
Creates an object ready for saving but does not save any files. This is primarily used for saving files via the scripting interface with customised vector drawing.

Parameters:
gisFrame - Frame in which to report results.
vectorStyles - Vector style settings for saving drawn images.

SaveThread

public SaveThread(GISFrame gisFrame,
                  String outFile,
                  int fileType)
Creates an object ready for saving the current spatial object (defined in gisFrame) with the given name and in the given format.

Parameters:
gisFrame - GISFrame to report results to and get spatial object from.
outFile - Name of file to save.
fileType - Type of file format to save as.
Method Detail

doProcessing

public void doProcessing()
Does the file conversion and saving.

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

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getCommand

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

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

doCommand

public boolean doCommand(LSCommand command)
Saves the file specified in the given scripting parameters.

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

getReturnedObject

public Object getReturnedObject()
Always returns null since saving a spatial object does not create any new objects.

Specified by:
getReturnedObject in interface Scriptable
Returns:
null since no new object created.

getGISFrame

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

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


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