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 @ 2870
History | View | Annotate | Download (4.52 KB)
1 | 159 | llmarques | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 52 | fdiaz | *
|
4 | 159 | llmarques | * 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 | 4 | llmarques | */
|
24 | 159 | llmarques | |
25 | 4 | llmarques | package org.gvsig.vectorediting.lib.api; |
26 | |||
27 | 191 | llmarques | import java.util.Map; |
28 | 156 | llmarques | import java.util.Set; |
29 | 73 | llmarques | import org.gvsig.fmap.geom.Geometry; |
30 | |||
31 | /**
|
||
32 | 244 | llmarques | * <p>
|
33 | * EditingServiceParameter represents values needed by services to work.
|
||
34 | * This parameters can be several type at the same type. For example, if
|
||
35 | * services needs the radius of a circle, that value can be a position of map or
|
||
36 | * a double value.
|
||
37 | * </p>
|
||
38 | 227 | llmarques | *
|
39 | 73 | llmarques | * @author gvSIG team.
|
40 | 244 | llmarques | * @version $Id$
|
41 | 73 | llmarques | *
|
42 | */
|
||
43 | 4 | llmarques | public interface EditingServiceParameter { |
44 | 10 | llmarques | |
45 | 244 | llmarques | /**
|
46 | * TYPE represents the available type of parameters. A parameter can be of
|
||
47 | * several types at the same type. The types of parameters are:
|
||
48 | 377 | fdiaz | *
|
49 | 244 | llmarques | * - Position: this kind of parameter expects a position in map.
|
50 | 377 | fdiaz | *
|
51 | 244 | llmarques | * - List of positions this kind of parameter expects a position in map.
|
52 | 377 | fdiaz | *
|
53 | 244 | llmarques | * - Option: this kind of parameter expects an option. Options is used to
|
54 | * change functionality of providers or to do actions. For example, an
|
||
55 | * option of Regular polygon can be "sides" that indicates side number of
|
||
56 | * regular polygon.
|
||
57 | 377 | fdiaz | *
|
58 | 244 | llmarques | * - Value: this kind of parameter expects an value.
|
59 | 377 | fdiaz | *
|
60 | 244 | llmarques | * - Selection: this kind of parameters expects a selection.
|
61 | 377 | fdiaz | *
|
62 | 244 | llmarques | * - Geometry: this kind of parameters expects a selection. See
|
63 | * {@link EditingServiceParameter#getGeometryType()} to know the type of
|
||
64 | * geometry is expected
|
||
65 | 377 | fdiaz | *
|
66 | 244 | llmarques | * @author llmarques
|
67 | *
|
||
68 | */
|
||
69 | 157 | llmarques | public enum TYPE { |
70 | 2444 | fdiaz | POSITION, LIST_POSITIONS, OPTION, VALUE, SELECTION, GEOMETRY, DISTANCE, CLIPBOARD |
71 | 157 | llmarques | } |
72 | 10 | llmarques | |
73 | 157 | llmarques | /**
|
74 | 244 | llmarques | * Gets types of this parameter.
|
75 | 227 | llmarques | *
|
76 | 157 | llmarques | * @return A <code> Set </code> of parameter types.
|
77 | */
|
||
78 | public Set<TYPE> getTypes(); |
||
79 | 44 | llmarques | |
80 | 157 | llmarques | /**
|
81 | * Gets a name of parameter.
|
||
82 | 227 | llmarques | *
|
83 | 157 | llmarques | * @return Parameter name
|
84 | */
|
||
85 | public String getName(); |
||
86 | 44 | llmarques | |
87 | 157 | llmarques | /**
|
88 | * Gets a description of parameter. Description is used to show a message on
|
||
89 | * console.
|
||
90 | 227 | llmarques | *
|
91 | 157 | llmarques | * @return Description parameter.
|
92 | */
|
||
93 | public String getDescription(); |
||
94 | 73 | llmarques | |
95 | 157 | llmarques | /**
|
96 | 365 | llmarques | * Gets the default value of this parameter. If this parameter doesn't have
|
97 | * default value, it will return null.
|
||
98 | 377 | fdiaz | *
|
99 | 365 | llmarques | * @return Default value of this parameter. Null if this parameter doesn't
|
100 | * have default value.
|
||
101 | */
|
||
102 | public Object getDefaultValue(); |
||
103 | |||
104 | /**
|
||
105 | 377 | fdiaz | * Sets the default value of this parameter.
|
106 | 2172 | fdiaz | * @param value
|
107 | 377 | fdiaz | */
|
108 | public void setDefaultValue(Object value); |
||
109 | |||
110 | 2870 | fdiaz | public String getConsoleDefaultValue(); |
111 | 377 | fdiaz | |
112 | /**
|
||
113 | 244 | llmarques | * If parameter is of type Geometry returns the type of geometry
|
114 | * required by this parameter. Else return <code>NULL</code> geometry type.
|
||
115 | 191 | llmarques | * See {@link Geometry.TYPES}
|
116 | 227 | llmarques | *
|
117 | 244 | llmarques | * @return Type of geometry required by this parameters. If parameter does
|
118 | 191 | llmarques | * not require any geometry return null.
|
119 | 157 | llmarques | */
|
120 | 191 | llmarques | public int getGeometryType(); |
121 | 157 | llmarques | |
122 | /**
|
||
123 | 191 | llmarques | * If parameter is of type Options, returns a <code>Map</code> with valid
|
124 | * options. The map is composed by identifiers and values.
|
||
125 | 227 | llmarques | *
|
126 | 191 | llmarques | * The identifiers are used to check if an option is valid when provider
|
127 | * receives an option. For example, an identifier of the option "Arc mode"
|
||
128 | * could be "A".
|
||
129 | 227 | llmarques | *
|
130 | 191 | llmarques | * @return Map with identifiers and values of valid options.
|
131 | 157 | llmarques | */
|
132 | 191 | llmarques | public Map<String, String> getOptions(); |
133 | 2125 | fdiaz | |
134 | 2723 | fdiaz | public EditingServiceParameterOptions getOptions2();
|
135 | |||
136 | 2125 | fdiaz | /**
|
137 | * Returns "true" if it does not have to be displayed for the user to fill
|
||
138 | * in, but it can be filled in by the user so that other parameters depend
|
||
139 | * on it.
|
||
140 | *
|
||
141 | * @return is optional
|
||
142 | */
|
||
143 | public boolean isOptional(); |
||
144 | 2723 | fdiaz | |
145 | public int getDataType(); |
||
146 | 191 | llmarques | |
147 | 4 | llmarques | } |