Statistics
| Revision:

root / tags / v1_1_Build_1010 / applications / appCatalogYNomenclatorClient / src / es / gva / cit / gazetteer / ui / search / SearchLowerPanel.java @ 12804

History | View | Annotate | Download (26.8 KB)

1

    
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
package es.gva.cit.gazetteer.ui.search;
43
import es.gva.cit.catalogClient.querys.Coordinates;
44
import es.gva.cit.catalogClient.utils.Doubles;
45
import es.gva.cit.gazetteer.querys.ThesaurusName;
46
import es.gva.cit.gazetteer.utils.ThesaurusJTree.ThesaurusJTree;
47
import java.awt.Color;
48
import java.awt.FlowLayout;
49
import java.awt.GridLayout;
50
import java.util.Vector;
51
import javax.swing.BoxLayout;
52
import javax.swing.ButtonGroup;
53
import javax.swing.JCheckBox;
54
import javax.swing.JComboBox;
55
import javax.swing.JLabel;
56
import javax.swing.JPanel;
57
import javax.swing.JRadioButton;
58
import javax.swing.JScrollPane;
59
import javax.swing.JTextField;
60
import javax.swing.tree.DefaultMutableTreeNode;
61

    
62
import org.gvsig.i18n.Messages;
63

    
64
/**
65
 * 
66
 * 
67
 * 
68
 * @author Jorge Piera Llodra (piera_jor@gva.es)
69
 */
70
public class SearchLowerPanel extends JPanel {
71

    
72
/**
73
 * 
74
 * 
75
 */
76
    private String[] resultadosPorPagina = {"10","25","50"};
77

    
78
/**
79
 * 
80
 * 
81
 */
82
    private Vector features = null;
83
/**
84
 * 
85
 * 
86
 */
87
    private JPanel panelRadioButtons = null;
88
/**
89
 * 
90
 * 
91
 */
92
    private JRadioButton exactButton = null;
93
/**
94
 * 
95
 * 
96
 */
97
    private JRadioButton anyButton = null;
98
/**
99
 * 
100
 * 
101
 */
102
    private JRadioButton allButton = null;
103
/**
104
 * 
105
 * 
106
 */
107
    private JPanel panelLabNResultados = null;
108
/**
109
 * 
110
 * 
111
 */
112
    private JLabel nResultadosLabel = null;
113
/**
114
 * 
115
 * 
116
 */
117
    private JComboBox nResultsCombo = null;
118
/**
119
 * 
120
 * 
121
 */
122
    private JPanel panelAjusteBotones = null;
123
/**
124
 * 
125
 * 
126
 */
127
    private JPanel panelRigth = null;
128
/**
129
 * 
130
 * 
131
 */
132
    private JPanel panelLeft = null;
133
/**
134
 * 
135
 * 
136
 */
137
    private JPanel panelSuperiores = null;
138
/**
139
 * 
140
 * 
141
 */
142
    private JPanel panelInferiores = null;
143
/**
144
 * 
145
 * 
146
 */
147
    private JLabel ULXLabel = null;
148
/**
149
 * 
150
 * 
151
 */
152
    private JTextField ULXText = null;
153
/**
154
 * 
155
 * 
156
 */
157
    private JLabel ULYLabel = null;
158
/**
159
 * 
160
 * 
161
 */
162
    private JTextField ULYText = null;
163
/**
164
 * 
165
 * 
166
 */
167
    private JLabel BRXLabel = null;
168
/**
169
 * 
170
 * 
171
 */
172
    private JTextField BRXText = null;
173
/**
174
 * 
175
 * 
176
 */
177
    private JLabel BRYLabel = null;
178
/**
179
 * 
180
 * 
181
 */
182
    private JTextField BRYText = null;
183
/**
184
 * 
185
 * 
186
 */
187
    private JPanel jPanel = null;
188
/**
189
 * 
190
 * 
191
 */
192
    private JPanel panelShowOptions = null;
193
/**
194
 * 
195
 * 
196
 */
197
    private JPanel panelNResultadosCombo = null;
198
/**
199
 * 
200
 * 
201
 */
202
    private JPanel panelLabTipo = null;
203
/**
204
 * 
205
 * 
206
 */
207
    private JPanel panelListTipo = null;
208
/**
209
 * 
210
 * 
211
 */
212
    private JLabel tipoLabel = null;
213
/**
214
 * 
215
 * 
216
 */
217
    private ThesaurusJTree thesaurusTree = null;
218
/**
219
 * 
220
 * 
221
 */
222
    private JComboBox coordenadasCombo = null;
223
/**
224
 * 
225
 * 
226
 */
227
    private JPanel panelCoordinates = null;
228
/**
229
 * 
230
 * 
231
 */
232
    private JPanel componentesPanel = null;
233
/**
234
 * 
235
 * 
236
 */
237
    private JScrollPane jScrollThesaurus = null;
238

    
239
/**
240
 * 
241
 * 
242
 */
243
    private String serverType = null;
244
/**
245
 * 
246
 * 
247
 */
248
    private JCheckBox checkBGoTo = null;
249
/**
250
 * 
251
 * 
252
 */
253
    private JCheckBox checkBKeepOld = null;
254
/**
255
 * 
256
 * 
257
 */
258
    private JPanel panelShowOptionsPosition = null;
259

    
260
private JCheckBox checkBMark = null;
261

    
262
private JPanel panelAdvancedSearch = null;
263

    
264
private JPanel panelAdvancedSearchPosition = null;
265

    
266
private JCheckBox checkBWithAccents = null;
267

    
268
/**
269
 * 
270
 * 
271
 * 
272
 * @param features Features list
273
 * @param translator Class to translate the interface
274
 * @param serverType Server type used to enable/disable some interface components
275
 */
276
    public  SearchLowerPanel(Vector features, String serverType) {        
277
        super();
278
        this.features = features;
279
        this.serverType = serverType;
280
        initialize();
281
        disableComponents(serverType);
282
        getCheckBGoTo().setSelected(true);
283
        getCheckBKeepOld().setSelected(true);
284
        getCheckBMark().setSelected(true);
285
        getCheckBWithAccents().setSelected(true);
286
    } 
287

    
288
/**
289
 * This method initializes this
290
 * 
291
 */
292
    private void initialize() {        
293
        this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
294
        this.setPreferredSize(new java.awt.Dimension(565,405));
295
        this.setLocation(0, 0);
296
        this.setSize(565, 405);
297
        this.add(getComponentesPanel(), null);
298
    } 
299

    
300
/**
301
 * This method initializes jPanel
302
 * 
303
 * 
304
 * @return javax.swing.JPanel
305
 */
306
    private JPanel getPanelRadioButtons() {        
307
        if (panelRadioButtons == null) {
308
            panelRadioButtons = new JPanel();
309
            panelRadioButtons.setLayout(new BoxLayout(panelRadioButtons, BoxLayout.Y_AXIS));
310
            panelRadioButtons.setBorder(javax.swing.BorderFactory.createTitledBorder(
311
                    null, Messages.getText("concordancia"),
312
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
313
                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
314
            panelRadioButtons.add(getExactButton(), null);
315
            panelRadioButtons.add(getAnyButton(), null);
316
            panelRadioButtons.add(getAllButton(), null);
317
            ButtonGroup group = new ButtonGroup();
318
            group.add(getExactButton());
319
            group.add(getAnyButton());
320
            group.add(getAllButton());
321
        }
322
        return panelRadioButtons;
323
    } 
324

    
325
/**
326
 * This method initializes jRadioButton
327
 * 
328
 * 
329
 * @return javax.swing.JRadioButton
330
 */
331
    private JRadioButton getExactButton() {        
332
        if (exactButton == null) {
333
            exactButton = new JRadioButton();
334
            exactButton.setText( Messages.getText("exactSentence"));
335
            exactButton.setSelected(true);
336
        }
337
        return exactButton;
338
    } 
339

    
340
/**
341
 * This method initializes jRadioButton1
342
 * 
343
 * 
344
 * @return javax.swing.JRadioButton
345
 */
346
    private JRadioButton getAnyButton() {        
347
        if (anyButton == null) {
348
            anyButton = new JRadioButton();
349
            anyButton.setText( Messages.getText("anyWord"));
350
        }
351
        return anyButton;
352
    } 
353

    
354
/**
355
 * This method initializes jRadioButton2
356
 * 
357
 * 
358
 * @return javax.swing.JRadioButton
359
 */
360
    private JRadioButton getAllButton() {        
361
        if (allButton == null) {
362
            allButton = new JRadioButton();
363
            allButton.setText( Messages.getText("allWords"));
364
        }
365
        return allButton;
366
    } 
367

    
368
/**
369
 * This method initializes jPanel
370
 * 
371
 * 
372
 * @return javax.swing.JPanel
373
 */
374
    private JPanel getPanelLabNResultados() {        
375
        if (panelLabNResultados == null) {
376
            nResultadosLabel = new JLabel();
377
            panelLabNResultados = new JPanel();
378
            GridLayout gridLayout2 = new GridLayout();
379
            panelLabNResultados.setLayout(gridLayout2);
380
            nResultadosLabel.setText( Messages.getText("resutsByPage"));
381
            panelLabNResultados.add(nResultadosLabel, null);
382
        }
383
        return panelLabNResultados;
384
    } 
385

    
386
/**
387
 * This method initializes jComboBox
388
 * 
389
 * 
390
 * @return javax.swing.JComboBox
391
 */
392
    private JComboBox getNResultsCombo() {        
393
        if (nResultsCombo == null) {
394
            nResultsCombo = new JComboBox(resultadosPorPagina);
395
            nResultsCombo.setPreferredSize(new java.awt.Dimension(250,20));
396
            nResultsCombo.setBackground(Color.white);
397
            
398
        }
399
        return nResultsCombo;
400
    } 
401

    
402
/**
403
 * This method initializes jPanel
404
 * 
405
 * 
406
 * @return javax.swing.JPanel
407
 */
408
    private JPanel getPanelAjusteBotones() {        
409
        if (panelAjusteBotones == null) {
410
            GridLayout gridLayout6 = new GridLayout();
411
            panelAjusteBotones = new JPanel();
412
            panelAjusteBotones.setLayout(gridLayout6);
413
            gridLayout6.setRows(1);
414
            panelAjusteBotones.add(getPanelRadioButtons(), null);
415
        }
416
        return panelAjusteBotones;
417
    } 
418

    
419
/**
420
 * This method initializes jPanel3
421
 * 
422
 * 
423
 * @return javax.swing.JPanel
424
 */
425
    private JPanel getJPanel3() {        
426
        if (panelRigth == null) {
427
            panelRigth = new JPanel();
428
            panelRigth.setLayout(new BoxLayout(
429
                    panelRigth, BoxLayout.Y_AXIS));
430
            panelRigth.setPreferredSize(new java.awt.Dimension(250,400));
431
            panelRigth.add(getPanelCoordinates(), null);
432
            panelRigth.add(getPanelShowOptions(), null);
433
            panelRigth.add(getPanelAdvancedSearch(), null);
434
        }
435
        return panelRigth;
436
    } 
437

    
438
/**
439
 * This method initializes jPanel3
440
 * 
441
 * 
442
 * @return javax.swing.JPanel
443
 */
444
    private JPanel getJPanel33() {        
445
        if (panelLeft == null) {
446
            panelLeft = new JPanel();
447
            panelLeft.setLayout(new BoxLayout(
448
                    panelLeft, BoxLayout.Y_AXIS));
449
            panelLeft.setPreferredSize(new java.awt.Dimension(250,395));
450
            panelLeft.add(getPanelAjusteBotones(), null);
451
            panelLeft.add(getPanelLabTipo(), null);
452
            panelLeft.add(getPanelListTipo(), null);
453
            panelLeft.add(getPanelLabNResultados(), null);
454
            panelLeft.add(getPanelNResultadosCombo(), null);
455
        }
456
        return panelLeft;
457
    } 
458

    
459
/**
460
 * This method initializes jPanel4
461
 * 
462
 * 
463
 * @return javax.swing.JPanel
464
 */
465
    private JPanel getPanelSuperiores() {        
466
        if (panelSuperiores == null) {
467
            ULXLabel = new JLabel();
468
            ULYLabel = new JLabel();
469
            panelSuperiores = new JPanel();
470
            panelSuperiores.setBorder(javax.swing.BorderFactory.createTitledBorder(
471
                    null,  Messages.getText("upperCoordinates"),
472
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
473
                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
474
            panelSuperiores.setPreferredSize(new java.awt.Dimension(213,30));
475
            ULXLabel.setText("ULX:");
476
            ULYLabel.setText("ULY:");
477
            panelSuperiores.add(ULXLabel, null);
478
            panelSuperiores.add(getULXText(), null);
479
            panelSuperiores.add(ULYLabel, null);
480
            panelSuperiores.add(getULYText(), null);
481
        }
482
        return panelSuperiores;
483
    } 
484

    
485
/**
486
 * This method initializes jPanel4
487
 * 
488
 * 
489
 * @return javax.swing.JPanel
490
 */
491
    private JPanel getPanelInferiores() {        
492
        if (panelInferiores == null) {
493
            BRXLabel = new JLabel();
494
            BRYLabel = new JLabel();
495
            panelInferiores = new JPanel();
496
            panelInferiores.setBorder(javax.swing.BorderFactory.createTitledBorder(
497
                    null,  Messages.getText("lowerCoordinates"),
498
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
499
                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
500
            panelInferiores.setPreferredSize(new java.awt.Dimension(213,30));
501
            BRXLabel.setText("BRX:");
502
            BRYLabel.setText("BRY:");
503
            panelInferiores.add(BRXLabel, null);
504
            panelInferiores.add(getBRXText(), null);
505
            panelInferiores.add(BRYLabel, null);
506
            panelInferiores.add(getBRYText(), null);
507
        }
508
        return panelInferiores;
509
    } 
510

    
511
/**
512
 * This method initializes jTextField
513
 * 
514
 * 
515
 * @return javax.swing.JTextField
516
 */
517
    private JTextField getULXText() {        
518
        if (ULXText == null) {
519
            ULXText = new JTextField();
520
            ULXText.setPreferredSize(new java.awt.Dimension(65,20));
521
        }
522
        return ULXText;
523
    } 
524

    
525
/**
526
 * This method initializes jTextField
527
 * 
528
 * 
529
 * @return javax.swing.JTextField
530
 */
531
    private JTextField getULYText() {        
532
        if (ULYText == null) {
533
            ULYText = new JTextField();
534
            ULYText.setPreferredSize(new java.awt.Dimension(65,20));
535
        }
536
        return ULYText;
537
    } 
538

    
539
/**
540
 * This method initializes jTextField
541
 * 
542
 * 
543
 * @return javax.swing.JTextField
544
 */
545
    private JTextField getBRXText() {        
546
        if (BRXText == null) {
547
            BRXText = new JTextField();
548
            BRXText.setPreferredSize(new java.awt.Dimension(65,20));
549
        }
550
        return BRXText;
551
    } 
552

    
553
/**
554
 * This method initializes jTextField
555
 * 
556
 * 
557
 * @return javax.swing.JTextField
558
 */
559
    private JTextField getBRYText() {        
560
        if (BRYText == null) {
561
            BRYText = new JTextField();
562
            BRYText.setPreferredSize(new java.awt.Dimension(65,20));
563
        }
564
        return BRYText;
565
    } 
566

    
567
/**
568
 * This method initializes jPanel
569
 * 
570
 * 
571
 * @return javax.swing.JPanel
572
 */
573
    private JPanel getJPanel() {        
574
        if (jPanel == null) {
575
            jPanel = new JPanel();
576
            jPanel.setPreferredSize(new java.awt.Dimension(10,5));
577
            jPanel.add(getCoordenadasCombo(), null);
578
        }
579
        return jPanel;
580
    } 
581

    
582
/**
583
 * This method initializes jPanel8
584
 * 
585
 * 
586
 * @return javax.swing.JPanel
587
 */
588
    private JPanel getPanelShowOptions() {        
589
        if (panelShowOptions == null) {
590
            FlowLayout flowLayout4 = new FlowLayout();
591
            panelShowOptions = new JPanel();
592
            panelShowOptions.setLayout(flowLayout4);
593
            panelShowOptions.setPreferredSize(new java.awt.Dimension(10,100));
594
            panelShowOptions.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("aspect"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
595
            flowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
596
            panelShowOptions.add(getPanelShowOptionsPosition(), null);
597
        }
598
        return panelShowOptions;
599
    } 
600

    
601
/**
602
 * This method initializes jPanel9
603
 * 
604
 * 
605
 * @return javax.swing.JPanel
606
 */
607
    private JPanel getPanelNResultadosCombo() {        
608
        if (panelNResultadosCombo == null) {
609
            panelNResultadosCombo = new JPanel();
610
            panelNResultadosCombo.add(getNResultsCombo(), null);
611
        }
612
        return panelNResultadosCombo;
613
    } 
614

    
615
/**
616
 * This method initializes jPanel7
617
 * 
618
 * 
619
 * @return javax.swing.JPanel
620
 */
621
    private JPanel getPanelLabTipo() {        
622
        if (panelLabTipo == null) {
623
            tipoLabel = new JLabel();
624
            GridLayout gridLayout1 = new GridLayout();
625
            panelLabTipo = new JPanel();
626
            panelLabTipo.setLayout(gridLayout1);
627
            gridLayout1.setRows(1);
628
            tipoLabel.setText(Messages.getText("type"));
629
            panelLabTipo.add(tipoLabel, null);
630
        }
631
        return panelLabTipo;
632
    } 
633

    
634
/**
635
 * This method initializes jPanel7
636
 * 
637
 * 
638
 * @return javax.swing.JPanel
639
 */
640
    private JPanel getPanelListTipo() {        
641
        if (panelListTipo == null) {
642
            panelListTipo = new JPanel();
643
            panelListTipo.setPreferredSize(new java.awt.Dimension(310,115));
644
            panelListTipo.add(getJScrollThesaurus(), null);
645
        }
646
        return panelListTipo;
647
    } 
648

    
649
/**
650
 * This method initializes jTextField
651
 * 
652
 * 
653
 * @return javax.swing.JTextField
654
 */
655
    public ThesaurusJTree getThesaurusList() {        
656
        if (thesaurusTree == null) {
657
            int numFeatures;
658
            if (features == null){
659
                numFeatures = 0;
660
            }else{
661
                numFeatures = features.size();
662
            }
663
            
664
            ThesaurusName[] f = new ThesaurusName[numFeatures];
665
            for (int i=0 ; i<numFeatures ; i++){
666
                f[i] = (ThesaurusName)features.get(i);
667
            }
668
            thesaurusTree = new ThesaurusJTree(features,
669
                    Messages.getText("rootName"));
670
        }
671
        return thesaurusTree;
672
    } 
673

    
674
/**
675
 * 
676
 * 
677
 * 
678
 * @return 
679
 */
680
    public String getConcordancia() {        
681
        if (getExactButton().isSelected()) {
682
            return "E";
683
        }
684
        if (getAnyButton().isSelected()) {
685
            return "Y";
686
        }
687
        if (getAllButton().isSelected()) {
688
            return "A";
689
        }
690
        return null;
691
    } 
692

    
693
/**
694
 * Ir returns the current selected thesaurus type
695
 * 
696
 * 
697
 * @return 
698
 */
699
    public ThesaurusName getType() {        
700
        DefaultMutableTreeNode dmt = (DefaultMutableTreeNode)thesaurusTree.getLastSelectedPathComponent();
701
        if (dmt == null)
702
            return null;
703
        return (ThesaurusName) dmt.getUserObject();
704
    } 
705

    
706
/**
707
 * Ir returns all the thesaurus in the combo
708
 * 
709
 * 
710
 * @return ThesaurusName[]
711
 */
712
    public ThesaurusName[] getAllTypes() {        
713
        DefaultMutableTreeNode root = (DefaultMutableTreeNode)thesaurusTree.getModel().getRoot();
714
        ThesaurusName[] thesaurus = new ThesaurusName[root.getChildCount()];        
715
        
716
        for (int i=0 ; i<root.getChildCount() ; i++){
717
            DefaultMutableTreeNode child = (DefaultMutableTreeNode) root.getChildAt(i);
718
            thesaurus[i] = (ThesaurusName) child.getUserObject();
719
        }
720
        
721
        return thesaurus;
722
    } 
723

    
724
/**
725
 * 
726
 * 
727
 * 
728
 * @return 
729
 */
730
    public int getNPaginas() {        
731
        String s = (String) getNResultsCombo().getSelectedItem();
732
        return Integer.valueOf(s).intValue();
733
    } 
734

    
735
/**
736
 * 
737
 * 
738
 * 
739
 * @return 
740
 */
741
    public Coordinates getCoordenadas() {        
742
        return new Coordinates(getULXText().getText(), getULYText().getText(),
743
            getBRXText().getText(), getBRYText().getText());
744
    } 
745

    
746
/**
747
 * 
748
 * 
749
 * 
750
 * @return 
751
 */
752
    public String getCoordenadasOpcion() {        
753
        return (String) getCoordenadasCombo().getSelectedItem();
754
    } 
755

    
756
/**
757
 * It sets the coordinates fields
758
 * 
759
 * 
760
 * @param coordinates 
761
 */
762
    public void setCoordinates(Coordinates coordinates) {        
763
        setULXText(Doubles.get5Decimals(coordinates.ulx));
764
        setULYText(Doubles.get5Decimals(coordinates.uly));
765
        setBRXText(Doubles.get5Decimals(coordinates.brx));
766
        setBRYText(Doubles.get5Decimals(coordinates.bry));
767
    } 
768

    
769
/**
770
 * This method initializes jComboBox
771
 * 
772
 * 
773
 * @return javax.swing.JComboBox
774
 */
775
    private JComboBox getCoordenadasCombo() {        
776
        if (coordenadasCombo == null) {
777
            String[] coordinates;
778
            
779
            coordinates = new String[2];
780
            coordinates[0] = Messages.getText("coordinatesContains");
781
            coordinates[1] = Messages.getText("coordinatesFullyOutsideOf");
782
           
783
            coordenadasCombo = new JComboBox(coordinates);
784
            coordenadasCombo.setPreferredSize(new java.awt.Dimension(240,20));
785
            coordenadasCombo.setBackground(Color.white);
786
        }
787
        return coordenadasCombo;
788
    } 
789

    
790
/**
791
 * This method initializes jPanel4
792
 * 
793
 * 
794
 * @return javax.swing.JPanel
795
 */
796
    private JPanel getPanelCoordinates() {        
797
        if (panelCoordinates == null) {
798
            panelCoordinates = new JPanel();
799
            panelCoordinates.setLayout(new BoxLayout(panelCoordinates, BoxLayout.Y_AXIS));
800
            panelCoordinates.setBorder(javax.swing.BorderFactory.createTitledBorder(
801
                    null, Messages.getText("coordinates"),
802
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
803
                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
804
            panelCoordinates.setPreferredSize(new java.awt.Dimension(315,135));
805
            panelCoordinates.add(getPanelSuperiores(), null);
806
            panelCoordinates.add(getPanelInferiores(), null);
807
            panelCoordinates.add(getJPanel(), null);
808
        }
809
        return panelCoordinates;
810
    } 
811

    
812
/**
813
 * This method initializes jPanel5
814
 * 
815
 * 
816
 * @return javax.swing.JPanel
817
 */
818
    private JPanel getComponentesPanel() {        
819
        if (componentesPanel == null) {
820
            componentesPanel = new JPanel();
821
            componentesPanel.setPreferredSize(new java.awt.Dimension(565,400));
822
            componentesPanel.add(getJPanel33(), null);
823
            componentesPanel.add(getJPanel3(), null);
824
        }
825
        return componentesPanel;
826
    } 
827

    
828
/**
829
 * This method initializes jScrollPane1
830
 * 
831
 * 
832
 * @return javax.swing.JScrollPane
833
 */
834
    public JScrollPane getJScrollThesaurus() {        
835
                if (jScrollThesaurus == null) {
836
                    jScrollThesaurus = new JScrollPane(getThesaurusList());
837
                    jScrollThesaurus.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
838
                    jScrollThesaurus.setPreferredSize(new java.awt.Dimension(250,120));
839
                }
840
                return jScrollThesaurus;
841
    } 
842

    
843
/**
844
 * 
845
 * 
846
 * 
847
 * @param text The bRXText to set.
848
 */
849
    public void setBRXText(String text) {        
850
        BRXText.setText(text);
851
    } 
852

    
853
/**
854
 * 
855
 * 
856
 * 
857
 * @param text The bRYText to set.
858
 */
859
    public void setBRYText(String text) {        
860
        BRYText.setText(text);
861
    } 
862

    
863
/**
864
 * 
865
 * 
866
 * 
867
 * @param text The uLXText to set.
868
 */
869
    public void setULXText(String text) {        
870
        ULXText.setText(text);
871
    } 
872

    
873
/**
874
 * 
875
 * 
876
 * 
877
 * @param text The uLYText to set.
878
 */
879
    public void setULYText(String text) {        
880
        ULYText.setText(text);
881
    } 
882

    
883
/**
884
 * This method disables the components that represent
885
 * the fileds that the protocol used to do the search doesn't
886
 * support
887
 * 
888
 * 
889
 * @param type Server type: WFS,WFS-G,ADL,IDEC
890
 */
891
    private void disableComponents(String type) {        
892
        //System.out.println("TYPE: " + type);
893
       
894
        
895
        if (type.equals("WFS-G")){
896
            getThesaurusList().setEnabled(false);
897
            /*
898
            getULXText().setEnabled(false);
899
            getULYText().setEnabled(false);
900
            getBRXText().setEnabled(false);
901
            getBRYText().setEnabled(false);
902
            getCoordenadasCombo().setEnabled(false);
903
            */
904
        }
905
        
906
        if (type.equals("WFS")){          
907
            getULXText().setEnabled(false);
908
            getULYText().setEnabled(false);
909
            getBRXText().setEnabled(false);
910
            getBRYText().setEnabled(false);
911
            getCoordenadasCombo().setEnabled(false);
912
            
913
           
914
        }
915
        
916
        if (type.equals("ADL")){
917
            getULXText().setEnabled(false);
918
            getULYText().setEnabled(false);
919
            getBRXText().setEnabled(false);
920
            getBRYText().setEnabled(false);
921
            getCoordenadasCombo().setEnabled(false);
922
        }
923
        
924
        if (type.equals("IDEC")){
925
            getThesaurusList().setEnabled(false);
926
            getULXText().setEnabled(false);
927
            getULYText().setEnabled(false);
928
            getBRXText().setEnabled(false);
929
            getBRYText().setEnabled(false);
930
            getCoordenadasCombo().setEnabled(false);
931
        }
932
        
933
    } 
934

    
935
/**
936
 * This method initializes jCheckBox
937
 * 
938
 * 
939
 * @return javax.swing.JCheckBox
940
 */
941
    private JCheckBox getCheckBGoTo() {        
942
                if (checkBGoTo == null) {
943
                        checkBGoTo = new JCheckBox();
944
                        checkBGoTo.setText(Messages.getText("goto"));
945
                }
946
                return checkBGoTo;
947
    } 
948

    
949
/**
950
 * This method initializes jCheckBox
951
 * 
952
 * 
953
 * @return javax.swing.JCheckBox
954
 */
955
    private JCheckBox getCheckBKeepOld() {        
956
                if (checkBKeepOld == null) {
957
                        checkBKeepOld = new JCheckBox();
958
                        checkBKeepOld.setText(Messages.getText("mantainold"));
959
                }
960
                return checkBKeepOld;
961
    } 
962

    
963
/**
964
 * This method initializes jPanel2
965
 * 
966
 * 
967
 * @return javax.swing.JPanel
968
 */
969
    private JPanel getPanelShowOptionsPosition() {        
970
                if (panelShowOptionsPosition == null) {
971
                        panelShowOptionsPosition = new JPanel();
972
                        panelShowOptionsPosition.setLayout(new BoxLayout(panelShowOptionsPosition, BoxLayout.Y_AXIS));
973
                        panelShowOptionsPosition.setPreferredSize(new java.awt.Dimension(230,80));
974
                        panelShowOptionsPosition.add(getCheckBGoTo(), null);
975
                        panelShowOptionsPosition.add(getCheckBKeepOld(), null);
976
                        panelShowOptionsPosition.add(getCheckBMark(), null);
977
                }
978
                return panelShowOptionsPosition;
979
    } 
980

    
981
/**
982
 * It returns if the GOTO component is clicked
983
 * 
984
 * 
985
 * @return 
986
 */
987
    public boolean isGoToClicked() {        
988
            return getCheckBGoTo().isSelected();
989
    } 
990

    
991
/**
992
 * return if the Mantain Old button is enabled
993
 * 
994
 * 
995
 * @return 
996
 */
997
    public boolean isKeepOldClicked() {        
998
            return getCheckBKeepOld().isSelected();
999
    }
1000
    
1001
    /**
1002
     * return if the Mantain Old button is enabled
1003
     * 
1004
     * 
1005
     * @return 
1006
     */
1007
        public boolean isMarkedPlaceClicked() {        
1008
                return getCheckBMark().isSelected();
1009
        }
1010
        
1011
        
1012
        /**
1013
         * return if the With accents button is enabled
1014
         * 
1015
         * 
1016
         * @return 
1017
         */
1018
            public boolean isAccentsSearchEnabled() {        
1019
                    return getCheckBWithAccents().isSelected();
1020
            }
1021

    
1022
/**
1023
 * This method initializes jCheckBox        
1024
 *         
1025
 * @return javax.swing.JCheckBox        
1026
 */
1027
private JCheckBox getCheckBMark() {
1028
        if (checkBMark == null) {
1029
                checkBMark = new JCheckBox();
1030
                checkBMark.setText(Messages.getText("paint"));
1031
        }
1032
        return checkBMark;
1033
}
1034

    
1035
/**
1036
 * This method initializes jPanel2        
1037
 *         
1038
 * @return javax.swing.JPanel        
1039
 */
1040
private JPanel getPanelAdvancedSearch() {
1041
        if (panelAdvancedSearch == null) {
1042
                FlowLayout flowLayout1 = new FlowLayout();
1043
                flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
1044
                panelAdvancedSearch = new JPanel();
1045
                panelAdvancedSearch.setPreferredSize(new java.awt.Dimension(31,45));
1046
                panelAdvancedSearch.setLayout(flowLayout1);
1047
                panelAdvancedSearch.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("inteligentSearch"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
1048
                panelAdvancedSearch.add(getPanelAdvancedSearchPosition(), null);
1049
        }
1050
        return panelAdvancedSearch;
1051
}
1052

    
1053
/**
1054
 * This method initializes jPanel2        
1055
 *         
1056
 * @return javax.swing.JPanel        
1057
 */
1058
private JPanel getPanelAdvancedSearchPosition() {
1059
        if (panelAdvancedSearchPosition == null) {
1060
                panelAdvancedSearchPosition = new JPanel();
1061
                panelAdvancedSearchPosition.setLayout(new BoxLayout(getPanelAdvancedSearchPosition(), BoxLayout.Y_AXIS));
1062
                panelAdvancedSearchPosition.setPreferredSize(new java.awt.Dimension(230,30));
1063
                panelAdvancedSearchPosition.add(getCheckBWithAccents(), null);
1064
        }
1065
        return panelAdvancedSearchPosition;
1066
}
1067

    
1068
/**
1069
 * This method initializes jCheckBox        
1070
 *         
1071
 * @return javax.swing.JCheckBox        
1072
 */
1073
private JCheckBox getCheckBWithAccents() {
1074
        if (checkBWithAccents == null) {
1075
                checkBWithAccents = new JCheckBox();
1076
                checkBWithAccents.setText(Messages.getText("inteligentSearchAscii"));
1077
                checkBWithAccents.setPreferredSize(new java.awt.Dimension(230,20));
1078
        }
1079
        return checkBWithAccents;
1080
} 
1081
 }
1082
//  @jve:decl-index=0:visual-constraint="10,10"