Statistics
| Revision:

root / branches / v05 / applications / appCatalogYNomenclatorClient / src / es / gva / cit / gazetteer / ui / search / SearchLowerPanel.java @ 4012

History | View | Annotate | Download (27.2 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.traductor.ITranslator;
45
import es.gva.cit.catalogClient.traductor.Translator;
46
import es.gva.cit.catalogClient.utils.Doubles;
47
import es.gva.cit.gazetteer.querys.ThesaurusName;
48
import es.gva.cit.gazetteer.utils.ThesaurusJTree.ThesaurusJTree;
49
import java.awt.Color;
50
import java.awt.FlowLayout;
51
import java.awt.GridLayout;
52
import java.util.Vector;
53
import javax.swing.BoxLayout;
54
import javax.swing.ButtonGroup;
55
import javax.swing.JCheckBox;
56
import javax.swing.JComboBox;
57
import javax.swing.JLabel;
58
import javax.swing.JPanel;
59
import javax.swing.JRadioButton;
60
import javax.swing.JScrollPane;
61
import javax.swing.JTextField;
62
import javax.swing.tree.DefaultMutableTreeNode;
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
    private ITranslator translator = null;
243

    
244
/**
245
 * 
246
 * 
247
 */
248
    private String serverType = null;
249
/**
250
 * 
251
 * 
252
 */
253
    private JCheckBox checkBGoTo = null;
254
/**
255
 * 
256
 * 
257
 */
258
    private JCheckBox checkBKeepOld = null;
259
/**
260
 * 
261
 * 
262
 */
263
    private JPanel panelShowOptionsPosition = null;
264

    
265
private JCheckBox checkBMark = null;
266

    
267
private JPanel panelAdvancedSearch = null;
268

    
269
private JPanel panelAdvancedSearchPosition = null;
270

    
271
private JCheckBox checkBWithAccents = null;
272

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

    
294
/**
295
 * This method initializes this
296
 * 
297
 */
298
    private void initialize() {        
299
        this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
300
        this.setPreferredSize(new java.awt.Dimension(565,405));
301
        this.setLocation(0, 0);
302
        this.setSize(565, 405);
303
        this.add(getComponentesPanel(), null);
304
    } 
305

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

    
331
/**
332
 * This method initializes jRadioButton
333
 * 
334
 * 
335
 * @return javax.swing.JRadioButton
336
 */
337
    private JRadioButton getExactButton() {        
338
        if (exactButton == null) {
339
            exactButton = new JRadioButton();
340
            exactButton.setText( Translator.getText(translator,"exactSentence"));
341
            exactButton.setSelected(true);
342
        }
343
        return exactButton;
344
    } 
345

    
346
/**
347
 * This method initializes jRadioButton1
348
 * 
349
 * 
350
 * @return javax.swing.JRadioButton
351
 */
352
    private JRadioButton getAnyButton() {        
353
        if (anyButton == null) {
354
            anyButton = new JRadioButton();
355
            anyButton.setText( Translator.getText(translator,"anyWord"));
356
        }
357
        return anyButton;
358
    } 
359

    
360
/**
361
 * This method initializes jRadioButton2
362
 * 
363
 * 
364
 * @return javax.swing.JRadioButton
365
 */
366
    private JRadioButton getAllButton() {        
367
        if (allButton == null) {
368
            allButton = new JRadioButton();
369
            allButton.setText( Translator.getText(translator,"allWords"));
370
        }
371
        return allButton;
372
    } 
373

    
374
/**
375
 * This method initializes jPanel
376
 * 
377
 * 
378
 * @return javax.swing.JPanel
379
 */
380
    private JPanel getPanelLabNResultados() {        
381
        if (panelLabNResultados == null) {
382
            nResultadosLabel = new JLabel();
383
            panelLabNResultados = new JPanel();
384
            GridLayout gridLayout2 = new GridLayout();
385
            panelLabNResultados.setLayout(gridLayout2);
386
            nResultadosLabel.setText( Translator.getText(translator,"resutsByPage"));
387
            panelLabNResultados.add(nResultadosLabel, null);
388
        }
389
        return panelLabNResultados;
390
    } 
391

    
392
/**
393
 * This method initializes jComboBox
394
 * 
395
 * 
396
 * @return javax.swing.JComboBox
397
 */
398
    private JComboBox getNResultsCombo() {        
399
        if (nResultsCombo == null) {
400
            nResultsCombo = new JComboBox(resultadosPorPagina);
401
            nResultsCombo.setPreferredSize(new java.awt.Dimension(250,20));
402
            nResultsCombo.setBackground(Color.white);
403
            
404
        }
405
        return nResultsCombo;
406
    } 
407

    
408
/**
409
 * This method initializes jPanel
410
 * 
411
 * 
412
 * @return javax.swing.JPanel
413
 */
414
    private JPanel getPanelAjusteBotones() {        
415
        if (panelAjusteBotones == null) {
416
            GridLayout gridLayout6 = new GridLayout();
417
            panelAjusteBotones = new JPanel();
418
            panelAjusteBotones.setLayout(gridLayout6);
419
            gridLayout6.setRows(1);
420
            panelAjusteBotones.add(getPanelRadioButtons(), null);
421
        }
422
        return panelAjusteBotones;
423
    } 
424

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

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

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

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

    
517
/**
518
 * This method initializes jTextField
519
 * 
520
 * 
521
 * @return javax.swing.JTextField
522
 */
523
    private JTextField getULXText() {        
524
        if (ULXText == null) {
525
            ULXText = new JTextField();
526
            ULXText.setPreferredSize(new java.awt.Dimension(65,20));
527
        }
528
        return ULXText;
529
    } 
530

    
531
/**
532
 * This method initializes jTextField
533
 * 
534
 * 
535
 * @return javax.swing.JTextField
536
 */
537
    private JTextField getULYText() {        
538
        if (ULYText == null) {
539
            ULYText = new JTextField();
540
            ULYText.setPreferredSize(new java.awt.Dimension(65,20));
541
        }
542
        return ULYText;
543
    } 
544

    
545
/**
546
 * This method initializes jTextField
547
 * 
548
 * 
549
 * @return javax.swing.JTextField
550
 */
551
    private JTextField getBRXText() {        
552
        if (BRXText == null) {
553
            BRXText = new JTextField();
554
            BRXText.setPreferredSize(new java.awt.Dimension(65,20));
555
        }
556
        return BRXText;
557
    } 
558

    
559
/**
560
 * This method initializes jTextField
561
 * 
562
 * 
563
 * @return javax.swing.JTextField
564
 */
565
    private JTextField getBRYText() {        
566
        if (BRYText == null) {
567
            BRYText = new JTextField();
568
            BRYText.setPreferredSize(new java.awt.Dimension(65,20));
569
        }
570
        return BRYText;
571
    } 
572

    
573
/**
574
 * This method initializes jPanel
575
 * 
576
 * 
577
 * @return javax.swing.JPanel
578
 */
579
    private JPanel getJPanel() {        
580
        if (jPanel == null) {
581
            jPanel = new JPanel();
582
            jPanel.setPreferredSize(new java.awt.Dimension(10,5));
583
            jPanel.add(getCoordenadasCombo(), null);
584
        }
585
        return jPanel;
586
    } 
587

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

    
607
/**
608
 * This method initializes jPanel9
609
 * 
610
 * 
611
 * @return javax.swing.JPanel
612
 */
613
    private JPanel getPanelNResultadosCombo() {        
614
        if (panelNResultadosCombo == null) {
615
            panelNResultadosCombo = new JPanel();
616
            panelNResultadosCombo.add(getNResultsCombo(), null);
617
        }
618
        return panelNResultadosCombo;
619
    } 
620

    
621
/**
622
 * This method initializes jPanel7
623
 * 
624
 * 
625
 * @return javax.swing.JPanel
626
 */
627
    private JPanel getPanelLabTipo() {        
628
        if (panelLabTipo == null) {
629
            tipoLabel = new JLabel();
630
            GridLayout gridLayout1 = new GridLayout();
631
            panelLabTipo = new JPanel();
632
            panelLabTipo.setLayout(gridLayout1);
633
            gridLayout1.setRows(1);
634
            tipoLabel.setText(Translator.getText(translator,"type"));
635
            panelLabTipo.add(tipoLabel, null);
636
        }
637
        return panelLabTipo;
638
    } 
639

    
640
/**
641
 * This method initializes jPanel7
642
 * 
643
 * 
644
 * @return javax.swing.JPanel
645
 */
646
    private JPanel getPanelListTipo() {        
647
        if (panelListTipo == null) {
648
            panelListTipo = new JPanel();
649
            panelListTipo.setPreferredSize(new java.awt.Dimension(310,115));
650
            panelListTipo.add(getJScrollThesaurus(), null);
651
        }
652
        return panelListTipo;
653
    } 
654

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

    
680
/**
681
 * 
682
 * 
683
 * 
684
 * @return 
685
 */
686
    public String getConcordancia() {        
687
        if (getExactButton().isSelected()) {
688
            return "E";
689
        }
690
        if (getAnyButton().isSelected()) {
691
            return "Y";
692
        }
693
        if (getAllButton().isSelected()) {
694
            return "A";
695
        }
696
        return null;
697
    } 
698

    
699
/**
700
 * Ir returns the current selected thesaurus type
701
 * 
702
 * 
703
 * @return 
704
 */
705
    public ThesaurusName getType() {        
706
        DefaultMutableTreeNode dmt = (DefaultMutableTreeNode)thesaurusTree.getLastSelectedPathComponent();
707
        if (dmt == null)
708
            return null;
709
        return (ThesaurusName) dmt.getUserObject();
710
    } 
711

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

    
730
/**
731
 * 
732
 * 
733
 * 
734
 * @return 
735
 */
736
    public int getNPaginas() {        
737
        String s = (String) getNResultsCombo().getSelectedItem();
738
        return Integer.valueOf(s).intValue();
739
    } 
740

    
741
/**
742
 * 
743
 * 
744
 * 
745
 * @return 
746
 */
747
    public Coordinates getCoordenadas() {        
748
        return new Coordinates(getULXText().getText(), getULYText().getText(),
749
            getBRXText().getText(), getBRYText().getText());
750
    } 
751

    
752
/**
753
 * 
754
 * 
755
 * 
756
 * @return 
757
 */
758
    public String getCoordenadasOpcion() {        
759
        return (String) getCoordenadasCombo().getSelectedItem();
760
    } 
761

    
762
/**
763
 * It sets the coordinates fields
764
 * 
765
 * 
766
 * @param coordinates 
767
 */
768
    public void setCoordinates(Coordinates coordinates) {        
769
        setULXText(Doubles.get5Decimals(coordinates.ulx));
770
        setULYText(Doubles.get5Decimals(coordinates.uly));
771
        setBRXText(Doubles.get5Decimals(coordinates.brx));
772
        setBRYText(Doubles.get5Decimals(coordinates.bry));
773
    } 
774

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

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

    
818
/**
819
 * This method initializes jPanel5
820
 * 
821
 * 
822
 * @return javax.swing.JPanel
823
 */
824
    private JPanel getComponentesPanel() {        
825
        if (componentesPanel == null) {
826
            componentesPanel = new JPanel();
827
            componentesPanel.setPreferredSize(new java.awt.Dimension(565,400));
828
            componentesPanel.add(getJPanel33(), null);
829
            componentesPanel.add(getJPanel3(), null);
830
        }
831
        return componentesPanel;
832
    } 
833

    
834
/**
835
 * This method initializes jScrollPane1
836
 * 
837
 * 
838
 * @return javax.swing.JScrollPane
839
 */
840
    public JScrollPane getJScrollThesaurus() {        
841
                if (jScrollThesaurus == null) {
842
                    jScrollThesaurus = new JScrollPane(getThesaurusList());
843
                    jScrollThesaurus.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
844
                    jScrollThesaurus.setPreferredSize(new java.awt.Dimension(250,120));
845
                }
846
                return jScrollThesaurus;
847
    } 
848

    
849
/**
850
 * 
851
 * 
852
 * 
853
 * @param text The bRXText to set.
854
 */
855
    public void setBRXText(String text) {        
856
        BRXText.setText(text);
857
    } 
858

    
859
/**
860
 * 
861
 * 
862
 * 
863
 * @param text The bRYText to set.
864
 */
865
    public void setBRYText(String text) {        
866
        BRYText.setText(text);
867
    } 
868

    
869
/**
870
 * 
871
 * 
872
 * 
873
 * @param text The uLXText to set.
874
 */
875
    public void setULXText(String text) {        
876
        ULXText.setText(text);
877
    } 
878

    
879
/**
880
 * 
881
 * 
882
 * 
883
 * @param text The uLYText to set.
884
 */
885
    public void setULYText(String text) {        
886
        ULYText.setText(text);
887
    } 
888

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

    
941
/**
942
 * This method initializes jCheckBox
943
 * 
944
 * 
945
 * @return javax.swing.JCheckBox
946
 */
947
    private JCheckBox getCheckBGoTo() {        
948
                if (checkBGoTo == null) {
949
                        checkBGoTo = new JCheckBox();
950
                        checkBGoTo.setText(Translator.getText(translator,"goto"));
951
                }
952
                return checkBGoTo;
953
    } 
954

    
955
/**
956
 * This method initializes jCheckBox
957
 * 
958
 * 
959
 * @return javax.swing.JCheckBox
960
 */
961
    private JCheckBox getCheckBKeepOld() {        
962
                if (checkBKeepOld == null) {
963
                        checkBKeepOld = new JCheckBox();
964
                        checkBKeepOld.setText(Translator.getText(translator,"mantainold"));
965
                }
966
                return checkBKeepOld;
967
    } 
968

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

    
987
/**
988
 * It returns if the GOTO component is clicked
989
 * 
990
 * 
991
 * @return 
992
 */
993
    public boolean isGoToClicked() {        
994
            return getCheckBGoTo().isSelected();
995
    } 
996

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

    
1028
/**
1029
 * This method initializes jCheckBox        
1030
 *         
1031
 * @return javax.swing.JCheckBox        
1032
 */
1033
private JCheckBox getCheckBMark() {
1034
        if (checkBMark == null) {
1035
                checkBMark = new JCheckBox();
1036
                checkBMark.setText(Translator.getText(translator,"paint"));
1037
        }
1038
        return checkBMark;
1039
}
1040

    
1041
/**
1042
 * This method initializes jPanel2        
1043
 *         
1044
 * @return javax.swing.JPanel        
1045
 */
1046
private JPanel getPanelAdvancedSearch() {
1047
        if (panelAdvancedSearch == null) {
1048
                FlowLayout flowLayout1 = new FlowLayout();
1049
                flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
1050
                panelAdvancedSearch = new JPanel();
1051
                panelAdvancedSearch.setPreferredSize(new java.awt.Dimension(31,50));
1052
                panelAdvancedSearch.setLayout(flowLayout1);
1053
                panelAdvancedSearch.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Translator.getText(translator,"inteligentSearch"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
1054
                panelAdvancedSearch.add(getPanelAdvancedSearchPosition(), null);
1055
        }
1056
        return panelAdvancedSearch;
1057
}
1058

    
1059
/**
1060
 * This method initializes jPanel2        
1061
 *         
1062
 * @return javax.swing.JPanel        
1063
 */
1064
private JPanel getPanelAdvancedSearchPosition() {
1065
        if (panelAdvancedSearchPosition == null) {
1066
                panelAdvancedSearchPosition = new JPanel();
1067
                panelAdvancedSearchPosition.setLayout(new BoxLayout(getPanelAdvancedSearchPosition(), BoxLayout.Y_AXIS));
1068
                panelAdvancedSearchPosition.setPreferredSize(new java.awt.Dimension(230,30));
1069
                panelAdvancedSearchPosition.add(getCheckBWithAccents(), null);
1070
        }
1071
        return panelAdvancedSearchPosition;
1072
}
1073

    
1074
/**
1075
 * This method initializes jCheckBox        
1076
 *         
1077
 * @return javax.swing.JCheckBox        
1078
 */
1079
private JCheckBox getCheckBWithAccents() {
1080
        if (checkBWithAccents == null) {
1081
                checkBWithAccents = new JCheckBox();
1082
                checkBWithAccents.setText(Translator.getText(translator,"inteligentSearchAscii"));
1083
                checkBWithAccents.setPreferredSize(new java.awt.Dimension(230,20));
1084
        }
1085
        return checkBWithAccents;
1086
} 
1087
 }
1088
//  @jve:decl-index=0:visual-constraint="10,10"