svn-gvsig-desktop / tags / v1_0_RELEASE / extensions / extWFS2 / src / com / iver / cit / gvsig / gui / panels / WFSParamsPanel.java @ 9167
History | View | Annotate | Download (16.9 KB)
1 | 4886 | jorpiell | package com.iver.cit.gvsig.gui.panels; |
---|---|---|---|
2 | |||
3 | import java.awt.event.FocusEvent; |
||
4 | import java.awt.event.FocusListener; |
||
5 | import java.util.prefs.Preferences; |
||
6 | |||
7 | import javax.swing.JTabbedPane; |
||
8 | |||
9 | 5948 | jorpiell | import org.gvsig.remoteClient.wfs.WFSStatus; |
10 | |||
11 | 4886 | jorpiell | import com.iver.andami.PluginServices; |
12 | import com.iver.cit.gvsig.fmap.drivers.wfs.FMapWFSDriver; |
||
13 | import com.iver.cit.gvsig.fmap.layers.FLayer; |
||
14 | 5300 | jorpiell | import com.iver.cit.gvsig.fmap.layers.FLyrWFS; |
15 | 4886 | jorpiell | import com.iver.cit.gvsig.fmap.layers.WFSLayerNode; |
16 | import com.iver.cit.gvsig.gui.WizardPanel; |
||
17 | import com.iver.cit.gvsig.gui.wizards.WFSWizardData; |
||
18 | 5948 | jorpiell | import com.iver.cit.gvsig.gui.wizards.WizardListener; |
19 | 4886 | jorpiell | import com.iver.cit.gvsig.gui.wizards.WizardListenerSupport; |
20 | |||
21 | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
||
22 | *
|
||
23 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
24 | *
|
||
25 | * This program is free software; you can redistribute it and/or
|
||
26 | * modify it under the terms of the GNU General Public License
|
||
27 | * as published by the Free Software Foundation; either version 2
|
||
28 | * of the License, or (at your option) any later version.
|
||
29 | *
|
||
30 | * This program is distributed in the hope that it will be useful,
|
||
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
33 | * GNU General Public License for more details.
|
||
34 | *
|
||
35 | * You should have received a copy of the GNU General Public License
|
||
36 | * along with this program; if not, write to the Free Software
|
||
37 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
38 | *
|
||
39 | * For more information, contact:
|
||
40 | *
|
||
41 | * Generalitat Valenciana
|
||
42 | * Conselleria d'Infraestructures i Transport
|
||
43 | * Av. Blasco Ib??ez, 50
|
||
44 | * 46010 VALENCIA
|
||
45 | * SPAIN
|
||
46 | *
|
||
47 | * +34 963862235
|
||
48 | * gvsig@gva.es
|
||
49 | * www.gvsig.gva.es
|
||
50 | *
|
||
51 | * or
|
||
52 | *
|
||
53 | * IVER T.I. S.A
|
||
54 | * Salamanca 50
|
||
55 | * 46005 Valencia
|
||
56 | * Spain
|
||
57 | *
|
||
58 | * +34 963163400
|
||
59 | * dac@iver.es
|
||
60 | */
|
||
61 | /* CVS MESSAGES:
|
||
62 | *
|
||
63 | * $Id$
|
||
64 | * $Log$
|
||
65 | 9154 | ppiqueras | * Revision 1.10.2.5 2006-12-04 09:42:57 ppiqueras
|
66 | * 1 Bug corregido. (subo este fichero por si acaso he modificado algo en ?l para corregir el bug)
|
||
67 | 9018 | jorpiell | *
|
68 | 9154 | ppiqueras | * Revision 1.22 2006/12/04 08:59:47 ppiqueras
|
69 | * Algunos bugs corregidos. A cambio hay 2 bugs relacionados que todav?a no han sido corregidos (ver PHPCollab) (los tiene asignados Jorge).
|
||
70 | 7586 | jorpiell | *
|
71 | 9154 | ppiqueras | * Revision 1.21 2006/11/28 08:05:13 jorpiell
|
72 | * Se escribe la query en la pesta?a del filtro
|
||
73 | *
|
||
74 | 8765 | jjdelcerro | * Revision 1.20 2006/11/14 13:45:49 ppiqueras
|
75 | * A?adida peque?a funcionalidad:
|
||
76 | * Cuando se pulsa el bot?n "Aplicar", (al seleccionar un nuevo filtro), si el ?rbol de campos posee alguno seleccionado, actualiza los valores (con los nuevos), asociados a ?ste campo seleccionado.
|
||
77 | *
|
||
78 | * Revision 1.19 2006/10/27 12:10:02 ppiqueras
|
||
79 | * Nueva funcionalidad
|
||
80 | *
|
||
81 | * Revision 1.16 2006/10/23 07:37:04 jorpiell
|
||
82 | * Ya funciona el filterEncoding
|
||
83 | *
|
||
84 | * Revision 1.14 2006/10/13 13:05:32 ppiqueras
|
||
85 | * Permite el refrescado de datos del panel de filtrado sobre capa WFS.
|
||
86 | *
|
||
87 | * Revision 1.13 2006/10/10 12:55:06 jorpiell
|
||
88 | * Se ha a?adido el soporte de features complejas
|
||
89 | *
|
||
90 | * Revision 1.12 2006/10/02 09:17:48 jorpiell
|
||
91 | * A?adido el setCRS a la capa
|
||
92 | *
|
||
93 | * Revision 1.11 2006/09/29 13:02:38 ppiqueras
|
||
94 | * Filtro para WFS. De momento s?lo interfaz gr?fica.
|
||
95 | *
|
||
96 | 7586 | jorpiell | * Revision 1.10 2006/07/21 11:50:31 jaume
|
97 | 6501 | jaume | * improved appearance
|
98 | *
|
||
99 | * Revision 1.9 2006/06/21 12:35:45 jorpiell
|
||
100 | 5948 | jorpiell | * 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
|
101 | *
|
||
102 | * Revision 1.8 2006/06/15 07:50:58 jorpiell
|
||
103 | 5856 | jorpiell | * A?adida la funcionalidad de reproyectar y hechos algunos cambios en la interfaz
|
104 | *
|
||
105 | * Revision 1.7 2006/05/25 16:22:47 jorpiell
|
||
106 | 5463 | jorpiell | * Se limpia el panel cada vez que se conecta con un servidor distinto
|
107 | *
|
||
108 | * Revision 1.6 2006/05/25 16:01:43 jorpiell
|
||
109 | 5454 | jorpiell | * Se ha a?adido la funcionalidad para eliminar el namespace de los tipos de atributos
|
110 | *
|
||
111 | * Revision 1.5 2006/05/25 10:31:06 jorpiell
|
||
112 | 5438 | jorpiell | * Como ha cambiado la forma de mostrar las capas (una tabla, en lugar de una lista), los paneles han tenido que ser modificados
|
113 | *
|
||
114 | * Revision 1.4 2006/05/23 08:09:39 jorpiell
|
||
115 | 5339 | jorpiell | * Se ha cambiado la forma en la que se leian los valores seleccionados en los paneles y se ha cambiado el comportamiento de los botones
|
116 | *
|
||
117 | * Revision 1.3 2006/05/19 12:57:08 jorpiell
|
||
118 | 5300 | jorpiell | * Modificados algunos paneles
|
119 | *
|
||
120 | * Revision 1.2 2006/04/20 16:38:24 jorpiell
|
||
121 | 4911 | jorpiell | * 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().
|
122 | *
|
||
123 | * Revision 1.1 2006/04/19 12:50:16 jorpiell
|
||
124 | 4886 | jorpiell | * Primer commit de la aplicaci?n. Se puede hacer un getCapabilities y ver el mensaje de vienvenida del servidor
|
125 | *
|
||
126 | *
|
||
127 | */
|
||
128 | /**
|
||
129 | * @author Jorge Piera Llodr? (piera_jor@gva.es)
|
||
130 | */
|
||
131 | public class WFSParamsPanel extends WizardPanel{ |
||
132 | private JTabbedPane jTabbedPane = null; // @jve:decl-index=0:visual-constraint="37,30" |
||
133 | private WFSSelectFeaturePanel featurePanel = null; |
||
134 | 5438 | jorpiell | private WFSSelectAttributesPanel fieldsPanel = null; |
135 | 4911 | jorpiell | private WFSOptionsPanel optionsPanel = null; |
136 | 5856 | jorpiell | private WFSFormatPanel formatPanel = null; |
137 | 8765 | jjdelcerro | private WFSFilterPanel filterPanel = null; |
138 | private WFSAreaPanel areaPanel = null; |
||
139 | 4886 | jorpiell | private WFSWizardData data;
|
140 | private WizardListenerSupport listenerSupport;
|
||
141 | public static Preferences fPrefs = Preferences.userRoot().node( "gvsig.wcs-wizard" ); |
||
142 | 4911 | jorpiell | private WFSInfoPanel infoPanel;
|
143 | private int indFields; |
||
144 | 8765 | jjdelcerro | private int indFilter; |
145 | private int indArea; |
||
146 | |||
147 | 6501 | jaume | |
148 | 4886 | jorpiell | /**
|
149 | 6501 | jaume | * This method initializes jTabbedPane
|
150 | *
|
||
151 | * @return javax.swing.JTabbedPane
|
||
152 | */
|
||
153 | |||
154 | 4886 | jorpiell | public WFSParamsPanel(){
|
155 | super();
|
||
156 | initialize(); |
||
157 | } |
||
158 | /**
|
||
159 | * Returns the tab amount that the WFSParamsPanel currently have
|
||
160 | 6501 | jaume | *
|
161 | 4886 | jorpiell | * Devuelve el n?mero de solapas que tiene actualmente el WFSParamsPanel
|
162 | 6501 | jaume | *
|
163 | 4886 | jorpiell | * @return int
|
164 | */
|
||
165 | public int getNumTabs(){ |
||
166 | return getJTabbedPane().getTabCount();
|
||
167 | } |
||
168 | 6501 | jaume | |
169 | 4886 | jorpiell | private void initialize() { |
170 | this.setLayout(null); |
||
171 | this.setVisible(false); |
||
172 | 6501 | jaume | this.setBounds(0, 0, 510, 427); |
173 | 4886 | jorpiell | this.add(getJTabbedPane(), null); |
174 | } |
||
175 | 6501 | jaume | |
176 | 4886 | jorpiell | /**
|
177 | * Sets the focus to the tab next to the current one.
|
||
178 | 6501 | jaume | *
|
179 | 4886 | jorpiell | * Enfoca a la solapa siguiente a la actualmente enfocada del TabbedPane
|
180 | *
|
||
181 | */
|
||
182 | public void avanzaTab(){ |
||
183 | int currentPage = currentPage();
|
||
184 | int nPages = getNumTabs();
|
||
185 | if (nPages -1 > currentPage){ |
||
186 | getJTabbedPane().setSelectedIndex(nextPageEnabled()); |
||
187 | } |
||
188 | } |
||
189 | 6501 | jaume | |
190 | 4886 | jorpiell | /**
|
191 | 6501 | jaume | * Sets the focus to the tab previous to the current one.
|
192 | *
|
||
193 | 4886 | jorpiell | * Enfoca a la solapa anterior a la actualmente enfocada del TabbedPane
|
194 | 6501 | jaume | *
|
195 | 4886 | jorpiell | */
|
196 | public void retrocedeTab(){ |
||
197 | this.getJTabbedPane().setSelectedIndex(previousEnabledPage());
|
||
198 | } |
||
199 | 6501 | jaume | |
200 | 4886 | jorpiell | /**
|
201 | * Returns the current tab index.
|
||
202 | 6501 | jaume | *
|
203 | 4886 | jorpiell | * Devuelve el n?mero de solapa en que se encuentra
|
204 | 6501 | jaume | *
|
205 | 4886 | jorpiell | * @return
|
206 | */
|
||
207 | public int getIndiceSolapaActual(){ |
||
208 | return this.getJTabbedPane().getSelectedIndex(); |
||
209 | } |
||
210 | 6501 | jaume | |
211 | 5454 | jorpiell | public JTabbedPane getJTabbedPane() { |
212 | 4886 | jorpiell | if (jTabbedPane == null) { |
213 | jTabbedPane = new JTabbedPane(); |
||
214 | 6501 | jaume | jTabbedPane.setBounds(4, 4, 502, 415); |
215 | 4886 | jorpiell | jTabbedPane.addTab(PluginServices.getText(this, "info"), null, getInfoPanel()); |
216 | 8765 | jjdelcerro | jTabbedPane.addTab(PluginServices.getText(this, "feature"), null, getFeaturesPanel(), null); |
217 | jTabbedPane.addTab(PluginServices.getText(this, "attributes"),null, getAttributesPanel(), null); |
||
218 | 5856 | jorpiell | indFields = jTabbedPane.getTabCount() - 1;
|
219 | 4911 | jorpiell | jTabbedPane.setEnabledAt(indFields, false);
|
220 | 5856 | jorpiell | //jTabbedPane.addTab(PluginServices.getText(this,"formatos"),null,getFormatPanel(),null);
|
221 | 8765 | jjdelcerro | // indFormat = jTabbedPane.getTabCount() - 1;
|
222 | // jTabbedPane.setEnabledAt(indFormat, false);
|
||
223 | 4911 | jorpiell | jTabbedPane.addTab(PluginServices.getText(this, "options"),null, getOptionsPanel(), null); |
224 | 8765 | jjdelcerro | jTabbedPane.addTab(PluginServices.getText(this, "filter"),null, getFilterPanel(), null); |
225 | indFilter = jTabbedPane.getTabCount() - 1;
|
||
226 | jTabbedPane.setEnabledAt(indFilter, false);
|
||
227 | //jTabbedPane.addTab(PluginServices.getText(this, "area"),null, getAreaPanel(), null);
|
||
228 | indArea = jTabbedPane.getTabCount() - 1;
|
||
229 | jTabbedPane.setEnabledAt(indArea, false);
|
||
230 | 4886 | jorpiell | } |
231 | return jTabbedPane;
|
||
232 | } |
||
233 | 6501 | jaume | |
234 | 4911 | jorpiell | private WFSInfoPanel getInfoPanel() {
|
235 | 4886 | jorpiell | if (infoPanel==null) { |
236 | 4911 | jorpiell | infoPanel = new WFSInfoPanel();
|
237 | 4886 | jorpiell | infoPanel.addFocusListener(new FocusListener() { |
238 | public void focusGained(java.awt.event.FocusEvent e) { |
||
239 | 5339 | jorpiell | refreshInfo(); |
240 | 4886 | jorpiell | } |
241 | |||
242 | 5339 | jorpiell | private void refreshInfo() { |
243 | WFSLayerNode selectedNode = featurePanel.getSelectedFeature(); |
||
244 | 5948 | jorpiell | if (selectedNode != null){ |
245 | selectedNode.setSelectedFields(fieldsPanel.getSelectedFields()); |
||
246 | 6501 | jaume | } |
247 | 5339 | jorpiell | data.setUserName(optionsPanel.getUserName()); |
248 | data.setBuffer(optionsPanel.getBuffer()); |
||
249 | data.setTimeOut(optionsPanel.getTimeout()); |
||
250 | infoPanel.refresh(data,selectedNode); |
||
251 | } |
||
252 | |||
253 | 4886 | jorpiell | public void focusLost(FocusEvent e) { |
254 | 6501 | jaume | |
255 | 4886 | jorpiell | } |
256 | }); |
||
257 | } |
||
258 | return infoPanel;
|
||
259 | } |
||
260 | 6501 | jaume | |
261 | 4886 | jorpiell | /**
|
262 | 6501 | jaume | *
|
263 | 4911 | jorpiell | * @return the selected list
|
264 | 4886 | jorpiell | */
|
265 | 4911 | jorpiell | private Object getSelectedFeature() { |
266 | return featurePanel.getSelectedFeature();
|
||
267 | 6501 | jaume | } |
268 | |||
269 | |||
270 | 4886 | jorpiell | /**
|
271 | 6501 | jaume | * This method initializes panelFeatures
|
272 | *
|
||
273 | * @return javax.swing.JPanel
|
||
274 | */
|
||
275 | 8765 | jjdelcerro | private WFSSelectFeaturePanel getFeaturesPanel() {
|
276 | 4886 | jorpiell | if (featurePanel == null) { |
277 | 4911 | jorpiell | featurePanel = new WFSSelectFeaturePanel(this); |
278 | 4886 | jorpiell | featurePanel.setLayout(null);
|
279 | } |
||
280 | return featurePanel;
|
||
281 | } |
||
282 | 6501 | jaume | |
283 | 4886 | jorpiell | /**
|
284 | 6501 | jaume | * This method initializes fieldsPanel
|
285 | *
|
||
286 | * @return javax.swing.JPanel
|
||
287 | */
|
||
288 | 8765 | jjdelcerro | private WFSSelectAttributesPanel getAttributesPanel(){
|
289 | 4911 | jorpiell | if (fieldsPanel == null) { |
290 | 5948 | jorpiell | fieldsPanel = new WFSSelectAttributesPanel(this); |
291 | 4911 | jorpiell | fieldsPanel.setLayout(null);
|
292 | } |
||
293 | return fieldsPanel;
|
||
294 | } |
||
295 | 6501 | jaume | |
296 | |||
297 | |||
298 | 4911 | jorpiell | /**
|
299 | 6501 | jaume | * This method initializes fieldsPanel
|
300 | *
|
||
301 | * @return javax.swing.JPanel
|
||
302 | */
|
||
303 | 5300 | jorpiell | private WFSOptionsPanel getOptionsPanel(){
|
304 | 4911 | jorpiell | if (optionsPanel == null) { |
305 | 5948 | jorpiell | optionsPanel = new WFSOptionsPanel(this); |
306 | 4911 | jorpiell | optionsPanel.setLayout(null);
|
307 | } |
||
308 | return optionsPanel;
|
||
309 | } |
||
310 | 6501 | jaume | |
311 | 8765 | jjdelcerro | |
312 | /**
|
||
313 | * This method initializes filterPanel
|
||
314 | *
|
||
315 | * @return javax.swing.JPanel
|
||
316 | */
|
||
317 | private WFSFilterPanel getFilterPanel(){
|
||
318 | if (filterPanel == null) { |
||
319 | filterPanel = new WFSFilterPanel(this); |
||
320 | filterPanel.setVisible(true);
|
||
321 | //filterPanel.setLayout(null);
|
||
322 | } |
||
323 | return filterPanel;
|
||
324 | } |
||
325 | |||
326 | /**
|
||
327 | * This method initializes areaPanel
|
||
328 | *
|
||
329 | * @return javax.swing.JPanel
|
||
330 | */
|
||
331 | private WFSAreaPanel getAreaPanel(){
|
||
332 | if (areaPanel == null) { |
||
333 | areaPanel = new WFSAreaPanel(this); |
||
334 | areaPanel.setVisible(true);
|
||
335 | } |
||
336 | return areaPanel;
|
||
337 | } |
||
338 | 6501 | jaume | |
339 | 4911 | jorpiell | /**
|
340 | 6501 | jaume | * This method initializes formatPanel
|
341 | *
|
||
342 | * @return javax.swing.JPanel
|
||
343 | */
|
||
344 | 5856 | jorpiell | private WFSFormatPanel getFormatPanel(){
|
345 | if (formatPanel == null) { |
||
346 | formatPanel = new WFSFormatPanel();
|
||
347 | formatPanel.setLayout(null);
|
||
348 | } |
||
349 | return formatPanel;
|
||
350 | } |
||
351 | 6501 | jaume | |
352 | 5856 | jorpiell | /**
|
353 | 4886 | jorpiell | * Verifies that the selected parameters are enough to request the coverage
|
354 | * to the server.
|
||
355 | 6501 | jaume | *
|
356 | 4886 | jorpiell | * Comprueba que los par?metros seleccionados son suficientes para pedir la
|
357 | * cobertura al servidor.
|
||
358 | 6501 | jaume | *
|
359 | 4886 | jorpiell | * @return boolean
|
360 | */
|
||
361 | public boolean isCorretlyConfigured() { |
||
362 | 5339 | jorpiell | if (featurePanel.getSelectedFeature()!= null){ |
363 | return true; |
||
364 | }else{
|
||
365 | return false; |
||
366 | } |
||
367 | 6501 | jaume | } |
368 | 4886 | jorpiell | |
369 | /**
|
||
370 | * Cleans up the wizard's components but the server's layers list.
|
||
371 | 6501 | jaume | *
|
372 | 4886 | jorpiell | * Limpia todos los componentes del wizard excepto la lista de capas del
|
373 | * servidor.
|
||
374 | */
|
||
375 | public void cleanupWizard() { |
||
376 | 5454 | jorpiell | jTabbedPane.setEnabledAt(indFields,false);
|
377 | 5856 | jorpiell | // jTabbedPane.setEnabledAt(indFormat,false);
|
378 | 4886 | jorpiell | } |
379 | 6501 | jaume | |
380 | 4886 | jorpiell | /**
|
381 | 4911 | jorpiell | * Refreshes the wizard components data each time a feature
|
382 | * is selected.
|
||
383 | 6501 | jaume | *
|
384 | * Actualiza los datos de los componentes del wizard cada vez
|
||
385 | 4911 | jorpiell | * que se selecciona una feature diferente.
|
386 | 6501 | jaume | *
|
387 | 4911 | jorpiell | * @param feature
|
388 | * Selected feature
|
||
389 | 4886 | jorpiell | */
|
390 | 4911 | jorpiell | public void refreshData(WFSLayerNode feature){ |
391 | 5438 | jorpiell | if (feature != null){ |
392 | feature = (WFSLayerNode)data.getFeatureInfo(feature.getName()); |
||
393 | 8765 | jjdelcerro | jTabbedPane.setEnabledAt(indFields,true);
|
394 | jTabbedPane.setEnabledAt(indFilter,true);
|
||
395 | jTabbedPane.setEnabledAt(indArea,true);
|
||
396 | 5856 | jorpiell | fieldsPanel.refresh(feature); |
397 | optionsPanel.refresh(feature); |
||
398 | 8765 | jjdelcerro | filterPanel.refresh(feature); |
399 | 5438 | jorpiell | } |
400 | 5339 | jorpiell | listenerSupport.callStateChanged(isCorretlyConfigured()); |
401 | 6501 | jaume | |
402 | 4886 | jorpiell | } |
403 | 6501 | jaume | |
404 | 5948 | jorpiell | public void refreshInfo(WFSLayerNode feature){ |
405 | infoPanel.refresh(data,feature); |
||
406 | } |
||
407 | 4886 | jorpiell | |
408 | /**
|
||
409 | * Sets the object that holds the wizard data.
|
||
410 | 6501 | jaume | *
|
411 | 4886 | jorpiell | * Establece el objeto que contiene los datos del wizard.
|
412 | 6501 | jaume | *
|
413 | 4886 | jorpiell | * @param data
|
414 | */
|
||
415 | public void setWizardData(WFSWizardData data) { |
||
416 | this.data = data;
|
||
417 | 5463 | jorpiell | //WFSLayerNode selectedNode = (WFSLayerNode)featurePanel.getSelectedFeature();
|
418 | 4911 | jorpiell | featurePanel.setWizardData(data); |
419 | 5339 | jorpiell | data.setBuffer(optionsPanel.getBuffer()); |
420 | 6501 | jaume | data.setTimeOut(optionsPanel.getTimeout()); |
421 | infoPanel.refresh(data,null);
|
||
422 | 4886 | jorpiell | } |
423 | 6501 | jaume | |
424 | 4886 | jorpiell | /**
|
425 | * Sets the wizard's data source
|
||
426 | 6501 | jaume | *
|
427 | 4886 | jorpiell | * Establece el origen de los datos del wizard
|
428 | * @param dataSource
|
||
429 | */
|
||
430 | public void setDataSource(WFSWizardData dataSource) { |
||
431 | this.data = dataSource;
|
||
432 | 6501 | jaume | |
433 | 4886 | jorpiell | } |
434 | 6501 | jaume | |
435 | |||
436 | 4886 | jorpiell | /**
|
437 | * Returns the next enabled tab's index.
|
||
438 | 6501 | jaume | *
|
439 | 4886 | jorpiell | * Devuelve el ?ndicie de la siguiente pesta?a habilitada del wizard o -1 si no hay
|
440 | * ninguna.
|
||
441 | 6501 | jaume | *
|
442 | 4886 | jorpiell | * @return The index or -1 if there is no one.
|
443 | */
|
||
444 | public int nextPageEnabled() { |
||
445 | int currentPage = currentPage();
|
||
446 | int nPages = getNumTabs();
|
||
447 | if (currentPage == nPages)
|
||
448 | return -1; |
||
449 | for (int i=currentPage+1; i<nPages; i++){ |
||
450 | if (getJTabbedPane().isEnabledAt(i)){
|
||
451 | return i;
|
||
452 | } |
||
453 | } |
||
454 | return -1; |
||
455 | } |
||
456 | 6501 | jaume | |
457 | 4886 | jorpiell | /**
|
458 | * Returns the index of the current tab.
|
||
459 | 6501 | jaume | *
|
460 | 4886 | jorpiell | * Devuelve el ?ndice de la p?gina actual del wizard.
|
461 | 6501 | jaume | *
|
462 | 4886 | jorpiell | * @return
|
463 | */
|
||
464 | public int currentPage() { |
||
465 | return getJTabbedPane().getSelectedIndex();
|
||
466 | } |
||
467 | 6501 | jaume | |
468 | 4886 | jorpiell | /**
|
469 | * Returns the index of the previous enabled tab.
|
||
470 | 6501 | jaume | *
|
471 | 4886 | jorpiell | * Devuelve el ?ndice de la anterior p?gina habilitada del wizard o -1 si no hay
|
472 | * ninguna.
|
||
473 | 6501 | jaume | *
|
474 | 4886 | jorpiell | * @return The index, or -1 if there is no one.
|
475 | */
|
||
476 | public int previousEnabledPage() { |
||
477 | int currentPage = currentPage();
|
||
478 | int j=0; |
||
479 | if (currentPage == 0) |
||
480 | j= -1;
|
||
481 | for (int i = currentPage-1; i>-1; i--){ |
||
482 | if (getJTabbedPane().isEnabledAt(i)){
|
||
483 | j= i; |
||
484 | break;
|
||
485 | } |
||
486 | } |
||
487 | return j;
|
||
488 | } |
||
489 | |||
490 | public FMapWFSDriver getDriver() {
|
||
491 | return data.getDriver();
|
||
492 | } |
||
493 | 6501 | jaume | |
494 | 4886 | jorpiell | public void setListenerSupport(WizardListenerSupport support) { |
495 | listenerSupport = support; |
||
496 | } |
||
497 | |||
498 | 6501 | jaume | |
499 | 5300 | jorpiell | /*
|
500 | * (non-Javadoc)
|
||
501 | * @see com.iver.cit.gvsig.gui.WizardPanel#initWizard()
|
||
502 | */
|
||
503 | public void initWizard() { |
||
504 | 6501 | jaume | |
505 | 5300 | jorpiell | } |
506 | 6501 | jaume | |
507 | 5300 | jorpiell | /*
|
508 | * (non-Javadoc)
|
||
509 | * @see com.iver.cit.gvsig.gui.WizardPanel#execute()
|
||
510 | */
|
||
511 | 6501 | jaume | public void execute() { |
512 | |||
513 | 5300 | jorpiell | } |
514 | 6501 | jaume | |
515 | 5300 | jorpiell | /*
|
516 | * (non-Javadoc)
|
||
517 | * @see com.iver.cit.gvsig.gui.ILayerPanel#getLayer()
|
||
518 | */
|
||
519 | public FLayer getLayer() {
|
||
520 | FLyrWFS layer = new FLyrWFS();
|
||
521 | 8765 | jjdelcerro | layer.setName(getFeaturesPanel().getLayerText()); |
522 | layer.setLayerName(getFeaturesPanel().getLayerName()); |
||
523 | 5948 | jorpiell | layer.setWfsLayerNode(getLayerNode()); |
524 | 8765 | jjdelcerro | layer.setFields(getAttributesPanel().getSelectedFields()); |
525 | 5300 | jorpiell | layer.setUserName(getOptionsPanel().getUserName()); |
526 | layer.setPassword(getOptionsPanel().getPassword()); |
||
527 | layer.setNumfeatures(getOptionsPanel().getBuffer()); |
||
528 | layer.setTimeout(getOptionsPanel().getTimeout()); |
||
529 | 7586 | jorpiell | layer.setSrs(getOptionsPanel().getSRS()); |
530 | 8765 | jjdelcerro | layer.setAttributesQuery(getFilterPanel().getQuery()); |
531 | 5300 | jorpiell | layer.setWfsDriver(data.getDriver()); |
532 | return layer;
|
||
533 | } |
||
534 | 6501 | jaume | |
535 | 5948 | jorpiell | private WFSLayerNode getLayerNode(){
|
536 | 8765 | jjdelcerro | WFSLayerNode layerNode = getFeaturesPanel().getWFSLayerNode(); |
537 | layerNode.setSelectedFields(getAttributesPanel().getSelectedFields()); |
||
538 | layerNode.setFilter(getFilterPanel().getQuery()); |
||
539 | 5948 | jorpiell | return layerNode;
|
540 | } |
||
541 | 6501 | jaume | |
542 | |||
543 | 5948 | jorpiell | public void setSelectedFeature(WFSLayerNode layerNode){ |
544 | 8765 | jjdelcerro | getFeaturesPanel().setSelectedFeature(layerNode); |
545 | getAttributesPanel().setSelectedFields(layerNode); |
||
546 | getFilterPanel().setQuery(layerNode.getFilter()); |
||
547 | } |
||
548 | |||
549 | |||
550 | 5948 | jorpiell | /**
|
551 | * @return Returns the data.
|
||
552 | */
|
||
553 | public WFSWizardData getData() {
|
||
554 | return data;
|
||
555 | } |
||
556 | public void setLayerName(String name) { |
||
557 | 8765 | jjdelcerro | getFeaturesPanel().setLayerName(name); |
558 | 6501 | jaume | |
559 | 5948 | jorpiell | } |
560 | 6501 | jaume | |
561 | 5948 | jorpiell | public void addWizardListener(WizardListener listener) { |
562 | 6501 | jaume | listenerSupport.addWizardListener(listener); |
563 | 5948 | jorpiell | } |
564 | 6501 | jaume | |
565 | 5948 | jorpiell | public void isApplicable(boolean applicable){ |
566 | listenerSupport.callStateChanged(applicable); |
||
567 | } |
||
568 | |||
569 | 6501 | jaume | |
570 | 5948 | jorpiell | public void setStatus(WFSStatus status) { |
571 | 6501 | jaume | getOptionsPanel().setStatus(status); |
572 | 9018 | jorpiell | getFilterPanel().setQuery(status.getFilterQuery()); |
573 | 5948 | jorpiell | } |
574 | 6501 | jaume | |
575 | 8765 | jjdelcerro | /**
|
576 | *
|
||
577 | *
|
||
578 | */
|
||
579 | public void updateWFSFilterFieldValues() { |
||
580 | filterPanel.updateFieldValues(); |
||
581 | } |
||
582 | |||
583 | /**
|
||
584 | * @see WFSFilterPanel#setWFSFilterPanelIsAsTabForWFSLayersLoad(boolean)
|
||
585 | */
|
||
586 | public void setWFSFilterPanelIsAsTabForWFSLayersLoad(boolean b) { |
||
587 | 9154 | ppiqueras | this.getFilterPanel().setWFSFilterPanelIsAsTabForWFSLayersLoad(b);
|
588 | } |
||
589 | |||
590 | /**
|
||
591 | * @see WFSFilterPanel#getWFSFilterPanelIsAsTabForWFSLayersLoad()
|
||
592 | */
|
||
593 | public boolean getWFSFilterPanelIsAsTabForWFSLayersLoad() { |
||
594 | return this.getFilterPanel().getWFSFilterPanelIsAsTabForWFSLayersLoad(); |
||
595 | } |
||
596 | |||
597 | /**
|
||
598 | * @see WFSSelectAttributesPanel#getAttributesSelectedOfSameLayerHasChanged()
|
||
599 | */
|
||
600 | public boolean getAttributesSelectedOfSameLayerHasChanged() { |
||
601 | return this.getAttributesPanel().getAttributesSelectedOfSameLayerHasChanged(); |
||
602 | } |
||
603 | |||
604 | /**
|
||
605 | * @see WFSSelectAttributesPanel#resetAttributesSelectedOfSameLayerHasChanged()
|
||
606 | */
|
||
607 | public void resetAttributesSelectedOfSameLayerHasChanged() { |
||
608 | this.getAttributesPanel().resetAttributesSelectedOfSameLayerHasChanged();
|
||
609 | } |
||
610 | 4886 | jorpiell | } |