Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libWMSv0 / src / com / iver / wmsclient / FeatureInfoQuery.java @ 189

History | View | Annotate | Download (3.4 KB)

1
package com.iver.wmsclient;
2

    
3
/**
4
 * Estructura de datos que almacena la informaci?n necesaria para realizar una
5
 * petici?n GetFeatureInfo
6
 *
7
 * @author Fernando Gonz?lez Cort?s
8
 */
9
public class FeatureInfoQuery {
10
    private MapQuery mq;
11
    private String infoFormat;
12
    private int featureCount = -1;
13
    private String layerInfoQuery;
14
    private int x;
15
    private int y;
16
    private String exceptions;
17

    
18
    /**
19
     * Creates a new FeatureInfoQuery object.
20
     *
21
     * @param query MapQuery que se embeber? en la petici?n GetFeatureInfo
22
     */
23
    public FeatureInfoQuery(MapQuery query) {
24
        mq = query;
25
    }
26

    
27
    /**
28
     * Obtiene la representaci?n de la query en la forma de las peticiones GET
29
     *
30
     * @return string
31
     */
32
    public String getQuery() {
33
        String ret = "";
34
        ret = ret + mq.getQueryHeader() +
35
            "REQUEST=GetFeatureInfo&" + mq.getPartialQuery()+ 
36
                        "&QUERY_LAYERS=" + layerInfoQuery + 
37
                        "&X=" + x + "&Y=" + y;
38

    
39
        if (infoFormat != null) {
40
            ret += ("&INFO_FORMAT=" + infoFormat);
41
        }
42

    
43
        if (featureCount != -1) {
44
            ret += ("&FEATURE_COUNT=" + featureCount);
45
        }
46

    
47
        if (exceptions != null) {
48
            ret += ("&EXCEPTIONS=" + exceptions);
49
        } else {
50
            ret += ("&EXCEPTIONS=XML");
51
        }
52

    
53
        return ret;
54
    }
55

    
56
    /**
57
     * Obtiene el par?metro exceptions
58
     *
59
     * @return
60
     */
61
    public String getExceptions() {
62
        return exceptions;
63
    }
64

    
65
    /**
66
     * Obtiene el par?metro FeatureCount
67
     *
68
     * @return
69
     */
70
    public int getFeatureCount() {
71
        return featureCount;
72
    }
73

    
74
    /**
75
     * Obtiene el par?metro InfoFormat
76
     *
77
     * @return
78
     */
79
    public String getInfoFormat() {
80
        return infoFormat;
81
    }
82

    
83
    /**
84
     * Obtiene la MapQuery embebida
85
     *
86
     * @return
87
     */
88
    public MapQuery getMq() {
89
        return mq;
90
    }
91

    
92
    /**
93
     * Obtiene el par?metro X
94
     *
95
     * @return
96
     */
97
    public int getX() {
98
        return x;
99
    }
100

    
101
    /**
102
     * Obtiene el par?metro Y
103
     *
104
     * @return
105
     */
106
    public int getY() {
107
        return y;
108
    }
109

    
110
    /**
111
     * Establece el par?metro Exceptions
112
     *
113
     * @param string
114
     */
115
    public void setExceptions(String string) {
116
        exceptions = string;
117
    }
118

    
119
    /**
120
     * Establece el par?metro FeatureCount
121
     *
122
     * @param i
123
     */
124
    public void setFeatureCount(int i) {
125
        featureCount = i;
126
    }
127

    
128
    /**
129
     * Establece el par?metro InfoFormat
130
     *
131
     * @param string
132
     */
133
    public void setInfoFormat(String string) {
134
        infoFormat = string;
135
    }
136

    
137
    /**
138
     * Establece la MapQuery embebida
139
     *
140
     * @param query
141
     */
142
    public void setMq(MapQuery query) {
143
        mq = query;
144
    }
145

    
146
    /**
147
     * Establece el par?metro X
148
     *
149
     * @param i
150
     */
151
    public void setX(int i) {
152
        x = i;
153
    }
154

    
155
    /**
156
     * Establece el par?metro Y
157
     *
158
     * @param i
159
     */
160
    public void setY(int i) {
161
        y = i;
162
    }
163

    
164
    /**
165
     * Devuelve una string con los nombres de las capas queryables separadas
166
     * por comas
167
     *
168
     * @return
169
     */
170
    public String getInfoQuery() {
171
        return layerInfoQuery;
172
    }
173

    
174
    /**
175
     * Establece los nombres de las capas queryables
176
     *
177
     * @param string string con los nombres separados por comas
178
     */
179
    public void setInfoQuery(String string) {
180
        layerInfoQuery = string;
181
    }
182
}