es.unex.sextante.gui.grass
Class GrassAlgorithm

java.lang.Object
  extended by es.unex.sextante.core.GeoAlgorithm
      extended by es.unex.sextante.gui.grass.GrassAlgorithm

public class GrassAlgorithm
extends GeoAlgorithm

A geoalgorithm that wraps a grass algorithm

Author:
volaya

Constructor Summary
GrassAlgorithm()
           
 
Method Summary
 void defineCharacteristics()
          This method should be overridden and used to specify the parameters needed by the GeoAlgorithm, using the corresponding methods of the ParametersSet object.
 GeoAlgorithm getNewInstance()
           
 void initialize(java.lang.String sDescriptionFile)
          Initializes the geoalgorithm from a grass description file, generated using the --interface-description modifier
 boolean processAlgorithm()
          This method should implement the algorithm itself, using the values of the parameters and processing them.
 
Methods inherited from class es.unex.sextante.core.GeoAlgorithm
adjustRasterOutputExtent, execute, generatesLayers, generatesLayersOrTables, generatesUserDefinedRasterOutput, getAlgorithmAsCommandLineSentences, getCommandLineHelp, getCommandLineName, getGridExtent, getGroup, getName, getNumberOfLineVectorLayers, getNumberOfOutputObjects, getNumberOfParameters, getNumberOfPointVectorLayers, getNumberOfPolygonLayers, getNumberOfRasterLayers, getNumberOfTables, getNumberOfVectorLayers, getOutputObjects, getParameters, getProcessMetadata, hasCorrectParameterValues, isAutoExtent, isDeterminatedProcess, isSuitableForModelling, meetsDataRequirements, meetsRasterRequirements, meetsTableRequirements, meetsVectorRequirements, preprocessForModeller, requiresIndividualRasterLayers, requiresIndividualVectorLayers, requiresLineVectorLayers, requiresMultipleRasterBands, requiresMultipleRasterLayers, requiresMultipleTables, requiresMultipleVectorLayers, requiresNonDataObjects, requiresPoints, requiresPointVectorLayers, requiresPolygonVectorLayers, requiresRasterLayers, requiresTableFields, requiresTables, requiresVectorLayers, setGeneratesUserDefinedRasterOutput, setGridExtent, setGroup, setIsDeterminatedProcess, setName, setOutputObjects, setParameters, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GrassAlgorithm

public GrassAlgorithm()
Method Detail

initialize

public void initialize(java.lang.String sDescriptionFile)
                throws UnwrappableGrassProcessException
Initializes the geoalgorithm from a grass description file, generated using the --interface-description modifier

Parameters:
sDescriptionFile - the description file
Throws:
UnwrappableGrassProcessException

defineCharacteristics

public void defineCharacteristics()
Description copied from class: GeoAlgorithm
This method should be overridden and used to specify the parameters needed by the GeoAlgorithm, using the corresponding methods of the ParametersSet object. Also, output objects must be added, so SEXTANTE knows in advance which outputs will be generated by the algorithm. See the addOutputXXXX family of methods (GeoAlgorithm.addOutputRasterLayer(java.lang.String, java.lang.String, int, es.unex.sextante.outputs.IOutputChannel, es.unex.sextante.dataObjects.IRasterLayer), GeoAlgorithm.addOutputVectorLayer(java.lang.String, java.lang.String, int, es.unex.sextante.outputs.IOutputChannel, es.unex.sextante.dataObjects.IVectorLayer), etc.)

Specified by:
defineCharacteristics in class GeoAlgorithm

processAlgorithm

public boolean processAlgorithm()
                         throws GeoAlgorithmExecutionException
Description copied from class: GeoAlgorithm
This method should implement the algorithm itself, using the values of the parameters and processing them.

Specified by:
processAlgorithm in class GeoAlgorithm
Returns:
true if the algorithm was correctly executed. False if it was canceled.
Throws:
GeoAlgorithmExecutionException - if there were problems during algorithm execution

getNewInstance

public GeoAlgorithm getNewInstance()
                            throws java.lang.InstantiationException,
                                   java.lang.IllegalAccessException
Overrides:
getNewInstance in class GeoAlgorithm
Returns:
a new instance of the algorithm
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException