Revision 26601 tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/streetsmap/ui/PanelQuerysBuilder.java
PanelQuerysBuilder.java | ||
---|---|---|
28 | 28 |
import javax.swing.JTextField; |
29 | 29 |
import javax.swing.ListModel; |
30 | 30 |
import javax.swing.SwingConstants; |
31 |
import javax.swing.SwingUtilities; |
|
32 | 31 |
import javax.swing.event.DocumentEvent; |
33 | 32 |
import javax.swing.event.DocumentListener; |
34 | 33 |
import javax.swing.event.ListDataEvent; |
... | ... | |
55 | 54 |
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. |
56 | 55 |
*/ |
57 | 56 |
/** |
58 |
* |
|
57 |
* This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI Builder, which is free for non-commercial use. If Jigloo is being used commercially (ie, by a corporation, company or business for any purpose whatever) then you should purchase a license for each developer using Jigloo. Please visit www.cloudgarden.com for details. Use of Jigloo implies acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. |
|
58 |
* @uml.dependency supplier="es.logex.gvsig.streetsmap.query.QueryResultData" |
|
59 | 59 |
*/ |
60 | 60 |
public class PanelQuerysBuilder extends JPanel { |
61 | 61 |
|
... | ... | |
65 | 65 |
private static final long serialVersionUID = -7321705961922465828L; |
66 | 66 |
|
67 | 67 |
|
68 |
/** |
|
69 |
* @uml.property name="actionZoomToExtent" |
|
70 |
*/ |
|
68 | 71 |
private AbstractAction actionZoomToExtent; |
69 | 72 |
private JPanel jPanel2; |
70 | 73 |
private JLabel lblIconSearch; |
71 | 74 |
private JPanel panelHeader; |
72 | 75 |
private JLabel lblBuscar; |
73 | 76 |
|
77 |
/** |
|
78 |
* @uml.property name="actionSearch" |
|
79 |
*/ |
|
74 | 80 |
private AbstractAction actionSearch; |
75 |
private PanelQuerysActionsDelegate panelQuerysClient = null;
|
|
81 |
private PanelQuerysRequestsHandler panelQuerysRequestsHandler = null;
|
|
76 | 82 |
|
77 | 83 |
|
78 | 84 |
private JList listResultsQuery; |
... | ... | |
97 | 103 |
//frame.getContentPane().add(new NewJPanel()); |
98 | 104 |
// Construir un juego de prueba |
99 | 105 |
frame.getContentPane().add(new PanelQuerysBuilder( |
100 |
new PanelQuerysActionsDelegate()
|
|
106 |
new PanelQuerysRequestsHandler()
|
|
101 | 107 |
{ |
102 | 108 |
|
103 | 109 |
public void DoExtent(QueryResultData newExtent) { |
... | ... | |
139 | 145 |
initGUI(); |
140 | 146 |
} |
141 | 147 |
|
142 |
public PanelQuerysBuilder(PanelQuerysActionsDelegate queryClient) {
|
|
148 |
public PanelQuerysBuilder(PanelQuerysRequestsHandler queryClient) {
|
|
143 | 149 |
this(); |
144 |
panelQuerysClient = queryClient;
|
|
150 |
panelQuerysRequestsHandler = queryClient;
|
|
145 | 151 |
//SwingUtilities.getWindowAncestor(this).pack(); |
146 | 152 |
} |
147 | 153 |
|
... | ... | |
279 | 285 |
} |
280 | 286 |
{ |
281 | 287 |
lblCalleVia = new JLabel(); |
282 |
PanelItemsQuery.add(lblCalleVia, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
|
|
288 |
PanelItemsQuery.add(lblCalleVia, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
|
|
283 | 289 |
lblCalleVia.setText("Calle o Via"); |
284 | 290 |
} |
285 | 291 |
{ |
286 | 292 |
lblNumero = new JLabel(); |
287 |
PanelItemsQuery.add(lblNumero, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
|
|
293 |
PanelItemsQuery.add(lblNumero, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
|
|
288 | 294 |
lblNumero.setText("NÂș"); |
289 | 295 |
} |
290 | 296 |
{ |
291 | 297 |
txtNumeroPol = new JTextField(); |
292 |
PanelItemsQuery.add(txtNumeroPol, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
|
|
298 |
PanelItemsQuery.add(txtNumeroPol, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
|
|
293 | 299 |
txtNumeroPol.setToolTipText("Introduce el numero de patio a localizar"); |
294 | 300 |
} |
295 | 301 |
{ |
... | ... | |
378 | 384 |
this.actionSearch.setEnabled(false); |
379 | 385 |
try |
380 | 386 |
{ |
381 |
List<QueryResultData> queryResults = panelQuerysClient.DoSearch(
|
|
387 |
List<QueryResultData> queryResults = panelQuerysRequestsHandler.DoSearch(
|
|
382 | 388 |
txtMunicipio.getText(), txtCalleVia.getText(), txtNumeroPol |
383 | 389 |
.getText()); |
384 | 390 |
DefaultComboBoxModel listModel = (DefaultComboBoxModel) listResultsQuery |
... | ... | |
403 | 409 |
private AbstractAction getActionSearch() { |
404 | 410 |
if (actionSearch == null) { |
405 | 411 |
actionSearch = new AbstractAction("Buscar", null) { |
406 |
|
|
412 |
|
|
407 | 413 |
private static final long serialVersionUID = 0L; |
408 |
|
|
414 |
|
|
409 | 415 |
public void actionPerformed(ActionEvent evt) { |
410 |
if (panelQuerysClient != null) { |
|
411 |
SwingWorker worker = new SwingWorker() |
|
412 |
{ |
|
413 |
public Object construct() |
|
414 |
{ |
|
416 |
if (panelQuerysRequestsHandler != null) { |
|
417 |
SwingWorker worker = new SwingWorker() { |
|
418 |
public Object construct() { |
|
415 | 419 |
return DoSearch(); |
416 | 420 |
} |
417 | 421 |
}; |
418 | 422 |
worker.start(); |
419 |
}
|
|
423 |
} |
|
420 | 424 |
} |
421 | 425 |
}; |
422 |
|
|
426 |
|
|
423 | 427 |
actionSearch.setEnabled(false); |
424 | 428 |
} |
425 | 429 |
return actionSearch; |
... | ... | |
433 | 437 |
{ |
434 | 438 |
ListModel listModel = listResultsQuery.getModel(); |
435 | 439 |
ResultsItem resItem = (ResultsItem) listModel.getElementAt(listResultsQuery.getSelectedIndex()); |
436 |
panelQuerysClient.DoExtent(resItem.resultsData);
|
|
440 |
panelQuerysRequestsHandler.DoExtent(resItem.resultsData);
|
|
437 | 441 |
return "Zoom Done"; |
438 | 442 |
} |
439 | 443 |
finally |
... | ... | |
450 | 454 |
private AbstractAction getActionZoomToExtent() { |
451 | 455 |
if (actionZoomToExtent == null) { |
452 | 456 |
actionZoomToExtent = new AbstractAction("Encuadrar", null) { |
453 |
|
|
457 |
|
|
454 | 458 |
/** |
455 | 459 |
* |
456 | 460 |
*/ |
457 | 461 |
private static final long serialVersionUID = -6096784899381443861L; |
458 |
|
|
462 |
|
|
459 | 463 |
/* (non-Javadoc) |
460 | 464 |
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) |
461 | 465 |
*/ |
462 | 466 |
public void actionPerformed(ActionEvent e) { |
463 |
if (panelQuerysClient != null) { |
|
464 |
if (panelQuerysClient != null) { |
|
465 |
SwingWorker worker = new SwingWorker() |
|
466 |
{ |
|
467 |
public Object construct() |
|
468 |
{ |
|
467 |
if (panelQuerysRequestsHandler != null) { |
|
468 |
if (panelQuerysRequestsHandler != null) { |
|
469 |
SwingWorker worker = new SwingWorker() { |
|
470 |
public Object construct() { |
|
469 | 471 |
return DoZoomToExtent(); |
470 | 472 |
} |
471 | 473 |
}; |
472 | 474 |
worker.start(); |
473 |
}
|
|
475 |
} |
|
474 | 476 |
} |
475 |
|
|
476 |
|
|
477 |
|
|
477 | 478 |
} |
478 | 479 |
}; |
479 | 480 |
actionZoomToExtent.setEnabled(false); |
480 | 481 |
} |
481 |
|
|
482 |
|
|
482 | 483 |
return actionZoomToExtent; |
483 | 484 |
} |
484 | 485 |
|
... | ... | |
575 | 576 |
* |
576 | 577 |
*/ |
577 | 578 |
/** |
578 |
* @author jcelda |
|
579 |
* @author jcelda |
|
580 |
* @uml.dependency supplier="es.logex.gvsig.streetsmap.query.QueryResultData" |
|
579 | 581 |
*/ |
580 | 582 |
class ResultsItem { |
581 | 583 |
private QueryResultData resultsData = null; |
Also available in: Unified diff