jwo.landserf.process
Class JoinVectorThread

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

public class JoinVectorThread
extends LSThread
implements Scriptable

Joins any lines in a vector map. This class can be useful when defragmenting a patchy GPS track or a multi-session digitization of a line.

Version:
2.3, 17th July, 2006.
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
JoinVectorThread(GISFrame gisFrame)
          Creates an object that will join vector lines.
 
Method Summary
 boolean doCommand(LSCommand command)
          Joins the lines in the vector map specified in the given scripting parameters.
 void doProcessing()
          Joins the lines in the primary vector map.
 LSCommand getCommand()
          Reports the syntax required to allow the lines in a vector map to be joined via a scripting command.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects and messages.
 VectorMap getJoinedVectorMap()
          Retrieves the vector map containing the joined lines.
 Object getReturnedObject()
          Returns the newly created vector map with joined lines.
 
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

JoinVectorThread

public JoinVectorThread(GISFrame gisFrame)
Creates an object that will join vector lines.

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

doProcessing

public void doProcessing()
Joins the lines in the primary vector map. The resulting vector map is added to the GISFrame provided to the constructor and selected as the primary vector map. To retrieve it either call getJoinedVectorMap() from this class or call gisFrame.getVectorMap1();.

Note that this method will be called automatically if this is run as a threaded process (e.g. myJoinVectorThread.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 the lines in a vector map to be joined via a scripting command.

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

doCommand

public boolean doCommand(LSCommand command)
Joins the lines in the vector map specified in the given scripting parameters.

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

getReturnedObject

public Object getReturnedObject()
Returns the newly created vector map with joined lines. This is identical to getJoinedVectorMap except that it is compatible with the scripable interface. 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 joining or command has not yet been issued.

getGISFrame

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

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

getJoinedVectorMap

public VectorMap getJoinedVectorMap()
Retrieves the vector map containing the joined lines.

Returns:
New vector map with joined lines, or null if problems or joining yet to take place.


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