es.unex.sextante.core
Class Sextante

java.lang.Object
  extended by es.unex.sextante.core.Sextante

public class Sextante
extends java.lang.Object


Constructor Summary
Sextante()
           
 
Method Summary
static void addCoordsoLog(java.lang.String sCoords)
          Adds a coordinate set to the "Points" history
static void addErrorToLog(java.lang.String sError)
          Adds an error message to the SEXTANTE logger
static void addErrorToLog(java.lang.Throwable e)
          logs an error or exception to the SEXTANTE logger
static void addGeoProcess(java.lang.Class<?> alg, java.util.HashMap text)
          Adds an external geoprocess.
static void addGeoProcess(GeoAlgorithm alg)
          Adds an external geoprocess.
static void addGRASSToLog(java.lang.String sGRASS)
          Adds a GRASS output message to the SEXTANTE logger
static void addInfoToLog(java.lang.String sInfo)
          Adds an info message to the SEXTANTE logger
static void addTranslation(java.util.HashMap text)
          Adds external translations
static void addWarningToLog(java.lang.String sWarning)
          Adds a warning message to the SEXTANTE logger
static GeoAlgorithm getAlgorithmFromCommandLineName(java.lang.String sName)
          returns an algorithm based on its command line name.
static java.util.HashMap getAlgorithms()
          Returns a map of all algorithms in the library. command-line names (see GeoAlgorithm.getCommandLineName()) are used as keys.
static java.util.HashMap getAlgorithms(IGeoAlgorithmFilter filter)
          Returns a map of algorithms in the library filtered using a given filter. command-line names (see GeoAlgorithm.getCommandLineName()) are used as keys.
static SextanteLogHandler getLogger()
          Returns the logger to log SEXTANTE issues
static java.lang.String getText(java.lang.String sKey)
          Returns an internationalized string based on a key value (i.e the string in the current language associated with the key value) Use this method to support internationalization.
static void initialize()
          initializes the library, loading algorithms and properties.
static void initialize(java.lang.String sFolder)
          initializes the library, loading algorithms and properties.
static void initialize(java.net.URL[] jars)
          Initializes the library loading algorithms and properties located inside the specified jar files
static boolean isMacOSX()
          Returns "true" if the current operating system is Mac OS X.
static boolean isUnix()
          Returns "true" if the current operating system is some Unix flavor (including Linux).
static boolean isWindows()
          Returns "true" if the current operating system is a variant of Windows.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sextante

public Sextante()
Method Detail

initialize

public static void initialize()
initializes the library, loading algorithms and properties. Algorithms and properties are loaded from files in the classpath.


initialize

public static void initialize(java.net.URL[] jars)
Initializes the library loading algorithms and properties located inside the specified jar files

Parameters:
jars - URLs of jar files containing algorithms and properties.

initialize

public static void initialize(java.lang.String sFolder)
initializes the library, loading algorithms and properties.

Parameters:
sFolder - the folder where sextante jars are located. Algorithms and properties files are loaded from those jar files prior to library initialization.

addGeoProcess

public static void addGeoProcess(java.lang.Class<?> alg,
                                 java.util.HashMap text)
Adds an external geoprocess. An external algorithm is a GeoAlgorithm which has been created out of this library.

Parameters:
alg - External algorithm
text - HashMap which contains the properties

addGeoProcess

public static void addGeoProcess(GeoAlgorithm alg)
Adds an external geoprocess. An external algorithm is a GeoAlgorithm which has been created out of this library.

Parameters:
alg - External algorithm

addTranslation

public static void addTranslation(java.util.HashMap text)
Adds external translations

Parameters:
text - HashMap which contains the properties

addErrorToLog

public static void addErrorToLog(java.lang.Throwable e)
logs an error or exception to the SEXTANTE logger

Parameters:
e - the throwable object to log

addErrorToLog

public static void addErrorToLog(java.lang.String sError)
Adds an error message to the SEXTANTE logger

Parameters:
sError - the error message

addWarningToLog

public static void addWarningToLog(java.lang.String sWarning)
Adds a warning message to the SEXTANTE logger

Parameters:
sWarning - the warning message

addInfoToLog

public static void addInfoToLog(java.lang.String sInfo)
Adds an info message to the SEXTANTE logger

Parameters:
sInfo - the info message

addGRASSToLog

public static void addGRASSToLog(java.lang.String sGRASS)
Adds a GRASS output message to the SEXTANTE logger

Parameters:
sGRASS - the GRASS message

addCoordsoLog

public static void addCoordsoLog(java.lang.String sCoords)
Adds a coordinate set to the "Points" history

Parameters:
sGRASS - the GRASS message

getLogger

public static SextanteLogHandler getLogger()
Returns the logger to log SEXTANTE issues

Returns:
the logger to log SEXTANTE issues

getAlgorithms

public static java.util.HashMap getAlgorithms()
Returns a map of all algorithms in the library. command-line names (see GeoAlgorithm.getCommandLineName()) are used as keys. The library must have been initialized before. Otherwise, this method will return an empty map

Returns:
a map of all algorithms in the library.

getAlgorithms

public static java.util.HashMap getAlgorithms(IGeoAlgorithmFilter filter)
Returns a map of algorithms in the library filtered using a given filter. command-line names (see GeoAlgorithm.getCommandLineName()) are used as keys. The library must have been initialized before. Otherwise, this method will return an empty map

Parameters:
filter - The filter to use
Returns:
a map of algorithms in the library filtered according to a given filter.

getAlgorithmFromCommandLineName

public static GeoAlgorithm getAlgorithmFromCommandLineName(java.lang.String sName)
returns an algorithm based on its command line name. (see GeoAlgorithm.getCommandLineName())

Parameters:
sName - the command-line name
Returns:
an algorithm. null if there is no algorithm with that name

getText

public static java.lang.String getText(java.lang.String sKey)
Returns an internationalized string based on a key value (i.e the string in the current language associated with the key value) Use this method to support internationalization. Resource strings are loaded when the library is initialized, so the initialize() method has to be called to use the corresponding translations.

Parameters:
sKey - the key to search
Returns:
the corresponding string in the current language. If the key was not found, it returns that same key.

isWindows

public static boolean isWindows()
Returns "true" if the current operating system is a variant of Windows.

Returns:
"true", if we are running on Windows, "false" otherwise.

isMacOSX

public static boolean isMacOSX()
Returns "true" if the current operating system is Mac OS X.

Returns:
"true", if we are running on Mac OS X, "false" otherwise.

isUnix

public static boolean isUnix()
Returns "true" if the current operating system is some Unix flavor (including Linux). Does not return true for Mac OS X.

Returns:
"true", if we are running on Unix/Linux, "false" otherwise.