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

History | View | Annotate | Download (4.52 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, 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
     * Gets the default value of this parameter. If this parameter doesn't have
97
     * default value, it will return null.
98
     *
99
     * @return Default value of this parameter. Null if this parameter doesn't
100
     *         have default value.
101
     */
102
    public Object getDefaultValue();
103

    
104
    /**
105
     * Sets the default value of this parameter.
106
     * @param value
107
     */
108
    public void setDefaultValue(Object value);
109

    
110
    public String getConsoleDefaultValue();
111

    
112
    /**
113
     * If parameter is of type Geometry returns the type of geometry
114
     * required by this parameter. Else return <code>NULL</code> geometry type.
115
     * See {@link Geometry.TYPES}
116
     *
117
     * @return Type of geometry required by this parameters. If parameter does
118
     *         not require any geometry return null.
119
     */
120
    public int getGeometryType();
121

    
122
    /**
123
     * If parameter is of type Options, returns a <code>Map</code> with valid
124
     * options. The map is composed by identifiers and values.
125
     *
126
     * 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
     *
130
     * @return Map with identifiers and values of valid options.
131
     */
132
    public Map<String, String> getOptions();
133
    
134
    public EditingServiceParameterOptions getOptions2();
135
    
136
    /**
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
    
145
    public int getDataType();
146

    
147
}