|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.unex.sextante.core.ParametersSet
public class ParametersSet
Set of parameters needed by a GeoAlgorithm. This set is used to specify the requirements of the algorithm and to create a suitable GUI to get the required information from the user, among other tasks.
Constructor Summary | |
---|---|
ParametersSet()
|
Method Summary | |
---|---|
void |
addBand(java.lang.String sName,
java.lang.String sDescription,
java.lang.String sParentParameterName)
Adds a band to the set |
void |
addBoolean(java.lang.String sName,
java.lang.String sDescription,
boolean bDefault)
Adds a boolean value to the set |
void |
addFilepath(java.lang.String sName,
java.lang.String sDescription,
boolean bFolder,
boolean bOpenDialog,
java.lang.String sExt)
Adds a filepath to the set |
void |
addFixedTable(java.lang.String sName,
java.lang.String sDescription,
java.lang.String[] sColumnNames,
int iRows,
boolean bIsNumberOfRowsFixed)
Adds a fixed table to the set |
void |
addInputRasterLayer(java.lang.String sName,
java.lang.String sDescription,
boolean bIsMandatory)
Adds a raster layer to the parameter set |
void |
addInputTable(java.lang.String sName,
java.lang.String sDescription,
boolean bIsMandatory)
Adds a table to the parameter set |
void |
addInputVectorLayer(java.lang.String sName,
java.lang.String sDescription,
int iShapeType,
boolean bIsMandatory)
Adds a vector layer to the parameter set |
void |
addMultipleInput(java.lang.String sName,
java.lang.String sDescription,
int iDataType,
boolean bIsMandatory)
Adds a multiple input the parameter set |
void |
addNumericalValue(java.lang.String sName,
java.lang.String sDescription,
double dDefaultValue,
int iType)
Adds a numerical value to the set. |
void |
addNumericalValue(java.lang.String sName,
java.lang.String sDescription,
int iType,
double dDefaultValue,
double dMinValue,
double dMaxValue)
Adds a numerical value to the set |
boolean |
addParameter(Parameter parameter)
Adds a new parameter to the set |
void |
addPoint(java.lang.String sName,
java.lang.String sDescription)
Add a point to the set |
void |
addSelection(java.lang.String sName,
java.lang.String sDescription,
java.lang.String[] sValues)
Add a selection index (to choose from a list) to the set |
void |
addString(java.lang.String sName,
java.lang.String sDescription)
Add a string to the set |
void |
addString(java.lang.String sName,
java.lang.String sDescription,
java.lang.String sDefaultString)
Add a string to the set |
void |
addTableField(java.lang.String sName,
java.lang.String sDescription,
java.lang.String sParentParameterName)
Adds a table field to the set |
boolean |
areParameterValuesCorrect()
Returns true if all parameters in the set have valid values |
ParametersSet |
getNewInstance()
Returns a new instance of the parameter set |
int |
getNumberOfLineVectorLayers()
|
int |
getNumberOfParameters()
|
int |
getNumberOfPointVectorLayers()
|
int |
getNumberOfPolygonVectorLayers()
|
int |
getNumberOfRasterLayers()
|
int |
getNumberOfTables()
Returns the number of parameters of type table. |
int |
getNumberOfVectorLayers()
Returns the number of parameters of type vector layer. |
Parameter |
getParameter(int iIndex)
|
Parameter |
getParameter(java.lang.String sParameterName)
|
java.util.ArrayList |
getParametersOfType(java.lang.Class paramClass)
|
java.util.ArrayList |
getParameterValueAsArrayList(java.lang.String sParameterName)
|
boolean |
getParameterValueAsBoolean(java.lang.String sParameterName)
|
double |
getParameterValueAsDouble(java.lang.String sParameterName)
|
int |
getParameterValueAsInt(java.lang.String sParameterName)
|
java.lang.Object |
getParameterValueAsObject(java.lang.String sParameterName)
|
java.awt.geom.Point2D |
getParameterValueAsPoint(java.lang.String sParameterName)
|
IRasterLayer |
getParameterValueAsRasterLayer(java.lang.String sParameterName)
|
java.lang.String |
getParameterValueAsString(java.lang.String sParameterName)
|
ITable |
getParameterValueAsTable(java.lang.String sParameterName)
|
IVectorLayer |
getParameterValueAsVectorLayer(java.lang.String sParameterName)
|
void |
removeParameter(Parameter parameter)
|
void |
removeParameter(java.lang.String sParameterName)
|
boolean |
requiresFixedTables()
Returns true if the set contains fixed table parameters |
boolean |
requiresLineVectorLayers()
Returns true if the set contains parameters requiring line vector layers |
boolean |
requiresMultipleRasterBands()
Returns true if the set contains parameters requiring multiple raster bands |
boolean |
requiresMultipleRasterLayers()
Returns true if the set contains parameters requiring multiple raster layers |
boolean |
requiresMultipleTables()
Returns true if the set contains parameters requiring multiple tables |
boolean |
requiresMultipleVectorLayers()
Returns true if the set contains parameters requiring multiple vector layers |
boolean |
requiresNonDataObjects()
Returns true if the set contains parameters other than tables or layers |
boolean |
requiresPoints()
Returns true if the set contains point parameters. |
boolean |
requiresPointVectorLayers()
Returns true if the set contains parameters requiring point vector layers |
boolean |
requiresPolygonVectorLayers()
Returns true if the set contains parameters requiring polygon vector layers |
boolean |
requiresRasterBands()
Returns true if there is any parameter in the set requiring a single raster band |
boolean |
requiresRasterLayers()
Returns true if the set contains parameters requiring raster layers |
boolean |
requiresTableFields()
Returns true if the set contains table fields parameters |
boolean |
requiresTables()
Returns true if the set contains parameters requiring tables |
boolean |
requiresVectorLayers()
Returns true if the set contains parameters requiring vector layers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParametersSet()
Method Detail |
---|
public int getNumberOfParameters()
public int getNumberOfRasterLayers()
public int getNumberOfVectorLayers()
public int getNumberOfPointVectorLayers()
public int getNumberOfLineVectorLayers()
public int getNumberOfPolygonVectorLayers()
public int getNumberOfTables()
public boolean requiresNonDataObjects()
public boolean requiresRasterLayers()
public boolean requiresMultipleRasterLayers()
public boolean requiresMultipleVectorLayers()
public boolean requiresMultipleTables()
public boolean requiresMultipleRasterBands()
public boolean requiresRasterBands()
public boolean requiresVectorLayers()
public boolean requiresPointVectorLayers()
public boolean requiresLineVectorLayers()
public boolean requiresPolygonVectorLayers()
public boolean requiresTables()
public boolean requiresFixedTables()
public boolean requiresTableFields()
public boolean requiresPoints()
public boolean addParameter(Parameter parameter) throws RepeatedParameterNameException
parameter
- a parameter
RepeatedParameterNameException
- if already
exists a parameter in the set with the same namepublic void removeParameter(Parameter parameter) throws WrongParameterIDException
parameter
- a parameter
WrongParameterIDException
- if the parameter
does not exist in the setpublic void removeParameter(java.lang.String sParameterName) throws WrongParameterIDException
sParameterName
- the parameter name
WrongParameterIDException
- if no parameter
with the specified name exists in the setpublic java.util.ArrayList getParametersOfType(java.lang.Class paramClass)
paramClass
- the class of the parameters to retrieve
public Parameter getParameter(java.lang.String sParameterName) throws WrongParameterIDException
sParameterName
- the name of the parameter
WrongParameterIDException
- if no parameter
with the specified name exists in the setpublic Parameter getParameter(int iIndex) throws java.lang.ArrayIndexOutOfBoundsException
iIndex
- the index of the parameter in the set
java.lang.ArrayIndexOutOfBoundsException
- if iIndex is not
a valid array indexpublic java.lang.Object getParameterValueAsObject(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is null
WrongParameterTypeException
public int getParameterValueAsInt(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be cast to an int value
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic double getParameterValueAsDouble(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be cast to a double value
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic java.awt.geom.Point2D getParameterValueAsPoint(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be cast to a Point2D value
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic boolean getParameterValueAsBoolean(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be cast to a boolean value
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic java.util.ArrayList getParameterValueAsArrayList(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be cast to an ArrayList
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic java.lang.String getParameterValueAsString(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException, NullParameterAdditionalInfoException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be cast to a string
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is null
NullParameterAdditionalInfoException
public IVectorLayer getParameterValueAsVectorLayer(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be converted to a vector layer
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic IRasterLayer getParameterValueAsRasterLayer(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be converted to a raster layer
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic ITable getParameterValueAsTable(java.lang.String sParameterName) throws WrongParameterTypeException, WrongParameterIDException, NullParameterValueException
sParameterName
- the name of the parameter
WrongParameterTypeException
- if the parameter
cannot be converted to a table
WrongParameterIDException
- if no parameter with that name
exists in the set
NullParameterValueException
- if the parameter is nullpublic void addInputVectorLayer(java.lang.String sName, java.lang.String sDescription, int iShapeType, boolean bIsMandatory) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameteriShapeType
- the type of shapesbIsMandatory
- true if it is not an optional layer
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addInputRasterLayer(java.lang.String sName, java.lang.String sDescription, boolean bIsMandatory) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameterbIsMandatory
- true if it is not an optional layer
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addInputTable(java.lang.String sName, java.lang.String sDescription, boolean bIsMandatory) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameterbIsMandatory
- true if it is not an optional table
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addMultipleInput(java.lang.String sName, java.lang.String sDescription, int iDataType, boolean bIsMandatory) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameteriDataType
- the type of data requiredbIsMandatory
- true if the number of selected elements
cannot be zero
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addTableField(java.lang.String sName, java.lang.String sDescription, java.lang.String sParentParameterName) throws RepeatedParameterNameException, UndefinedParentParameterNameException, OptionalParentParameterException
sName
- the name of the parametersDescription
- the description of the parametersParentParameterName
- the name of the parent parameter
(vector layer or table) to which this parameter is linked
RepeatedParameterNameException
- if a parameter with
the same name already exists in the set
UndefinedParentParameterNameException
OptionalParentParameterException
public void addBand(java.lang.String sName, java.lang.String sDescription, java.lang.String sParentParameterName) throws RepeatedParameterNameException, UndefinedParentParameterNameException, OptionalParentParameterException
sName
- the name of the parametersDescription
- the description of the parametersParentParameterName
- the name of the parent parameter
(raster layer) to which this parameter is linked
RepeatedParameterNameException
- if a parameter with
the same name already exists in the set
UndefinedParentParameterNameException
OptionalParentParameterException
public void addNumericalValue(java.lang.String sName, java.lang.String sDescription, int iType, double dDefaultValue, double dMinValue, double dMaxValue) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameteriType
- the type of numerical value (integer or double)dDefaultValue
- the default value to use (or show)dMinValue
- the min value admitteddMaxValue
- the max value admitted
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addNumericalValue(java.lang.String sName, java.lang.String sDescription, double dDefaultValue, int iType) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameterdDefaultValue
- the default value to use (or show)iType
- the type of numerical value (integer or double)
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addString(java.lang.String sName, java.lang.String sDescription) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameter
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addString(java.lang.String sName, java.lang.String sDescription, java.lang.String sDefaultString) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parametersDefaultString
- the default value
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addFilepath(java.lang.String sName, java.lang.String sDescription, boolean bFolder, boolean bOpenDialog, java.lang.String sExt) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameterbFolder
- true if it is a folder dialogbOpenDialog
- true if it is an open file dialog, false if it's a save file dialog
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addBoolean(java.lang.String sName, java.lang.String sDescription, boolean bDefault) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the descritpion of the parameter
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addSelection(java.lang.String sName, java.lang.String sDescription, java.lang.String[] sValues) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parametersValues
- the values to choose from
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addFixedTable(java.lang.String sName, java.lang.String sDescription, java.lang.String[] sColumnNames, int iRows, boolean bIsNumberOfRowsFixed) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parametersColumnNames
- names of columns(fields) in the tableiRows
- number of rows in the tablebIsNumberOfRowsFixed
- true if the number of rows
cannot be modified
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic void addPoint(java.lang.String sName, java.lang.String sDescription) throws RepeatedParameterNameException
sName
- the name of the parametersDescription
- the description of the parameter
RepeatedParameterNameException
- if a parameter with
the same name already exists in the setpublic ParametersSet getNewInstance()
public boolean areParameterValuesCorrect()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |