gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.api / src / main / java / org / gvsig / vectorediting / lib / api / EditingServiceParameter.java @ 2125
History | View | Annotate | Download (4.34 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright ? 2007-2014 gvSIG Association
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
|
25 |
package org.gvsig.vectorediting.lib.api; |
26 |
|
27 |
import java.util.Map; |
28 |
import java.util.Set; |
29 |
|
30 |
import org.gvsig.fmap.geom.Geometry; |
31 |
|
32 |
/**
|
33 |
* <p>
|
34 |
* EditingServiceParameter represents values needed by services to work.
|
35 |
* This parameters can be several type at the same type. For example, if
|
36 |
* services needs the radius of a circle, that value can be a position of map or
|
37 |
* a double value.
|
38 |
* </p>
|
39 |
*
|
40 |
* @author gvSIG team.
|
41 |
* @version $Id$
|
42 |
*
|
43 |
*/
|
44 |
public interface EditingServiceParameter { |
45 |
|
46 |
/**
|
47 |
* TYPE represents the available type of parameters. A parameter can be of
|
48 |
* several types at the same type. The types of parameters are:
|
49 |
*
|
50 |
* - Position: this kind of parameter expects a position in map.
|
51 |
*
|
52 |
* - List of positions this kind of parameter expects a position in map.
|
53 |
*
|
54 |
* - Option: this kind of parameter expects an option. Options is used to
|
55 |
* change functionality of providers or to do actions. For example, an
|
56 |
* option of Regular polygon can be "sides" that indicates side number of
|
57 |
* regular polygon.
|
58 |
*
|
59 |
* - Value: this kind of parameter expects an value.
|
60 |
*
|
61 |
* - Selection: this kind of parameters expects a selection.
|
62 |
*
|
63 |
* - Geometry: this kind of parameters expects a selection. See
|
64 |
* {@link EditingServiceParameter#getGeometryType()} to know the type of
|
65 |
* geometry is expected
|
66 |
*
|
67 |
* @author llmarques
|
68 |
*
|
69 |
*/
|
70 |
public enum TYPE { |
71 |
POSITION, LIST_POSITIONS, OPTION, VALUE, SELECTION, GEOMETRY |
72 |
} |
73 |
|
74 |
/**
|
75 |
* Gets types of this parameter.
|
76 |
*
|
77 |
* @return A <code> Set </code> of parameter types.
|
78 |
*/
|
79 |
public Set<TYPE> getTypes(); |
80 |
|
81 |
/**
|
82 |
* Gets a name of parameter.
|
83 |
*
|
84 |
* @return Parameter name
|
85 |
*/
|
86 |
public String getName(); |
87 |
|
88 |
/**
|
89 |
* Gets a description of parameter. Description is used to show a message on
|
90 |
* console.
|
91 |
*
|
92 |
* @return Description parameter.
|
93 |
*/
|
94 |
public String getDescription(); |
95 |
|
96 |
/**
|
97 |
* Gets the default value of this parameter. If this parameter doesn't have
|
98 |
* default value, it will return null.
|
99 |
*
|
100 |
* @return Default value of this parameter. Null if this parameter doesn't
|
101 |
* have default value.
|
102 |
*/
|
103 |
public Object getDefaultValue(); |
104 |
|
105 |
/**
|
106 |
* Sets the default value of this parameter.
|
107 |
*/
|
108 |
public void setDefaultValue(Object value); |
109 |
|
110 |
|
111 |
/**
|
112 |
* If parameter is of type Geometry returns the type of geometry
|
113 |
* required by this parameter. Else return <code>NULL</code> geometry type.
|
114 |
* See {@link Geometry.TYPES}
|
115 |
*
|
116 |
* @return Type of geometry required by this parameters. If parameter does
|
117 |
* not require any geometry return null.
|
118 |
*/
|
119 |
public int getGeometryType(); |
120 |
|
121 |
/**
|
122 |
* If parameter is of type Options, returns a <code>Map</code> with valid
|
123 |
* options. The map is composed by identifiers and values.
|
124 |
*
|
125 |
* The identifiers are used to check if an option is valid when provider
|
126 |
* receives an option. For example, an identifier of the option "Arc mode"
|
127 |
* could be "A".
|
128 |
*
|
129 |
* @return Map with identifiers and values of valid options.
|
130 |
*/
|
131 |
public Map<String, String> getOptions(); |
132 |
|
133 |
/**
|
134 |
* Returns "true" if it does not have to be displayed for the user to fill
|
135 |
* in, but it can be filled in by the user so that other parameters depend
|
136 |
* on it.
|
137 |
*
|
138 |
* @return is optional
|
139 |
*/
|
140 |
public boolean isOptional(); |
141 |
|
142 |
} |