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

History | View | Annotate | Download (3.69 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
     * If parameter is of type Geometry returns the type of geometry
98
     * required by this parameter. Else return <code>NULL</code> geometry type.
99
     * See {@link Geometry.TYPES}
100
     *
101
     * @return Type of geometry required by this parameters. If parameter does
102
     *         not require any geometry return null.
103
     */
104
    public int getGeometryType();
105

    
106
    /**
107
     * If parameter is of type Options, returns a <code>Map</code> with valid
108
     * options. The map is composed by identifiers and values.
109
     *
110
     * The identifiers are used to check if an option is valid when provider
111
     * receives an option. For example, an identifier of the option "Arc mode"
112
     * could be "A".
113
     *
114
     * @return Map with identifiers and values of valid options.
115
     */
116
    public Map<String, String> getOptions();
117

    
118
}