Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extWFS2 / src / org / gvsig / wfs / gui / panels / model / WFSSelectedFeature.java @ 38564

History | View | Annotate | Download (6.08 KB)

1
package org.gvsig.wfs.gui.panels.model;
2

    
3
import java.util.Vector;
4

    
5
import org.gvsig.remoteclient.utils.BoundaryBox;
6
import org.gvsig.remoteclient.wfs.WFSFeature;
7
import org.gvsig.remoteclient.wfs.WFSFeatureField;
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: WFSLayerNode.java 21917 2008-06-30 06:50:42Z ppiqueras $
52
 * $Log$
53
 * Revision 1.6.2.4  2007-01-25 16:11:15  jorpiell
54
 * Se han cambiado los imports que hac?an referencia a remoteServices. Esto es as?, porque se han renombrado las clases del driver de GML
55
 *
56
 * Revision 1.6.2.3  2006/11/28 09:24:45  jorpiell
57
 * Si una feature no tiene tipo, se le tiene que informar al usuario de ello
58
 *
59
 * Revision 1.6.2.2  2006/11/17 11:28:45  ppiqueras
60
 * Corregidos bugs y a?adida nueva funcionalidad.
61
 *
62
 * Revision 1.10  2006/11/02 11:13:03  jorpiell
63
 * Se ha capturado una nullPointerException al calcular la geomteria
64
 *
65
 * Revision 1.9  2006/11/01 17:29:07  jorpiell
66
 * Se ha elimiado el nodo virtual de la raiz. Adem?s ya se cargan los valores de un campo complejo en la pesta?a del filtro
67
 *
68
 * Revision 1.8  2006/10/23 07:37:04  jorpiell
69
 * Ya funciona el filterEncoding
70
 *
71
 * Revision 1.7  2006/10/10 12:55:06  jorpiell
72
 * Se ha a?adido el soporte de features complejas
73
 *
74
 * Revision 1.6  2006/06/21 12:35:45  jorpiell
75
 * Se ha a?adido la ventana de propiedades. Esto implica a?adir listeners por todos los paneles. Adem?s no se muestra la geomatr?a en la lista de atributos y se muestran ?nicamnete los que se van a descargar
76
 *
77
 * Revision 1.5  2006/06/15 07:50:58  jorpiell
78
 * A?adida la funcionalidad de reproyectar y hechos algunos cambios en la interfaz
79
 *
80
 * Revision 1.4  2006/05/25 10:31:55  jorpiell
81
 * Se ha renombrado la clase WFSFields por WFSAttributes porque era algo confusa
82
 *
83
 * Revision 1.3  2006/05/23 08:08:17  jorpiell
84
 * Eliminados los atributos innecesarios
85
 *
86
 * Revision 1.2  2006/04/20 16:38:24  jorpiell
87
 * Ahora mismo ya se puede hacer un getCapabilities y un getDescribeType de la capa seleccionada para ver los atributos a dibujar. Queda implementar el panel de opciones y hacer el getFeature().
88
 *
89
 * Revision 1.1  2006/04/19 12:50:16  jorpiell
90
 * Primer commit de la aplicaci?n. Se puede hacer un getCapabilities y ver el mensaje de vienvenida del servidor
91
 *
92
 *
93
 */
94
/**
95
 * This class represents one node of the layer tree of a
96
 * common WFS service.
97
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
98
 */
99
public class WFSSelectedFeature {
100
        private WFSFeature feature = null;        
101
        private Vector selectedFields = new Vector();
102
        private String filter = null;
103
        private Vector srs = new Vector();
104
        private BoundaryBox latLonBbox = null;
105
        private WFSFeatureField geometryField = null;
106
                
107
        /**
108
         * @param feature
109
         */
110
        public WFSSelectedFeature(WFSFeature feature) {
111
                super();
112
                this.feature = feature;
113
        }
114

    
115
        public WFSFeature getWFSFeature() {
116
                return feature;
117
        }
118
        
119
        /**
120
         * 
121
         */
122
        public String toString(){
123
                String str;
124
                if (getName()==null)
125
                        str = getTitle();
126
                else
127
                        str = "["+getName()+"] "+getTitle();
128
                return str;
129
        }
130
        
131
        /**
132
         * @return Returns the _abstract.
133
         */
134
        public String getAbstract() {
135
                return feature.getAbstract();
136
        }
137

    
138
        /**
139
         * @return Returns the name.
140
         */
141
        public String getName() {
142
                return feature.getName();
143
        }
144
        
145
        /**
146
         * @return Returns the title.
147
         */
148
        public String getTitle() {
149
                return feature.getTitle();
150
        }        
151
        
152
        /**
153
         * @return Returns the selectedFields.
154
         */
155
        public Vector getSelectedFields() {
156
                return selectedFields;
157
        }
158
        
159
        /**
160
         * @param selectedFields The selectedFields to set.
161
         */
162
        public void setSelectedFields(Vector selectedFields) {
163
                this.selectedFields = selectedFields;
164
        }
165
        
166
        /**
167
         * @param fields The fields to set.
168
         */
169
        public void setSelectedFields(Object[] selectedFields) {
170
                this.selectedFields.clear();
171
                for (int i=0 ; i<selectedFields.length ; i++){
172
                        this.selectedFields.add(selectedFields[i]);
173
                }
174
        }
175
        
176
        /**
177
         * @return Returns the srs.
178
         */
179
        public Vector getSrs() {
180
                return feature.getSrs();
181
        }        
182

    
183
        /**
184
         * @return Returns the latLonBbox.
185
         */
186
        public BoundaryBox getLatLonBbox() {
187
                return feature.getLatLonBbox();
188
        }
189
        
190
        /**
191
         * @return Returns the filter.
192
         */
193
        public String getFilter() {
194
                return filter;
195
        }
196
        
197
        /**
198
         * @param filter The filter to set.
199
         */
200
        public void setFilter(String filter) {
201
                this.filter = filter;
202
        }
203
        
204
        /**
205
         * @return the nameSpace
206
         */
207
        public String getNameSpace() {
208
                if (feature.getNamespace() != null){
209
                        return feature.getNamespace().getLocation();
210
                }
211
                return null;
212
        }
213
        
214
        /**
215
         * @param feature the feature to set
216
         */
217
        public void setFeature(WFSFeature feature) {
218
                this.feature = feature;
219
        }
220
        
221
        public WFSFeatureField getGeometryField() {
222
        if (geometryField == null){
223
            for (int i=0 ; i<getWFSFeature().getFieldSize() ; i++){           
224
                WFSFeatureField field = (WFSFeatureField)getWFSFeature().getFieldAt(i);
225
                if (field.isGeometry()){
226
                    geometryField = field;
227
                }               
228
            }           
229
        }
230
        return geometryField;
231
    }
232

    
233
}