svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / gazetteer / ui / search / SearchLowerPanel.java @ 3566
History | View | Annotate | Download (25.1 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 jLabel4 = null; |
158 |
/**
|
159 |
*
|
160 |
*
|
161 |
*/
|
162 |
private JLabel ULYLabel = null; |
163 |
/**
|
164 |
*
|
165 |
*
|
166 |
*/
|
167 |
private JTextField ULYText = null; |
168 |
/**
|
169 |
*
|
170 |
*
|
171 |
*/
|
172 |
private JLabel BRXLabel = null; |
173 |
/**
|
174 |
*
|
175 |
*
|
176 |
*/
|
177 |
private JTextField BRXText = null; |
178 |
/**
|
179 |
*
|
180 |
*
|
181 |
*/
|
182 |
private JLabel jLabel5 = null; |
183 |
/**
|
184 |
*
|
185 |
*
|
186 |
*/
|
187 |
private JLabel BRYLabel = null; |
188 |
/**
|
189 |
*
|
190 |
*
|
191 |
*/
|
192 |
private JTextField BRYText = null; |
193 |
/**
|
194 |
*
|
195 |
*
|
196 |
*/
|
197 |
private JPanel jPanel = null; |
198 |
/**
|
199 |
*
|
200 |
*
|
201 |
*/
|
202 |
private JPanel panelShowOptions = null; |
203 |
/**
|
204 |
*
|
205 |
*
|
206 |
*/
|
207 |
private JPanel panelNResultadosCombo = null; |
208 |
/**
|
209 |
*
|
210 |
*
|
211 |
*/
|
212 |
private JPanel panelLabTipo = null; |
213 |
/**
|
214 |
*
|
215 |
*
|
216 |
*/
|
217 |
private JPanel panelListTipo = null; |
218 |
/**
|
219 |
*
|
220 |
*
|
221 |
*/
|
222 |
private JLabel tipoLabel = null; |
223 |
/**
|
224 |
*
|
225 |
*
|
226 |
*/
|
227 |
private ThesaurusJTree thesaurusTree = null; |
228 |
/**
|
229 |
*
|
230 |
*
|
231 |
*/
|
232 |
private JComboBox coordenadasCombo = null; |
233 |
/**
|
234 |
*
|
235 |
*
|
236 |
*/
|
237 |
private JPanel panelCoordinates = null; |
238 |
/**
|
239 |
*
|
240 |
*
|
241 |
*/
|
242 |
private JPanel componentesPanel = null; |
243 |
/**
|
244 |
*
|
245 |
*
|
246 |
*/
|
247 |
private JScrollPane jScrollThesaurus = null; |
248 |
/**
|
249 |
*
|
250 |
*
|
251 |
*/
|
252 |
private ITranslator translator = null; |
253 |
|
254 |
/**
|
255 |
*
|
256 |
*
|
257 |
*/
|
258 |
private String serverType = null; |
259 |
/**
|
260 |
*
|
261 |
*
|
262 |
*/
|
263 |
private JCheckBox checkBGoTo = null; |
264 |
/**
|
265 |
*
|
266 |
*
|
267 |
*/
|
268 |
private JCheckBox checkBKeepOld = null; |
269 |
/**
|
270 |
*
|
271 |
*
|
272 |
*/
|
273 |
private JPanel jPanel1 = null; |
274 |
/**
|
275 |
*
|
276 |
*
|
277 |
*/
|
278 |
private JPanel panelShowOptionsPosition = null; |
279 |
|
280 |
/**
|
281 |
*
|
282 |
*
|
283 |
*
|
284 |
* @param features Features list
|
285 |
* @param translator Class to translate the interface
|
286 |
* @param serverType Server type used to enable/disable some interface components
|
287 |
*/
|
288 |
public SearchLowerPanel(Vector features, ITranslator translator, String serverType) { |
289 |
super();
|
290 |
this.translator = translator;
|
291 |
this.features = features;
|
292 |
this.serverType = serverType;
|
293 |
initialize(); |
294 |
disableComponents(serverType); |
295 |
getCheckBGoTo().setSelected(true);
|
296 |
getCheckBKeepOld().setSelected(true);
|
297 |
} |
298 |
|
299 |
/**
|
300 |
* This method initializes this
|
301 |
*
|
302 |
*/
|
303 |
private void initialize() { |
304 |
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
305 |
this.setPreferredSize(new java.awt.Dimension(565,335)); |
306 |
this.setLocation(0, 0); |
307 |
this.setSize(565, 335); |
308 |
this.add(getComponentesPanel(), null); |
309 |
} |
310 |
|
311 |
/**
|
312 |
* This method initializes jPanel
|
313 |
*
|
314 |
*
|
315 |
* @return javax.swing.JPanel
|
316 |
*/
|
317 |
private JPanel getPanelRadioButtons() { |
318 |
if (panelRadioButtons == null) { |
319 |
panelRadioButtons = new JPanel(); |
320 |
panelRadioButtons.setLayout(new BoxLayout(panelRadioButtons, BoxLayout.Y_AXIS)); |
321 |
panelRadioButtons.setBorder(javax.swing.BorderFactory.createTitledBorder( |
322 |
null, Translator.getText(translator,"concordancia"), |
323 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
324 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
325 |
panelRadioButtons.add(getExactButton(), null);
|
326 |
panelRadioButtons.add(getAnyButton(), null);
|
327 |
panelRadioButtons.add(getAllButton(), null);
|
328 |
ButtonGroup group = new ButtonGroup(); |
329 |
group.add(getExactButton()); |
330 |
group.add(getAnyButton()); |
331 |
group.add(getAllButton()); |
332 |
} |
333 |
return panelRadioButtons;
|
334 |
} |
335 |
|
336 |
/**
|
337 |
* This method initializes jRadioButton
|
338 |
*
|
339 |
*
|
340 |
* @return javax.swing.JRadioButton
|
341 |
*/
|
342 |
private JRadioButton getExactButton() { |
343 |
if (exactButton == null) { |
344 |
exactButton = new JRadioButton(); |
345 |
exactButton.setText( Translator.getText(translator,"exactSentence"));
|
346 |
exactButton.setSelected(true);
|
347 |
} |
348 |
return exactButton;
|
349 |
} |
350 |
|
351 |
/**
|
352 |
* This method initializes jRadioButton1
|
353 |
*
|
354 |
*
|
355 |
* @return javax.swing.JRadioButton
|
356 |
*/
|
357 |
private JRadioButton getAnyButton() { |
358 |
if (anyButton == null) { |
359 |
anyButton = new JRadioButton(); |
360 |
anyButton.setText( Translator.getText(translator,"anyWord"));
|
361 |
} |
362 |
return anyButton;
|
363 |
} |
364 |
|
365 |
/**
|
366 |
* This method initializes jRadioButton2
|
367 |
*
|
368 |
*
|
369 |
* @return javax.swing.JRadioButton
|
370 |
*/
|
371 |
private JRadioButton getAllButton() { |
372 |
if (allButton == null) { |
373 |
allButton = new JRadioButton(); |
374 |
allButton.setText( Translator.getText(translator,"allWords"));
|
375 |
} |
376 |
return allButton;
|
377 |
} |
378 |
|
379 |
/**
|
380 |
* This method initializes jPanel
|
381 |
*
|
382 |
*
|
383 |
* @return javax.swing.JPanel
|
384 |
*/
|
385 |
private JPanel getPanelLabNResultados() { |
386 |
if (panelLabNResultados == null) { |
387 |
nResultadosLabel = new JLabel(); |
388 |
panelLabNResultados = new JPanel(); |
389 |
GridLayout gridLayout2 = new GridLayout(); |
390 |
panelLabNResultados.setLayout(gridLayout2); |
391 |
nResultadosLabel.setText( Translator.getText(translator,"resutsByPage"));
|
392 |
panelLabNResultados.add(nResultadosLabel, null);
|
393 |
} |
394 |
return panelLabNResultados;
|
395 |
} |
396 |
|
397 |
/**
|
398 |
* This method initializes jComboBox
|
399 |
*
|
400 |
*
|
401 |
* @return javax.swing.JComboBox
|
402 |
*/
|
403 |
private JComboBox getNResultsCombo() { |
404 |
if (nResultsCombo == null) { |
405 |
nResultsCombo = new JComboBox(resultadosPorPagina); |
406 |
nResultsCombo.setPreferredSize(new java.awt.Dimension(250,20)); |
407 |
nResultsCombo.setBackground(Color.white);
|
408 |
|
409 |
} |
410 |
return nResultsCombo;
|
411 |
} |
412 |
|
413 |
/**
|
414 |
* This method initializes jPanel
|
415 |
*
|
416 |
*
|
417 |
* @return javax.swing.JPanel
|
418 |
*/
|
419 |
private JPanel getPanelAjusteBotones() { |
420 |
if (panelAjusteBotones == null) { |
421 |
GridLayout gridLayout6 = new GridLayout(); |
422 |
panelAjusteBotones = new JPanel(); |
423 |
panelAjusteBotones.setLayout(gridLayout6); |
424 |
gridLayout6.setRows(1);
|
425 |
panelAjusteBotones.add(getPanelRadioButtons(), null);
|
426 |
} |
427 |
return panelAjusteBotones;
|
428 |
} |
429 |
|
430 |
/**
|
431 |
* This method initializes jPanel3
|
432 |
*
|
433 |
*
|
434 |
* @return javax.swing.JPanel
|
435 |
*/
|
436 |
private JPanel getJPanel3() { |
437 |
if (panelRigth == null) { |
438 |
panelRigth = new JPanel(); |
439 |
panelRigth.setLayout(new BoxLayout( |
440 |
panelRigth, BoxLayout.Y_AXIS));
|
441 |
panelRigth.setPreferredSize(new java.awt.Dimension(250,320)); |
442 |
panelRigth.add(getPanelCoordinates(), null);
|
443 |
panelRigth.add(getPanelShowOptions(), null);
|
444 |
panelRigth.add(getJPanel1(), null);
|
445 |
} |
446 |
return panelRigth;
|
447 |
} |
448 |
|
449 |
/**
|
450 |
* This method initializes jPanel3
|
451 |
*
|
452 |
*
|
453 |
* @return javax.swing.JPanel
|
454 |
*/
|
455 |
private JPanel getJPanel33() { |
456 |
if (panelLeft == null) { |
457 |
panelLeft = new JPanel(); |
458 |
panelLeft.setLayout(new BoxLayout( |
459 |
panelLeft, BoxLayout.Y_AXIS));
|
460 |
panelLeft.setPreferredSize(new java.awt.Dimension(250,320)); |
461 |
panelLeft.add(getPanelAjusteBotones(), null);
|
462 |
panelLeft.add(getPanelLabTipo(), null);
|
463 |
panelLeft.add(getPanelListTipo(), null);
|
464 |
panelLeft.add(getPanelLabNResultados(), null);
|
465 |
panelLeft.add(getPanelNResultadosCombo(), null);
|
466 |
} |
467 |
return panelLeft;
|
468 |
} |
469 |
|
470 |
/**
|
471 |
* This method initializes jPanel4
|
472 |
*
|
473 |
*
|
474 |
* @return javax.swing.JPanel
|
475 |
*/
|
476 |
private JPanel getPanelSuperiores() { |
477 |
if (panelSuperiores == null) { |
478 |
ULXLabel = new JLabel(); |
479 |
ULYLabel = new JLabel(); |
480 |
jLabel4 = new JLabel(); |
481 |
panelSuperiores = new JPanel(); |
482 |
panelSuperiores.setBorder(javax.swing.BorderFactory.createTitledBorder( |
483 |
null, Translator.getText(translator,"upperCoordinates"), |
484 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
485 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
486 |
panelSuperiores.setPreferredSize(new java.awt.Dimension(213, 56)); |
487 |
ULXLabel.setText("ULX:");
|
488 |
jLabel4.setText("");
|
489 |
jLabel4.setPreferredSize(new java.awt.Dimension(20, 0)); |
490 |
ULYLabel.setText("ULY:");
|
491 |
panelSuperiores.add(ULXLabel, null);
|
492 |
panelSuperiores.add(getULXText(), null);
|
493 |
panelSuperiores.add(jLabel4, null);
|
494 |
panelSuperiores.add(ULYLabel, null);
|
495 |
panelSuperiores.add(getULYText(), null);
|
496 |
} |
497 |
return panelSuperiores;
|
498 |
} |
499 |
|
500 |
/**
|
501 |
* This method initializes jPanel4
|
502 |
*
|
503 |
*
|
504 |
* @return javax.swing.JPanel
|
505 |
*/
|
506 |
private JPanel getPanelInferiores() { |
507 |
if (panelInferiores == null) { |
508 |
BRXLabel = new JLabel(); |
509 |
BRYLabel = new JLabel(); |
510 |
jLabel5 = new JLabel(); |
511 |
panelInferiores = new JPanel(); |
512 |
panelInferiores.setBorder(javax.swing.BorderFactory.createTitledBorder( |
513 |
null, Translator.getText(translator,"lowerCoordinates"), |
514 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
515 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
516 |
BRXLabel.setText("BRX:");
|
517 |
jLabel5.setText("");
|
518 |
jLabel5.setPreferredSize(new java.awt.Dimension(20, 0)); |
519 |
BRYLabel.setText("BRY:");
|
520 |
panelInferiores.add(BRXLabel, null);
|
521 |
panelInferiores.add(getBRXText(), null);
|
522 |
panelInferiores.add(jLabel5, null);
|
523 |
panelInferiores.add(BRYLabel, null);
|
524 |
panelInferiores.add(getBRYText(), null);
|
525 |
} |
526 |
return panelInferiores;
|
527 |
} |
528 |
|
529 |
/**
|
530 |
* This method initializes jTextField
|
531 |
*
|
532 |
*
|
533 |
* @return javax.swing.JTextField
|
534 |
*/
|
535 |
private JTextField getULXText() { |
536 |
if (ULXText == null) { |
537 |
ULXText = new JTextField(); |
538 |
ULXText.setPreferredSize(new java.awt.Dimension(65,20)); |
539 |
} |
540 |
return ULXText;
|
541 |
} |
542 |
|
543 |
/**
|
544 |
* This method initializes jTextField
|
545 |
*
|
546 |
*
|
547 |
* @return javax.swing.JTextField
|
548 |
*/
|
549 |
private JTextField getULYText() { |
550 |
if (ULYText == null) { |
551 |
ULYText = new JTextField(); |
552 |
ULYText.setPreferredSize(new java.awt.Dimension(65,20)); |
553 |
} |
554 |
return ULYText;
|
555 |
} |
556 |
|
557 |
/**
|
558 |
* This method initializes jTextField
|
559 |
*
|
560 |
*
|
561 |
* @return javax.swing.JTextField
|
562 |
*/
|
563 |
private JTextField getBRXText() { |
564 |
if (BRXText == null) { |
565 |
BRXText = new JTextField(); |
566 |
BRXText.setPreferredSize(new java.awt.Dimension(65,20)); |
567 |
} |
568 |
return BRXText;
|
569 |
} |
570 |
|
571 |
/**
|
572 |
* This method initializes jTextField
|
573 |
*
|
574 |
*
|
575 |
* @return javax.swing.JTextField
|
576 |
*/
|
577 |
private JTextField getBRYText() { |
578 |
if (BRYText == null) { |
579 |
BRYText = new JTextField(); |
580 |
BRYText.setPreferredSize(new java.awt.Dimension(65,20)); |
581 |
} |
582 |
return BRYText;
|
583 |
} |
584 |
|
585 |
/**
|
586 |
* This method initializes jPanel
|
587 |
*
|
588 |
*
|
589 |
* @return javax.swing.JPanel
|
590 |
*/
|
591 |
private JPanel getJPanel() { |
592 |
if (jPanel == null) { |
593 |
jPanel = new JPanel(); |
594 |
jPanel.add(getCoordenadasCombo(), null);
|
595 |
} |
596 |
return jPanel;
|
597 |
} |
598 |
|
599 |
/**
|
600 |
* This method initializes jPanel8
|
601 |
*
|
602 |
*
|
603 |
* @return javax.swing.JPanel
|
604 |
*/
|
605 |
private JPanel getPanelShowOptions() { |
606 |
if (panelShowOptions == null) { |
607 |
FlowLayout flowLayout4 = new FlowLayout(); |
608 |
panelShowOptions = new JPanel(); |
609 |
panelShowOptions.setLayout(flowLayout4); |
610 |
panelShowOptions.setPreferredSize(new java.awt.Dimension(10,75)); |
611 |
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)); |
612 |
flowLayout4.setAlignment(java.awt.FlowLayout.LEFT); |
613 |
panelShowOptions.add(getPanelShowOptionsPosition(), null);
|
614 |
} |
615 |
return panelShowOptions;
|
616 |
} |
617 |
|
618 |
/**
|
619 |
* This method initializes jPanel9
|
620 |
*
|
621 |
*
|
622 |
* @return javax.swing.JPanel
|
623 |
*/
|
624 |
private JPanel getPanelNResultadosCombo() { |
625 |
if (panelNResultadosCombo == null) { |
626 |
panelNResultadosCombo = new JPanel(); |
627 |
panelNResultadosCombo.add(getNResultsCombo(), null);
|
628 |
} |
629 |
return panelNResultadosCombo;
|
630 |
} |
631 |
|
632 |
/**
|
633 |
* This method initializes jPanel7
|
634 |
*
|
635 |
*
|
636 |
* @return javax.swing.JPanel
|
637 |
*/
|
638 |
private JPanel getPanelLabTipo() { |
639 |
if (panelLabTipo == null) { |
640 |
tipoLabel = new JLabel(); |
641 |
GridLayout gridLayout1 = new GridLayout(); |
642 |
panelLabTipo = new JPanel(); |
643 |
panelLabTipo.setLayout(gridLayout1); |
644 |
gridLayout1.setRows(1);
|
645 |
tipoLabel.setText(Translator.getText(translator,"type"));
|
646 |
panelLabTipo.add(tipoLabel, null);
|
647 |
} |
648 |
return panelLabTipo;
|
649 |
} |
650 |
|
651 |
/**
|
652 |
* This method initializes jPanel7
|
653 |
*
|
654 |
*
|
655 |
* @return javax.swing.JPanel
|
656 |
*/
|
657 |
private JPanel getPanelListTipo() { |
658 |
if (panelListTipo == null) { |
659 |
panelListTipo = new JPanel(); |
660 |
panelListTipo.setPreferredSize(new java.awt.Dimension(310,115)); |
661 |
panelListTipo.add(getJScrollThesaurus(), null);
|
662 |
} |
663 |
return panelListTipo;
|
664 |
} |
665 |
|
666 |
/**
|
667 |
* This method initializes jTextField
|
668 |
*
|
669 |
*
|
670 |
* @return javax.swing.JTextField
|
671 |
*/
|
672 |
public ThesaurusJTree getThesaurusList() {
|
673 |
if (thesaurusTree == null) { |
674 |
int numFeatures;
|
675 |
if (features == null){ |
676 |
numFeatures = 0;
|
677 |
}else{
|
678 |
numFeatures = features.size(); |
679 |
} |
680 |
|
681 |
ThesaurusName[] f = new ThesaurusName[numFeatures]; |
682 |
for (int i=0 ; i<numFeatures ; i++){ |
683 |
f[i] = (ThesaurusName)features.get(i); |
684 |
} |
685 |
thesaurusTree = new ThesaurusJTree(features,
|
686 |
Translator.getText(translator,"rootName"));
|
687 |
} |
688 |
return thesaurusTree;
|
689 |
} |
690 |
|
691 |
/**
|
692 |
*
|
693 |
*
|
694 |
*
|
695 |
* @return
|
696 |
*/
|
697 |
public String getConcordancia() { |
698 |
if (getExactButton().isSelected()) {
|
699 |
return "E"; |
700 |
} |
701 |
if (getAnyButton().isSelected()) {
|
702 |
return "Y"; |
703 |
} |
704 |
if (getAllButton().isSelected()) {
|
705 |
return "A"; |
706 |
} |
707 |
return null; |
708 |
} |
709 |
|
710 |
/**
|
711 |
* Ir returns the current selected thesaurus type
|
712 |
*
|
713 |
*
|
714 |
* @return
|
715 |
*/
|
716 |
public ThesaurusName getType() {
|
717 |
DefaultMutableTreeNode dmt = (DefaultMutableTreeNode)thesaurusTree.getLastSelectedPathComponent(); |
718 |
if (dmt == null) |
719 |
return null; |
720 |
return (ThesaurusName) dmt.getUserObject();
|
721 |
} |
722 |
|
723 |
/**
|
724 |
* Ir returns all the thesaurus in the combo
|
725 |
*
|
726 |
*
|
727 |
* @return ThesaurusName[]
|
728 |
*/
|
729 |
public ThesaurusName[] getAllTypes() { |
730 |
DefaultMutableTreeNode root = (DefaultMutableTreeNode)thesaurusTree.getModel().getRoot(); |
731 |
ThesaurusName[] thesaurus = new ThesaurusName[root.getChildCount()]; |
732 |
|
733 |
for (int i=0 ; i<root.getChildCount() ; i++){ |
734 |
DefaultMutableTreeNode child = (DefaultMutableTreeNode) root.getChildAt(i); |
735 |
thesaurus[i] = (ThesaurusName) child.getUserObject(); |
736 |
} |
737 |
|
738 |
return thesaurus;
|
739 |
} |
740 |
|
741 |
/**
|
742 |
*
|
743 |
*
|
744 |
*
|
745 |
* @return
|
746 |
*/
|
747 |
public int getNPaginas() { |
748 |
String s = (String) getNResultsCombo().getSelectedItem(); |
749 |
return Integer.valueOf(s).intValue(); |
750 |
} |
751 |
|
752 |
/**
|
753 |
*
|
754 |
*
|
755 |
*
|
756 |
* @return
|
757 |
*/
|
758 |
public Coordinates getCoordenadas() {
|
759 |
return new Coordinates(getULXText().getText(), getULYText().getText(), |
760 |
getBRXText().getText(), getBRYText().getText()); |
761 |
} |
762 |
|
763 |
/**
|
764 |
*
|
765 |
*
|
766 |
*
|
767 |
* @return
|
768 |
*/
|
769 |
public String getCoordenadasOpcion() { |
770 |
return (String) getCoordenadasCombo().getSelectedItem(); |
771 |
} |
772 |
|
773 |
/**
|
774 |
* It sets the coordinates fields
|
775 |
*
|
776 |
*
|
777 |
* @param coordinates
|
778 |
*/
|
779 |
public void setCoordinates(Coordinates coordinates) { |
780 |
setULXText(Doubles.get5Decimals(coordinates.ulx)); |
781 |
setULYText(Doubles.get5Decimals(coordinates.uly)); |
782 |
setBRXText(Doubles.get5Decimals(coordinates.brx)); |
783 |
setBRYText(Doubles.get5Decimals(coordinates.bry)); |
784 |
} |
785 |
|
786 |
/**
|
787 |
* This method initializes jComboBox
|
788 |
*
|
789 |
*
|
790 |
* @return javax.swing.JComboBox
|
791 |
*/
|
792 |
private JComboBox getCoordenadasCombo() { |
793 |
if (coordenadasCombo == null) { |
794 |
String[] coordinates; |
795 |
|
796 |
coordinates = new String[2]; |
797 |
coordinates[0] = Translator.getText(translator,"coordinatesContains"); |
798 |
coordinates[1] = Translator.getText(translator,"coordinatesFullyOutsideOf"); |
799 |
|
800 |
coordenadasCombo = new JComboBox(coordinates); |
801 |
coordenadasCombo.setPreferredSize(new java.awt.Dimension(240,20)); |
802 |
coordenadasCombo.setBackground(Color.white);
|
803 |
} |
804 |
return coordenadasCombo;
|
805 |
} |
806 |
|
807 |
/**
|
808 |
* This method initializes jPanel4
|
809 |
*
|
810 |
*
|
811 |
* @return javax.swing.JPanel
|
812 |
*/
|
813 |
private JPanel getPanelCoordinates() { |
814 |
if (panelCoordinates == null) { |
815 |
panelCoordinates = new JPanel(); |
816 |
panelCoordinates.setLayout(new BoxLayout(panelCoordinates, BoxLayout.Y_AXIS)); |
817 |
panelCoordinates.setBorder(javax.swing.BorderFactory.createTitledBorder( |
818 |
null, Translator.getText(translator,"coordinates"), |
819 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
820 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
821 |
panelCoordinates.setPreferredSize(new java.awt.Dimension(315,175)); |
822 |
panelCoordinates.add(getPanelSuperiores(), null);
|
823 |
panelCoordinates.add(getPanelInferiores(), null);
|
824 |
panelCoordinates.add(getJPanel(), null);
|
825 |
} |
826 |
return panelCoordinates;
|
827 |
} |
828 |
|
829 |
/**
|
830 |
* This method initializes jPanel5
|
831 |
*
|
832 |
*
|
833 |
* @return javax.swing.JPanel
|
834 |
*/
|
835 |
private JPanel getComponentesPanel() { |
836 |
if (componentesPanel == null) { |
837 |
componentesPanel = new JPanel(); |
838 |
componentesPanel.setPreferredSize(new java.awt.Dimension(565,300)); |
839 |
componentesPanel.add(getJPanel33(), null);
|
840 |
componentesPanel.add(getJPanel3(), null);
|
841 |
} |
842 |
return componentesPanel;
|
843 |
} |
844 |
|
845 |
/**
|
846 |
* This method initializes jScrollPane1
|
847 |
*
|
848 |
*
|
849 |
* @return javax.swing.JScrollPane
|
850 |
*/
|
851 |
public JScrollPane getJScrollThesaurus() { |
852 |
if (jScrollThesaurus == null) { |
853 |
jScrollThesaurus = new JScrollPane(getThesaurusList()); |
854 |
jScrollThesaurus.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); |
855 |
jScrollThesaurus.setPreferredSize(new java.awt.Dimension(250,120)); |
856 |
} |
857 |
return jScrollThesaurus;
|
858 |
} |
859 |
|
860 |
/**
|
861 |
*
|
862 |
*
|
863 |
*
|
864 |
* @param text The bRXText to set.
|
865 |
*/
|
866 |
public void setBRXText(String text) { |
867 |
BRXText.setText(text); |
868 |
} |
869 |
|
870 |
/**
|
871 |
*
|
872 |
*
|
873 |
*
|
874 |
* @param text The bRYText to set.
|
875 |
*/
|
876 |
public void setBRYText(String text) { |
877 |
BRYText.setText(text); |
878 |
} |
879 |
|
880 |
/**
|
881 |
*
|
882 |
*
|
883 |
*
|
884 |
* @param text The uLXText to set.
|
885 |
*/
|
886 |
public void setULXText(String text) { |
887 |
ULXText.setText(text); |
888 |
} |
889 |
|
890 |
/**
|
891 |
*
|
892 |
*
|
893 |
*
|
894 |
* @param text The uLYText to set.
|
895 |
*/
|
896 |
public void setULYText(String text) { |
897 |
ULYText.setText(text); |
898 |
} |
899 |
|
900 |
/**
|
901 |
* This method disables the components that represent
|
902 |
* the fileds that the protocol used to do the search doesn't
|
903 |
* support
|
904 |
*
|
905 |
*
|
906 |
* @param type Server type: WFS,WFS-G,ADL,IDEC
|
907 |
*/
|
908 |
private void disableComponents(String type) { |
909 |
//System.out.println("TYPE: " + type);
|
910 |
|
911 |
|
912 |
if (type.equals("WFS-G")){ |
913 |
getThesaurusList().setEnabled(false);
|
914 |
/*
|
915 |
getULXText().setEnabled(false);
|
916 |
getULYText().setEnabled(false);
|
917 |
getBRXText().setEnabled(false);
|
918 |
getBRYText().setEnabled(false);
|
919 |
getCoordenadasCombo().setEnabled(false);
|
920 |
*/
|
921 |
} |
922 |
|
923 |
if (type.equals("WFS")){ |
924 |
getULXText().setEnabled(false);
|
925 |
getULYText().setEnabled(false);
|
926 |
getBRXText().setEnabled(false);
|
927 |
getBRYText().setEnabled(false);
|
928 |
getCoordenadasCombo().setEnabled(false);
|
929 |
|
930 |
|
931 |
} |
932 |
|
933 |
if (type.equals("ADL")){ |
934 |
getULXText().setEnabled(false);
|
935 |
getULYText().setEnabled(false);
|
936 |
getBRXText().setEnabled(false);
|
937 |
getBRYText().setEnabled(false);
|
938 |
getCoordenadasCombo().setEnabled(false);
|
939 |
} |
940 |
|
941 |
if (type.equals("IDEC")){ |
942 |
getThesaurusList().setEnabled(false);
|
943 |
getULXText().setEnabled(false);
|
944 |
getULYText().setEnabled(false);
|
945 |
getBRXText().setEnabled(false);
|
946 |
getBRYText().setEnabled(false);
|
947 |
getCoordenadasCombo().setEnabled(false);
|
948 |
} |
949 |
|
950 |
} |
951 |
|
952 |
/**
|
953 |
* This method initializes jCheckBox
|
954 |
*
|
955 |
*
|
956 |
* @return javax.swing.JCheckBox
|
957 |
*/
|
958 |
private JCheckBox getCheckBGoTo() { |
959 |
if (checkBGoTo == null) { |
960 |
checkBGoTo = new JCheckBox(); |
961 |
checkBGoTo.setText(Translator.getText(translator,"goto"));
|
962 |
} |
963 |
return checkBGoTo;
|
964 |
} |
965 |
|
966 |
/**
|
967 |
* This method initializes jCheckBox
|
968 |
*
|
969 |
*
|
970 |
* @return javax.swing.JCheckBox
|
971 |
*/
|
972 |
private JCheckBox getCheckBKeepOld() { |
973 |
if (checkBKeepOld == null) { |
974 |
checkBKeepOld = new JCheckBox(); |
975 |
checkBKeepOld.setText(Translator.getText(translator,"mantainold"));
|
976 |
} |
977 |
return checkBKeepOld;
|
978 |
} |
979 |
|
980 |
/**
|
981 |
* This method initializes jPanel1
|
982 |
*
|
983 |
*
|
984 |
* @return javax.swing.JPanel
|
985 |
*/
|
986 |
private JPanel getJPanel1() { |
987 |
if (jPanel1 == null) { |
988 |
jPanel1 = new JPanel(); |
989 |
jPanel1.setPreferredSize(new java.awt.Dimension(10,300)); |
990 |
} |
991 |
return jPanel1;
|
992 |
} |
993 |
|
994 |
/**
|
995 |
* This method initializes jPanel2
|
996 |
*
|
997 |
*
|
998 |
* @return javax.swing.JPanel
|
999 |
*/
|
1000 |
private JPanel getPanelShowOptionsPosition() { |
1001 |
if (panelShowOptionsPosition == null) { |
1002 |
panelShowOptionsPosition = new JPanel(); |
1003 |
panelShowOptionsPosition.setLayout(new BoxLayout(panelShowOptionsPosition, BoxLayout.Y_AXIS)); |
1004 |
panelShowOptionsPosition.add(getCheckBGoTo(), null);
|
1005 |
panelShowOptionsPosition.add(getCheckBKeepOld(), null);
|
1006 |
} |
1007 |
return panelShowOptionsPosition;
|
1008 |
} |
1009 |
|
1010 |
/**
|
1011 |
* It returns if the GOTO component is clicked
|
1012 |
*
|
1013 |
*
|
1014 |
* @return
|
1015 |
*/
|
1016 |
public boolean isGoToClicked() { |
1017 |
return getCheckBGoTo().isSelected();
|
1018 |
} |
1019 |
|
1020 |
/**
|
1021 |
* return if the Mantain Old button is enabled
|
1022 |
*
|
1023 |
*
|
1024 |
* @return
|
1025 |
*/
|
1026 |
public boolean isKeepOldClicked() { |
1027 |
return getCheckBKeepOld().isSelected();
|
1028 |
} |
1029 |
} |
1030 |
// @jve:decl-index=0:visual-constraint="10,10"
|