Statistics
| Revision:

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 @ 3838

History | View | Annotate | Download (4.87 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
import org.gvsig.fmap.geom.Geometry;
30

    
31
/**
32
 * <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
 *
39
 * @author gvSIG team.
40
 * @version $Id$
41
 *
42
 */
43
public interface EditingServiceParameter {
44

    
45
    /**
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
     *
49
     * - Position: this kind of parameter expects a position in map.
50
     *
51
     * - List of positions this kind of parameter expects a position in map.
52
     *
53
     * - 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
     *
58
     * - Value: this kind of parameter expects an value.
59
     *
60
     * - Selection: this kind of parameters expects a selection.
61
     *
62
     * - Geometry: this kind of parameters expects a selection. See
63
     * {@link EditingServiceParameter#getGeometryType()} to know the type of
64
     * geometry is expected
65
     *
66
     * @author llmarques
67
     *
68
     */
69
    public enum TYPE {
70
        POSITION, LIST_POSITIONS, OPTION, VALUE, SELECTION, MULTILAYER_SELECTION, GEOMETRY, DISTANCE, CLIPBOARD
71
    }
72

    
73
    /**
74
     * Gets types of this parameter.
75
     *
76
     * @return A <code> Set </code> of parameter types.
77
     */
78
    public Set<TYPE> getTypes();
79

    
80
    /**
81
     * Gets a name of parameter.
82
     *
83
     * @return Parameter name
84
     */
85
    public String getName();
86

    
87
    /**
88
     * Gets a description of parameter. Description is used to show a message on
89
     * console.
90
     *
91
     * @return Description parameter.
92
     */
93
    public String getDescription();
94
    
95
    /**
96
     * Sets the description. Description is used to show a message on console.
97
     * 
98
     * @param newDescription 
99
     */
100
    public void setDescription(String newDescription);
101

    
102

    
103
    /**
104
     * Gets the default value of this parameter. If this parameter doesn't have
105
     * default value, it will return null.
106
     *
107
     * @return Default value of this parameter. Null if this parameter doesn't
108
     *         have default value.
109
     */
110
    public Object getDefaultValue();
111

    
112
    /**
113
     * Sets the default value of this parameter.
114
     * @param value
115
     */
116
    public void setDefaultValue(Object value);
117

    
118
    public String getConsoleDefaultValue();
119

    
120
    /**
121
     * If parameter is of type Geometry returns the type of geometry
122
     * required by this parameter. Else return <code>NULL</code> geometry type.
123
     * See {@link Geometry.TYPES}
124
     *
125
     * @return Type of geometry required by this parameters. If parameter does
126
     *         not require any geometry return null.
127
     */
128
    public int getGeometryType();
129

    
130
    /**
131
     * If parameter is of type Options, returns a <code>Map</code> with valid
132
     * options. The map is composed by identifiers and values.
133
     *
134
     * The identifiers are used to check if an option is valid when provider
135
     * receives an option. For example, an identifier of the option "Arc mode"
136
     * could be "A".
137
     *
138
     * @return Map with identifiers and values of valid options.
139
     */
140
    public Map<String, String> getOptions();
141
    
142
    public EditingServiceParameterOptions getOptions2();
143
    
144
    /**
145
     * Returns "true" if it does not have to be displayed for the user to fill
146
     * in, but it can be filled in by the user so that other parameters depend
147
     * on it.
148
     *
149
     * @return is optional
150
     */
151
    public boolean isOptional();
152
    
153
    public int getDataType();
154

    
155
    public boolean isValidValue(Object value);
156
    
157
    public Object coerceValue(Object value);
158
    
159
    public boolean getAllowNull();
160
    
161

    
162
}