root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.gui / src / main / java / es / unex / sextante / gui / algorithm / GeoAlgorithmParametersPanel.java @ 338
History | View | Annotate | Download (2.53 KB)
1 | 59 | nbrodin | package es.unex.sextante.gui.algorithm; |
---|---|---|---|
2 | |||
3 | import javax.swing.JPanel; |
||
4 | |||
5 | import es.unex.sextante.core.GeoAlgorithm; |
||
6 | import es.unex.sextante.exceptions.WrongInputException; |
||
7 | import es.unex.sextante.gui.exceptions.LayerCannotBeOverwrittenException; |
||
8 | import es.unex.sextante.gui.exceptions.OverwrittingNotAllowedException; |
||
9 | |||
10 | /**
|
||
11 | * An abstract class to extend by all parameter panels that take parameter values from the user for a geoalgorithm. If your
|
||
12 | * geoalgorithm needs a more elaborated panel than the default one, extend this class naming the derived class with the name of
|
||
13 | * the algorithm and adding the suffix "ParametersPanel".
|
||
14 | *
|
||
15 | * For instance, for an algorithm named RasterOperationAlgorithm, you should create a class named RasterOperationParametersPanel.
|
||
16 | * SEXTANTE will look for that class and if it cannot find it, it will use the default parameters panel instead.
|
||
17 | *
|
||
18 | */
|
||
19 | |||
20 | public abstract class GeoAlgorithmParametersPanel |
||
21 | extends
|
||
22 | JPanel {
|
||
23 | |||
24 | /**
|
||
25 | * Inits the panel with the needs of a given algorithm
|
||
26 | *
|
||
27 | * @param algorithm
|
||
28 | * the geoalgorithm
|
||
29 | */
|
||
30 | public abstract void init(GeoAlgorithm algorithm); |
||
31 | |||
32 | |||
33 | /**
|
||
34 | * Assigns the parameters entered by the user to the algorithm
|
||
35 | *
|
||
36 | */
|
||
37 | public abstract void assignParameters() throws WrongInputException, OverwrittingNotAllowedException, |
||
38 | LayerCannotBeOverwrittenException; |
||
39 | |||
40 | |||
41 | /**
|
||
42 | * Sets the value of a parameter in the panel, if possible. This should be called to set predefined values or values previously
|
||
43 | * used, so it is easier for the user to fill the required fields.
|
||
44 | *
|
||
45 | * @param sParameterName
|
||
46 | * The name of the parameter to set
|
||
47 | * @param sValue
|
||
48 | * the value to set, expressed as the corresponding command line argument
|
||
49 | */
|
||
50 | public abstract void setParameterValue(String sParameterName, |
||
51 | String sValue);
|
||
52 | |||
53 | |||
54 | /**
|
||
55 | * Sets the value of an output object in the panel, if possible. This should be called to set predefined values or values
|
||
56 | * previously used, so it is easier for the user to fill the required fields.
|
||
57 | *
|
||
58 | * @param sOutputName
|
||
59 | * The name of the output object to set
|
||
60 | * @param sValue
|
||
61 | * the value to set, expressed as the corresponding command line argument
|
||
62 | */
|
||
63 | public abstract void setOutputValue(String sOutputName, |
||
64 | String sValue);
|
||
65 | |||
66 | } |