org.gvsig.raster.algorithm.process
Class ProcessParamsManagement

java.lang.Object
  extended by org.gvsig.raster.algorithm.process.ProcessUtils
      extended by org.gvsig.raster.algorithm.process.ProcessParamsManagement
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, IIncrementable, IncrementableListener, org.gvsig.tools.dispose.Disposable
Direct Known Subclasses:
DataProcess

public abstract class ProcessParamsManagement
extends ProcessUtils
implements IIncrementable, IncrementableListener, java.lang.Runnable, org.gvsig.tools.dispose.Disposable

Base class for all geoprocesses. This class contains all utilities to register and get parameters in a geoprocess instance

Author:
Nacho Brodin nachobrodin@gmail.com

Field Summary
protected  java.util.Hashtable<java.lang.String,java.lang.Object> inputParameters
           
static java.lang.String OUTPUT_HEIGHT
          Input parameter: Force to this height in pixels in the output buffer
static java.lang.String OUTPUT_WIDTH
          Input parameter: Force to this width in pixels in the output buffer
protected  java.util.HashMap<java.lang.String,java.lang.Object> outputParameters
           
static java.lang.String PREVIEW
          Input parameter: The output of this algorithm is for previews.
static java.lang.String PROCESS
          Output parameter: The getResult sets the correct value in the output.
static java.lang.String PROCESS_NAME
          Output parameter: The getResult sets the correct value in the output.
static java.lang.String REGISTER_INPUT_PARAMETERS_LABEL
           
static java.lang.String REGISTER_OUTPUT_PARAMETERS_LABEL
           
static java.lang.String ROI_EPSG
          Input parameter: If is defined then the ROIs will be used
static java.lang.String TIME
          Output parameter: The getResult sets the correct value in the output.
static java.lang.String WINDOW
          Input parameter: Force to this bounding box.
 
Fields inherited from class org.gvsig.raster.algorithm.process.ProcessUtils
doubleNODATA
 
Constructor Summary
ProcessParamsManagement()
           
 
Method Summary
 void addParam(java.lang.String key, java.lang.Object param)
          Add a parameter to this task at runtime.
protected  void finalize()
           
 boolean getBooleanParam(java.lang.String name)
          Gets a Boolean parameter from its key
 byte getByteParam(java.lang.String name)
          Gets a Byte parameter from its key
 double[] getDoubleArrayParam(java.lang.String name)
          Gets a double[] parameter from its key
 double getDoubleParam(java.lang.String name)
          Gets a double parameter from its key
 org.gvsig.fmap.dal.coverage.datastruct.Extent getExtentParam(java.lang.String name)
          Gets a Extent parameter from its key
 float getFloatParam(java.lang.String name)
          Gets a Float parameter from its key
 int[] getIntArrayParam(java.lang.String name)
          Gets a int[] parameter from its key
 int getIntParam(java.lang.String name)
          Gets a int parameter from its key
protected  int getOutputHeight()
          Gets the height in pixels of the output
protected  int getOutputWidth()
          Gets the width in pixels of the output
protected  org.gvsig.fmap.dal.coverage.datastruct.Extent getOutputWindow()
          Gets the bounding box defined by the user to the process
 java.lang.Object getParam(java.lang.String key)
          Gets a parameter from its key
 java.util.List<java.lang.Class<?>> getParameterClassList(java.lang.String processLabel, java.lang.String parameterName)
          Gets a list with the class of all parameters.
 java.lang.Class<?> getParameterTypeByProcess(java.lang.String processLabel, java.lang.String parameterName)
          Gets the class of a parameter in a process.
 java.util.List<java.lang.String> getRasterTaskInputParameters(java.lang.String processLabel)
          Gets the key list of the input parameters
 java.util.List<java.lang.String> getRasterTaskOutputParameters(java.lang.String processLabel)
          Gets the key list of the output parameters
protected  java.lang.String getROIEPSG()
          Gets the default EPSG for the regions of interest.
 java.lang.String getStringParam(java.lang.String key)
          Gets a String parameter from its key
protected  boolean isForPreviews()
          Returns true if the output of this algorithm is for previews.
protected  boolean isOutputRescaled()
          Returns true if the output will be rescaled
protected  void loadGlobalParameters()
          Loads global parameters defined in this class
static void registerGlobalInputParameters(java.lang.String parameterLabel, java.lang.Class<?> parameterClass, java.lang.String processLabel)
           
static void registerGlobalOutputParameters(java.lang.String parameterLabel, java.lang.Class<?> parameterClass, java.lang.String processLabel)
           
static void registerInputParameter(java.lang.String parameterLabel, java.lang.Class<?> parameterClass, java.lang.String processLabel)
          Registers input parameters of a raster process
static void registerOutputParameter(java.lang.String parameterLabel, java.lang.Class<?> parameterClass, java.lang.String processLabel)
          Registers output parameters of a raster process
 void removeParam(java.lang.String key)
          Remove a parameter to this task at runtime.
 
Methods inherited from class org.gvsig.raster.algorithm.process.ProcessUtils
createOutputBuffer, createOutputBuffer, createSourceBuffer, debug, exportRaster, exportRaster, exportRaster, exportRaster, getData, getExtentResult, getIntersectionInPxCoords, getSourcePxBox, isAnalizedEntireLayer, isInsideOfROI, messageBoxError, messageBoxError, messageBoxError
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gvsig.raster.algorithm.gui.IIncrementable
getLabel, getLog, getPercent, getTitle, isCancelable, isPausable
 
Methods inherited from interface org.gvsig.raster.algorithm.gui.IncrementableListener
actionCanceled, actionResumed, actionSuspended
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface org.gvsig.tools.dispose.Disposable
dispose
 

Field Detail

inputParameters

protected java.util.Hashtable<java.lang.String,java.lang.Object> inputParameters

OUTPUT_HEIGHT

public static java.lang.String OUTPUT_HEIGHT
Input parameter: Force to this height in pixels in the output buffer


OUTPUT_WIDTH

public static java.lang.String OUTPUT_WIDTH
Input parameter: Force to this width in pixels in the output buffer


outputParameters

protected java.util.HashMap<java.lang.String,java.lang.Object> outputParameters

PREVIEW

public static java.lang.String PREVIEW
Input parameter: The output of this algorithm is for previews. It usually implies that the buffer will be send as output parameter, the buffer will be RGB and the input buffer will be to read and write


PROCESS

public static java.lang.String PROCESS
Output parameter: The getResult sets the correct value in the output.


PROCESS_NAME

public static java.lang.String PROCESS_NAME
Output parameter: The getResult sets the correct value in the output.


REGISTER_INPUT_PARAMETERS_LABEL

public static final java.lang.String REGISTER_INPUT_PARAMETERS_LABEL
See Also:
Constant Field Values

REGISTER_OUTPUT_PARAMETERS_LABEL

public static final java.lang.String REGISTER_OUTPUT_PARAMETERS_LABEL
See Also:
Constant Field Values

ROI_EPSG

public static java.lang.String ROI_EPSG
Input parameter: If is defined then the ROIs will be used


TIME

public static java.lang.String TIME
Output parameter: The getResult sets the correct value in the output.


WINDOW

public static java.lang.String WINDOW
Input parameter: Force to this bounding box. If is defined, then ROI_EPSG is not taken into account

Constructor Detail

ProcessParamsManagement

public ProcessParamsManagement()
Method Detail

addParam

public void addParam(java.lang.String key,
                     java.lang.Object param)
Add a parameter to this task at runtime. The parameter should have been registered before add

Parameters:
name - key
param - object to this task

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getBooleanParam

public boolean getBooleanParam(java.lang.String name)
Gets a Boolean parameter from its key

Parameters:
key -
Returns:
parameter

getByteParam

public byte getByteParam(java.lang.String name)
Gets a Byte parameter from its key

Parameters:
key -
Returns:
parameter

getDoubleArrayParam

public double[] getDoubleArrayParam(java.lang.String name)
Gets a double[] parameter from its key

Parameters:
key -
Returns:
parameter

getDoubleParam

public double getDoubleParam(java.lang.String name)
Gets a double parameter from its key

Parameters:
key -
Returns:
parameter

getExtentParam

public org.gvsig.fmap.dal.coverage.datastruct.Extent getExtentParam(java.lang.String name)
Gets a Extent parameter from its key

Parameters:
key -
Returns:
parameter

getFloatParam

public float getFloatParam(java.lang.String name)
Gets a Float parameter from its key

Parameters:
key -
Returns:
parameter

getIntArrayParam

public int[] getIntArrayParam(java.lang.String name)
Gets a int[] parameter from its key

Parameters:
key -
Returns:
parameter

getIntParam

public int getIntParam(java.lang.String name)
Gets a int parameter from its key

Parameters:
key -
Returns:
parameter

getOutputHeight

protected int getOutputHeight()
Gets the height in pixels of the output

Returns:

getOutputWidth

protected int getOutputWidth()
Gets the width in pixels of the output

Returns:

getOutputWindow

protected org.gvsig.fmap.dal.coverage.datastruct.Extent getOutputWindow()
Gets the bounding box defined by the user to the process

Returns:

getParam

public java.lang.Object getParam(java.lang.String key)
Gets a parameter from its key

Parameters:
name - key
Returns:
parameter

getParameterClassList

public java.util.List<java.lang.Class<?>> getParameterClassList(java.lang.String processLabel,
                                                                java.lang.String parameterName)
Gets a list with the class of all parameters.

Parameters:
processLabel -
parameterName -
Returns:

getParameterTypeByProcess

public java.lang.Class<?> getParameterTypeByProcess(java.lang.String processLabel,
                                                    java.lang.String parameterName)
Gets the class of a parameter in a process.

Parameters:
processLabel -
parameterName -
Returns:

getRasterTaskInputParameters

public java.util.List<java.lang.String> getRasterTaskInputParameters(java.lang.String processLabel)
Gets the key list of the input parameters

Parameters:
processLabel -
Returns:

getRasterTaskOutputParameters

public java.util.List<java.lang.String> getRasterTaskOutputParameters(java.lang.String processLabel)
Gets the key list of the output parameters

Parameters:
processLabel -
Returns:

getROIEPSG

protected java.lang.String getROIEPSG()
Gets the default EPSG for the regions of interest. If this parameter is null

Returns:

getStringParam

public java.lang.String getStringParam(java.lang.String key)
Gets a String parameter from its key

Parameters:
key -
Returns:
parameter

isForPreviews

protected boolean isForPreviews()
Returns true if the output of this algorithm is for previews. It usually implies that the buffer will be send as output parameter, the buffer will be RGB and the input buffer will be to read and write.

Returns:

isOutputRescaled

protected boolean isOutputRescaled()
Returns true if the output will be rescaled

Returns:

loadGlobalParameters

protected void loadGlobalParameters()
Loads global parameters defined in this class


registerGlobalInputParameters

public static void registerGlobalInputParameters(java.lang.String parameterLabel,
                                                 java.lang.Class<?> parameterClass,
                                                 java.lang.String processLabel)

registerGlobalOutputParameters

public static void registerGlobalOutputParameters(java.lang.String parameterLabel,
                                                  java.lang.Class<?> parameterClass,
                                                  java.lang.String processLabel)

registerInputParameter

public static void registerInputParameter(java.lang.String parameterLabel,
                                          java.lang.Class<?> parameterClass,
                                          java.lang.String processLabel)
Registers input parameters of a raster process


registerOutputParameter

public static void registerOutputParameter(java.lang.String parameterLabel,
                                           java.lang.Class<?> parameterClass,
                                           java.lang.String processLabel)
Registers output parameters of a raster process


removeParam

public void removeParam(java.lang.String key)
Remove a parameter to this task at runtime.

Parameters:
name - key


Copyright © 2014 gvSIG Association. All Rights Reserved.