Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extWFS2 / src / com / iver / cit / gvsig / gui / panels / WFSParamsPanel.java @ 10072

History | View | Annotate | Download (20.4 KB)

1
package com.iver.cit.gvsig.gui.panels;
2

    
3
import java.awt.event.FocusEvent;
4
import java.awt.event.FocusListener;
5
import java.util.Map;
6
import java.util.prefs.Preferences;
7

    
8
import javax.swing.JOptionPane;
9
import javax.swing.JTabbedPane;
10

    
11
import org.gvsig.remoteClient.wfs.WFSStatus;
12

    
13
import com.iver.andami.PluginServices;
14
import com.iver.cit.gvsig.fmap.drivers.wfs.FMapWFSDriver;
15
import com.iver.cit.gvsig.fmap.layers.FLayer;
16
import com.iver.cit.gvsig.fmap.layers.FLyrWFS;
17
import com.iver.cit.gvsig.fmap.layers.WFSLayerNode;
18
import com.iver.cit.gvsig.gui.WizardPanel;
19
import com.iver.cit.gvsig.gui.dialogs.WFSPropsDialog;
20
import com.iver.cit.gvsig.gui.wizards.WFSWizard;
21
import com.iver.cit.gvsig.gui.wizards.WFSWizardData;
22
import com.iver.cit.gvsig.gui.wizards.WizardListener;
23
import com.iver.cit.gvsig.gui.wizards.WizardListenerSupport;
24

    
25
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
26
 *
27
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
28
 *
29
 * This program is free software; you can redistribute it and/or
30
 * modify it under the terms of the GNU General Public License
31
 * as published by the Free Software Foundation; either version 2
32
 * of the License, or (at your option) any later version.
33
 *
34
 * This program is distributed in the hope that it will be useful,
35
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
37
 * GNU General Public License for more details.
38
 *
39
 * You should have received a copy of the GNU General Public License
40
 * along with this program; if not, write to the Free Software
41
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
42
 *
43
 * For more information, contact:
44
 *
45
 *  Generalitat Valenciana
46
 *   Conselleria d'Infraestructures i Transport
47
 *   Av. Blasco Ib??ez, 50
48
 *   46010 VALENCIA
49
 *   SPAIN
50
 *
51
 *      +34 963862235
52
 *   gvsig@gva.es
53
 *      www.gvsig.gva.es
54
 *
55
 *    or
56
 *
57
 *   IVER T.I. S.A
58
 *   Salamanca 50
59
 *   46005 Valencia
60
 *   Spain
61
 *
62
 *   +34 963163400
63
 *   dac@iver.es
64
 */
65
/* CVS MESSAGES:
66
 *
67
 * $Id: WFSParamsPanel.java 10072 2007-02-02 12:22:22Z ppiqueras $
68
 * $Log$
69
 * Revision 1.30  2007-02-02 12:22:22  ppiqueras
70
 * Corregido alg?n bug.
71
 *
72
 * Revision 1.29  2007/01/08 09:37:39  ppiqueras
73
 * Eliminado comentario que sobraba
74
 *
75
 * Revision 1.28  2006/12/29 09:27:02  ppiqueras
76
 * Corregidos varios bugs:
77
 *
78
 * - Se ejecuta 2 veces "Aplicar" o "Aceptar" en los filtros WFS.
79
 * - Cuando se carga por primera vez una capa WFS, si se pone un
80
 * filtro incorrecto, se ignora el filtro (cargando toda la informaci?n posible de la capa, y borrando el texto de filtrado).
81
 *
82
 * Revision 1.27  2006/12/26 09:19:40  ppiqueras
83
 * Cambiado "atttibutes" en todas las aparaciones en atributos, m?todos, clases, paquetes o comentarios por "fields". (S?lo a aquellas que afectan a clases dentro del proyecto extWFS2).
84
 *
85
 * Revision 1.26  2006/12/20 14:22:06  ppiqueras
86
 * A?adido comentario
87
 *
88
 * Revision 1.25  2006/12/15 13:59:36  ppiqueras
89
 * -Permite que se almacenen y/o recojan todos los campos y valores conocidos de la capa actual.
90
 *
91
 * -Adem?s, control frentre a consultas de filtro err?neas, (esto a medias a?n).
92
 *
93
 * - Alg?n comentario m?s.
94
 *
95
 * Revision 1.24  2006/12/12 10:24:45  ppiqueras
96
 * Nueva funcionalidad: Pulsando doble 'click' sobre una capa de un servidor, se carga (igual que antes), pero adem?s se avanza a la siguiente pesta?a sin tener que pulsar el bot?n 'Siguiente'.
97
 *
98
 * Revision 1.23  2006/12/11 11:02:24  ppiqueras
99
 * Corregido bug -> que se mantenga la frase de filtrado
100
 *
101
 * Revision 1.22  2006/12/04 08:59:47  ppiqueras
102
 * Algunos bugs corregidos. A cambio hay 2 bugs relacionados que todav?a no han sido corregidos (ver PHPCollab) (los tiene asignados Jorge).
103
 *
104
 * Revision 1.21  2006/11/28 08:05:13  jorpiell
105
 * Se escribe la query en la pesta?a del filtro
106
 *
107
 * Revision 1.20  2006/11/14 13:45:49  ppiqueras
108
 * A?adida peque?a funcionalidad:
109
 * 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.
110
 *
111
 * Revision 1.19  2006/10/27 12:10:02  ppiqueras
112
 * Nueva funcionalidad
113
 *
114
 * Revision 1.16  2006/10/23 07:37:04  jorpiell
115
 * Ya funciona el filterEncoding
116
 *
117
 * Revision 1.14  2006/10/13 13:05:32  ppiqueras
118
 * Permite el refrescado de datos del panel de filtrado sobre capa WFS.
119
 *
120
 * Revision 1.13  2006/10/10 12:55:06  jorpiell
121
 * Se ha a?adido el soporte de features complejas
122
 *
123
 * Revision 1.12  2006/10/02 09:17:48  jorpiell
124
 * A?adido el setCRS a la capa
125
 *
126
 * Revision 1.11  2006/09/29 13:02:38  ppiqueras
127
 * Filtro para WFS. De momento s?lo interfaz gr?fica.
128
 *
129
 * Revision 1.10  2006/07/21 11:50:31  jaume
130
 * improved appearance
131
 *
132
 * Revision 1.9  2006/06/21 12:35:45  jorpiell
133
 * 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
134
 *
135
 * Revision 1.8  2006/06/15 07:50:58  jorpiell
136
 * A?adida la funcionalidad de reproyectar y hechos algunos cambios en la interfaz
137
 *
138
 * Revision 1.7  2006/05/25 16:22:47  jorpiell
139
 * Se limpia el panel cada vez que se conecta con un servidor distinto
140
 *
141
 * Revision 1.6  2006/05/25 16:01:43  jorpiell
142
 * Se ha a?adido la funcionalidad para eliminar el namespace de los tipos de atributos
143
 *
144
 * Revision 1.5  2006/05/25 10:31:06  jorpiell
145
 * Como ha cambiado la forma de mostrar las capas (una tabla, en lugar de una lista), los paneles han tenido que ser modificados
146
 *
147
 * Revision 1.4  2006/05/23 08:09:39  jorpiell
148
 * 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
149
 *
150
 * Revision 1.3  2006/05/19 12:57:08  jorpiell
151
 * Modificados algunos paneles
152
 *
153
 * Revision 1.2  2006/04/20 16:38:24  jorpiell
154
 * 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().
155
 *
156
 * Revision 1.1  2006/04/19 12:50:16  jorpiell
157
 * Primer commit de la aplicaci?n. Se puede hacer un getCapabilities y ver el mensaje de vienvenida del servidor
158
 *
159
 *
160
 */
161
/**
162
 * A JPanel with a JTabbedPane with JPanels for WFS
163
 * 
164
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
165
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
166
 */
167
public class WFSParamsPanel extends WizardPanel{
168
        private JTabbedPane jTabbedPane = null;  //  @jve:decl-index=0:visual-constraint="37,30"
169
        private WFSSelectFeaturePanel featurePanel = null;
170
        private WFSSelectFieldsPanel fieldsPanel = null;
171
        private WFSOptionsPanel optionsPanel = null;
172
        private WFSFormatPanel formatPanel = null;
173
        private WFSFilterPanel filterPanel = null;
174
        private WFSAreaPanel areaPanel = null;
175
        private WFSWizardData data;
176
        private WizardListenerSupport listenerSupport;
177
        public        static Preferences fPrefs = Preferences.userRoot().node( "gvsig.wcs-wizard" );
178
        private WFSInfoPanel infoPanel;
179
        private int indFields;
180
        private int indFilter;
181
        private int indArea;        
182

    
183
        /**
184
         * This method initializes jTabbedPane
185
         *
186
         * @return javax.swing.JTabbedPane
187
         */
188

    
189
        public WFSParamsPanel(){
190
                super();
191
                initialize();
192
        }
193
        /**
194
         * Returns the tab amount that the WFSParamsPanel currently have
195
         *
196
         * Devuelve el n?mero de solapas que tiene actualmente el WFSParamsPanel
197
         *
198
         * @return int
199
         */
200
        public int getNumTabs(){
201
                 return getJTabbedPane().getTabCount();
202
        }
203

    
204
        private void initialize() {
205
                this.setLayout(null);
206
                this.setVisible(false);
207
                this.setBounds(0, 0, 510, 427);
208
                this.add(getJTabbedPane(), null);
209
        }
210

    
211
        /**
212
         * Sets the focus to the tab next to the current one.
213
         *
214
         * Enfoca a la solapa siguiente a la actualmente enfocada del TabbedPane
215
         *
216
         */
217
        public void avanzaTab(){
218
            int currentPage = currentPage();
219
            int nPages = getNumTabs();
220
                if (nPages -1 > currentPage){
221
                        getJTabbedPane().setSelectedIndex(nextPageEnabled());
222
                }
223
        }
224

    
225
        /**
226
         * Sets the focus to the tab previous to the current one.
227
         *
228
         * Enfoca a la solapa anterior a la actualmente enfocada del TabbedPane
229
         *
230
         */
231
        public void retrocedeTab(){
232
                this.getJTabbedPane().setSelectedIndex(previousEnabledPage());
233
        }
234

    
235
        /**
236
         * Returns the current tab index.
237
         *
238
         * Devuelve el n?mero de solapa en que se encuentra
239
         *
240
         * @return
241
         */
242
        public int getIndiceSolapaActual(){
243
                return this.getJTabbedPane().getSelectedIndex();
244
        }
245

    
246
        public JTabbedPane getJTabbedPane() {
247
                if (jTabbedPane == null) {
248
                        jTabbedPane = new JTabbedPane();
249
                        jTabbedPane.setBounds(4, 4, 502, 415);
250
                        jTabbedPane.addTab(PluginServices.getText(this, "info"), null, getInfoPanel());
251
                        jTabbedPane.addTab(PluginServices.getText(this, "feature"), null, getFeaturesPanel(), null);
252
                        jTabbedPane.addTab(PluginServices.getText(this, "fields"),null, getFieldsPanel(), null);
253
                        indFields = jTabbedPane.getTabCount() - 1;
254
                        jTabbedPane.setEnabledAt(indFields, false);
255
                        //jTabbedPane.addTab(PluginServices.getText(this,"formatos"),null,getFormatPanel(),null);
256
//                        indFormat = jTabbedPane.getTabCount() - 1;
257
//                        jTabbedPane.setEnabledAt(indFormat, false);
258
                        jTabbedPane.addTab(PluginServices.getText(this, "options"),null, getOptionsPanel(), null);
259
                        jTabbedPane.addTab(PluginServices.getText(this, "filter"),null, getFilterPanel(), null);
260
                        indFilter = jTabbedPane.getTabCount() - 1;
261
                        jTabbedPane.setEnabledAt(indFilter, false);
262
                        jTabbedPane.addTab(PluginServices.getText(this, "area"),null, getAreaPanel(), null);
263
                        indArea = jTabbedPane.getTabCount() - 1;
264
                        jTabbedPane.setEnabledAt(indArea, false);
265
                }
266
                return jTabbedPane;
267
        }
268

    
269
        private WFSInfoPanel getInfoPanel() {
270
                if (infoPanel==null) {
271
                        infoPanel = new WFSInfoPanel();
272
                        infoPanel.addFocusListener(new FocusListener() {
273
                                public void focusGained(java.awt.event.FocusEvent e) {
274
                                        refreshInfo();
275
                                }
276

    
277
                                private void refreshInfo() {
278
                                        WFSLayerNode selectedNode = featurePanel.getSelectedFeature();
279
                                        if (selectedNode != null){
280
                                                selectedNode.setSelectedFields(fieldsPanel.getSelectedFields());
281
                                        }
282
                                        data.setUserName(optionsPanel.getUserName());
283
                                        data.setBuffer(optionsPanel.getBuffer());
284
                                        data.setTimeOut(optionsPanel.getTimeout());
285
                                        infoPanel.refresh(data,selectedNode);
286
                                }
287

    
288
                                public void focusLost(FocusEvent e) {
289

    
290
                                }
291
                        });
292
                }
293
                return infoPanel;
294
        }
295

    
296
        /**
297
         *
298
         * @return the selected list
299
         */
300
        private Object getSelectedFeature() {
301
                return featurePanel.getSelectedFeature();
302
        }
303

    
304

    
305
        /**
306
         * This method initializes panelFeatures
307
         *
308
         * @return javax.swing.JPanel
309
         */
310
        private WFSSelectFeaturePanel getFeaturesPanel() {
311
                if (featurePanel == null) {
312
                        featurePanel = new WFSSelectFeaturePanel(this);
313
                        featurePanel.setLayout(null);
314
                }
315
                return featurePanel;
316
        }
317

    
318
        /**
319
         * This method initializes fieldsPanel
320
         *
321
         * @return javax.swing.JPanel
322
         */
323
        private WFSSelectFieldsPanel getFieldsPanel(){
324
                if (fieldsPanel == null) {
325
                        fieldsPanel = new WFSSelectFieldsPanel(this);
326
                        fieldsPanel.setLayout(null);
327
                }
328
                return fieldsPanel;
329
        }
330

    
331

    
332

    
333
        /**
334
         * This method initializes fieldsPanel
335
         *
336
         * @return javax.swing.JPanel
337
         */
338
        private WFSOptionsPanel getOptionsPanel(){
339
                if (optionsPanel == null) {
340
                        optionsPanel = new WFSOptionsPanel(this);
341
                        optionsPanel.setLayout(null);
342
                }
343
                return optionsPanel;
344
        }
345

    
346
        
347
        /**
348
         * This method initializes filterPanel
349
         * 
350
         * @return javax.swing.JPanel
351
         */
352
        private WFSFilterPanel getFilterPanel(){
353
                if (filterPanel == null) {
354
                        filterPanel = new WFSFilterPanel(this);
355
                        filterPanel.setVisible(true);
356
                        //filterPanel.setLayout(null);
357
                }
358
                return filterPanel;
359
        }
360
        
361
        /**
362
         * This method initializes areaPanel
363
         * 
364
         * @return javax.swing.JPanel
365
         */
366
        private WFSAreaPanel getAreaPanel(){
367
                if (areaPanel == null) {
368
                        areaPanel = new WFSAreaPanel(this);
369
                        areaPanel.setVisible(true);                        
370
                }
371
                return areaPanel;
372
        }
373

    
374
        /**
375
         * This method initializes formatPanel
376
         *
377
         * @return javax.swing.JPanel
378
         */
379
        private WFSFormatPanel getFormatPanel(){
380
                if (formatPanel == null) {
381
                        formatPanel = new WFSFormatPanel();
382
                        formatPanel.setLayout(null);
383
                }
384
                return formatPanel;
385
        }
386

    
387
        /**
388
         * Verifies that the selected parameters are enough to request the coverage
389
         * to the server.
390
         *
391
         * Comprueba que los par?metros seleccionados son suficientes para pedir la
392
         * cobertura al servidor.
393
         *
394
         * @return boolean
395
         */
396
        public boolean isCorretlyConfigured() {
397
                if (featurePanel.getSelectedFeature()!= null){
398
                        return true;
399
                }else{
400
                        return false;
401
                }
402
        }
403

    
404
        /**
405
         * Cleans up the wizard's components but the server's layers list.
406
         *
407
         * Limpia todos los componentes del wizard excepto la lista de capas del
408
         * servidor.
409
         */
410
        public void cleanupWizard() {
411
                jTabbedPane.setEnabledAt(indFields,false);
412
//                jTabbedPane.setEnabledAt(indFormat,false);
413
        }
414

    
415
        /**
416
         * Refreshes the wizard components data each time a feature
417
         * is selected.
418
         *
419
         * Actualiza los datos de los componentes del wizard cada vez
420
         * que se selecciona una feature diferente.
421
         *
422
         * @param feature
423
         * Selected feature
424
         */
425
        public void refreshData(WFSLayerNode feature){
426
                if (feature != null){
427
                        feature = (WFSLayerNode)data.getFeatureInfo(feature.getName());
428
                        jTabbedPane.setEnabledAt(indFields,true);
429
                        jTabbedPane.setEnabledAt(indFilter,true);
430
                        jTabbedPane.setEnabledAt(indArea,true);
431
                        fieldsPanel.refresh(feature);
432
                        optionsPanel.refresh(feature);
433
                        filterPanel.refresh(feature);
434
                }
435
                listenerSupport.callStateChanged(isCorretlyConfigured());
436

    
437
        }
438

    
439
        public void refreshInfo(WFSLayerNode feature){
440
                infoPanel.refresh(data,feature);
441
        }
442

    
443
        /**
444
         * Sets the object that holds the wizard data.
445
         *
446
         * Establece el objeto que contiene los datos del wizard.
447
         *
448
         * @param data
449
         */
450
        public void setWizardData(WFSWizardData data) {
451
                this.data = data;
452
                //WFSLayerNode selectedNode = (WFSLayerNode)featurePanel.getSelectedFeature();
453
                featurePanel.setWizardData(data);
454
                data.setBuffer(optionsPanel.getBuffer());
455
                data.setTimeOut(optionsPanel.getTimeout());
456
                infoPanel.refresh(data,null);
457
        }
458

    
459
        /**
460
         * Sets the wizard's data source
461
         *
462
         * Establece el origen de los datos del wizard
463
         * @param dataSource
464
         */
465
        public void setDataSource(WFSWizardData dataSource) {
466
                this.data = dataSource;
467

    
468
        }
469

    
470

    
471
    /**
472
     * Returns the next enabled tab's index.
473
     *
474
     * Devuelve el ?ndicie de la siguiente pesta?a habilitada del wizard o -1 si no hay
475
     * ninguna.
476
     *
477
     * @return The index or -1 if there is no one.
478
     */
479
    public int nextPageEnabled() {
480
        int currentPage = currentPage();
481
        int nPages = getNumTabs();
482
        if (currentPage == nPages)
483
                return -1;
484
        for (int i=currentPage+1; i<nPages; i++){
485
            if (getJTabbedPane().isEnabledAt(i)){
486
                return i;
487
            }
488
        }
489
        return -1;
490
    }
491

    
492
    /**
493
     * Returns the index of the current tab.
494
     *
495
     * Devuelve el ?ndice de la p?gina actual del wizard.
496
     *
497
     * @return
498
     */
499
    public int currentPage() {
500
        return getJTabbedPane().getSelectedIndex();
501
    }
502

    
503
    /**
504
     * Returns the index of the previous enabled tab.
505
     *
506
     * Devuelve el ?ndice de la anterior p?gina habilitada del wizard o -1 si no hay
507
     * ninguna.
508
     *
509
     * @return The index, or -1 if there is no one.
510
     */
511
    public int previousEnabledPage() {
512
        int currentPage = currentPage();
513
        int j=0;
514
        if (currentPage == 0)
515
            j= -1;
516
        for (int i = currentPage-1; i>-1; i--){
517
            if (getJTabbedPane().isEnabledAt(i)){
518
                j= i;
519
                    break;
520
            }
521
        }
522
        return j;
523
    }
524

    
525
        public FMapWFSDriver getDriver() {
526
                return data.getDriver();
527
        }
528

    
529
        public void setListenerSupport(WizardListenerSupport support) {
530
                listenerSupport = support;
531
        }
532

    
533

    
534
        /*
535
         *  (non-Javadoc)
536
         * @see com.iver.cit.gvsig.gui.WizardPanel#initWizard()
537
         */
538
        public void initWizard() {
539

    
540
        }
541

    
542
        /*
543
         *  (non-Javadoc)
544
         * @see com.iver.cit.gvsig.gui.WizardPanel#execute()
545
         */
546
        public void execute() {
547

    
548
        }
549

    
550
        /*
551
         *  (non-Javadoc)
552
         * @see com.iver.cit.gvsig.gui.ILayerPanel#getLayer()
553
         */
554
        public FLayer getLayer() {
555
                FLyrWFS layer = new FLyrWFS();
556
                layer.setName(getFeaturesPanel().getLayerText());
557
                layer.setLayerName(getFeaturesPanel().getLayerName());
558
                layer.setWfsLayerNode(getLayerNode());
559
                layer.setFields(getFieldsPanel().getSelectedFields());
560
                layer.setUserName(getOptionsPanel().getUserName());
561
                layer.setPassword(getOptionsPanel().getPassword());
562
                layer.setNumfeatures(getOptionsPanel().getBuffer());
563
                layer.setTimeout(getOptionsPanel().getTimeout());
564
                layer.setSrs(getOptionsPanel().getSRS());
565
                
566
                // Set the filter subconsultation that layer is
567
                layer.setFieldsQuery(getLayerNode().getFilter());
568
                
569
                layer.setVisualFilterQueyr(getFilterPanel().getFilterExpressionFromInterface());
570
                layer.setWfsDriver(data.getDriver());
571
                return layer;
572
        }
573

    
574
        private WFSLayerNode getLayerNode(){
575
                WFSLayerNode layerNode = getFeaturesPanel().getWFSLayerNode();
576
                layerNode.setSelectedFields(getFieldsPanel().getSelectedFields());
577
                
578
                // If the query is incorrect -> no query (no filter)
579
                String query = getFilterPanel().getQuery();
580
                if (query == null) {
581
                        layerNode.setFilter("");
582
                        
583
                        // Removes filter expression from the JTextArea
584
                        getFilterPanel().removeFilterExpression();
585
                        
586
                        // Notify to user that no filter will be applied
587
                        JOptionPane.showMessageDialog(null, PluginServices.getText(null, "no_filter_will_be_applied_in_the_load_of_the_layer"), PluginServices.getText(null, "warning"), JOptionPane.WARNING_MESSAGE);
588
                }
589
                else
590
                        layerNode.setFilter(query);
591
                
592
                return layerNode;
593
        }
594

    
595

    
596
        public void setSelectedFeature(WFSLayerNode layerNode){
597
                getFeaturesPanel().setSelectedFeature(layerNode);
598
                getFieldsPanel().setSelectedFields(layerNode);
599
//                getFilterPanel().setFilterExpressionIntoInterface(layerNode.getFilter());
600
        }        
601
        
602
        
603
        /**
604
         * @return Returns the data.
605
         */
606
        public WFSWizardData getData() {
607
                return data;
608
        }
609
        public void setLayerName(String name) {
610
                getFeaturesPanel().setLayerName(name);
611

    
612
        }
613

    
614
        public void addWizardListener(WizardListener listener) {
615
                listenerSupport.addWizardListener(listener);
616
        }
617

    
618
        public void isApplicable(boolean applicable){
619
                listenerSupport.callStateChanged(applicable);
620
        }
621

    
622

    
623
        public void setStatus(WFSStatus status) {
624
                getOptionsPanel().setStatus(status);
625
                getFilterPanel().setFilterExpressionIntoInterface(status.getFilterVisualText());
626
        }
627

    
628
        /**
629
         * 
630
         *
631
         */
632
        public void updateWFSFilterFieldValues()  {
633
                filterPanel.updateFieldValues();
634
        }
635
        
636
        /**
637
         * @see WFSFilterPanel#setWFSFilterPanelIsAsTabForWFSLayersLoad(boolean)
638
         */
639
        public void setWFSFilterPanelIsAsTabForWFSLayersLoad(boolean b) {
640
                this.getFilterPanel().setWFSFilterPanelIsAsTabForWFSLayersLoad(b);
641
        }
642
        
643
        /**
644
         * @see WFSFilterPanel#getWFSFilterPanelIsAsTabForWFSLayersLoad()
645
         */
646
        public boolean getWFSFilterPanelIsAsTabForWFSLayersLoad() {
647
                return this.getFilterPanel().getWFSFilterPanelIsAsTabForWFSLayersLoad();
648
        }
649
        
650
        /**
651
         * @see WFSSelectFieldsPanel#getFieldsSelectedOfSameLayerHasChanged()
652
         */
653
        public boolean getFieldsSelectedOfSameLayerHasChanged() {
654
                return this.getFieldsPanel().getFieldsSelectedOfSameLayerHasChanged();
655
        }
656
        
657
        /**
658
         * @see WFSSelectFieldsPanel#resetFieldsSelectedOfSameLayerHasChanged()
659
         */
660
        public void resetFieldsSelectedOfSameLayerHasChanged() {
661
                this.getFieldsPanel().resetFieldsSelectedOfSameLayerHasChanged();
662
        }
663

    
664
        /**
665
         * @see WFSWizard#doClickOnNextButton()
666
         */
667
        public void doClickOnNextButton() {
668
                Object obj = this.getParent();
669
                
670
                // When we start to connect to a server -> the interface is the dialog WFSWizard
671
                if (obj instanceof WFSWizard)
672
                        ((WFSWizard)this.getParent()).doClickOnNextButton();
673
                else {
674
                        // When we are modifying a loaded layer -> the interface is the dialog WFSPropsDialog
675
                        if (obj instanceof WFSPropsDialog)
676
                                this.advanceCurrentTab();
677
                }
678
        }
679
        
680
        /**
681
         * Selects the next tab
682
         */
683
        public void advanceCurrentTab() {
684
                int currentTabIndex = this.getJTabbedPane().getSelectedIndex();
685
                
686
                // Ensure we can select next tab
687
                if ((currentTabIndex != -1) && (currentTabIndex < (this.getJTabbedPane().getTabCount() -1)))
688
                        this.getJTabbedPane().setSelectedIndex(currentTabIndex + 1);
689
        }
690

    
691
        /**
692
         * @see WFSFilterPanel#getAllFieldsAndValuesKnownOfCurrentLayer(Map)
693
         */
694
        public Map getAllFieldsAndValuesKnownOfCurrentLayer() {
695
                return this.getFilterPanel().getAllFieldsAndValuesKnownOfCurrentLayer();
696
        }
697
        
698
        /**
699
         * @see WFSFilterPanel#setAllFieldsAndValuesKnownOfCurrentLayer(Map)
700
         */
701
        public void setAllFieldsAndValuesKnownOfCurrentLayer(Map allFieldsAndValuesKnownOfCurrentLayer) {
702
                this.getFilterPanel().setAllFieldsAndValuesKnownOfCurrentLayer(allFieldsAndValuesKnownOfCurrentLayer);
703
        }
704
        
705
        /**
706
         * @see WFSFilterPanel#getQuery()
707
         */
708
        public String getFilterQuery() {
709
                return this.getFilterPanel().getQuery();
710
        }
711
}