Revision 46062 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/searchpanel/DefaultSearchPanelView2.java
DefaultSearchPanelView2.java | ||
---|---|---|
7 | 7 |
import java.awt.ComponentOrientation; |
8 | 8 |
import java.awt.Container; |
9 | 9 |
import java.awt.Dimension; |
10 |
import java.awt.event.WindowAdapter; |
|
11 |
import java.awt.event.WindowEvent; |
|
10 | 12 |
import javax.swing.Box; |
11 | 13 |
import javax.swing.ImageIcon; |
12 | 14 |
import javax.swing.JButton; |
... | ... | |
14 | 16 |
import javax.swing.JFrame; |
15 | 17 |
import javax.swing.JLabel; |
16 | 18 |
import javax.swing.JPanel; |
19 |
import javax.swing.JProgressBar; |
|
17 | 20 |
import javax.swing.JScrollPane; |
18 | 21 |
import javax.swing.JTabbedPane; |
19 | 22 |
import javax.swing.JTable; |
... | ... | |
55 | 58 |
JButton btnAdvancedExpressionHistory = new JButton(); |
56 | 59 |
JButton btnAdvancedExpressionBookmarks = new JButton(); |
57 | 60 |
JTextArea txtAdvancedExpression = new JTextArea(); |
61 |
JTabbedPane tabResults = new JTabbedPane(); |
|
62 |
JTable tblResults = new JTable(); |
|
63 |
JTable tblSearchPostProcessResults = new JTable(); |
|
58 | 64 |
JButton btnClear = new JButton(); |
59 | 65 |
JButton btnSearch = new JButton(); |
60 | 66 |
JButton btnSearchPostProcess = new JButton(); |
67 |
JButton btnHistory = new JButton(); |
|
68 |
JButton btnBookmarks = new JButton(); |
|
69 |
JPanel pnlCfgActions = new JPanel(); |
|
70 |
JProgressBar pgbStatus = new JProgressBar(); |
|
71 |
JLabel lblStatusTitle = new JLabel(); |
|
61 | 72 |
JLabel lblMsg = new JLabel(); |
62 | 73 |
JPanel pnlActions = new JPanel(); |
63 |
JPanel pnlCfgActions = new JPanel(); |
|
64 |
JButton btnHistory = new JButton(); |
|
65 |
JButton btnBookmarks = new JButton(); |
|
66 |
JTabbedPane tabResults = new JTabbedPane(); |
|
67 |
JPanel grdView1 = new JPanel(); |
|
68 |
JTable tblResults = new JTable(); |
|
69 |
JPanel grdView2 = new JPanel(); |
|
70 |
JTable tblSearchPostProcessResults = new JTable(); |
|
71 | 74 |
|
72 | 75 |
/** |
73 | 76 |
* Default constructor |
... | ... | |
78 | 81 |
} |
79 | 82 |
|
80 | 83 |
/** |
84 |
* Main method for panel |
|
85 |
*/ |
|
86 |
public static void main(String[] args) |
|
87 |
{ |
|
88 |
JFrame frame = new JFrame(); |
|
89 |
frame.setSize(600, 400); |
|
90 |
frame.setLocation(100, 100); |
|
91 |
frame.getContentPane().add(new DefaultSearchPanelView2()); |
|
92 |
frame.setVisible(true); |
|
93 |
|
|
94 |
frame.addWindowListener( new WindowAdapter() |
|
95 |
{ |
|
96 |
public void windowClosing( WindowEvent evt ) |
|
97 |
{ |
|
98 |
System.exit(0); |
|
99 |
} |
|
100 |
}); |
|
101 |
} |
|
102 |
|
|
103 |
/** |
|
81 | 104 |
* Adds fill components to empty cells in the first row and first column of the grid. |
82 | 105 |
* This ensures that the grid spacing will be the same as shown in the designer. |
83 | 106 |
* @param cols an array of column indices in the first row where fill components should be added. |
... | ... | |
159 | 182 |
public JPanel createPanel() |
160 | 183 |
{ |
161 | 184 |
JPanel jpanel1 = new JPanel(); |
162 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
|
|
185 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:PREF:GROW(1.0),FILL:4DLU:NONE","CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
|
|
163 | 186 |
CellConstraints cc = new CellConstraints(); |
164 | 187 |
jpanel1.setLayout(formlayout1); |
165 | 188 |
|
... | ... | |
169 | 192 |
tabSearchMode.setTabPlacement(JTabbedPane.BOTTOM); |
170 | 193 |
tabSearchMode.addTab("_Simplified",null,createPanel1()); |
171 | 194 |
tabSearchMode.addTab("_Advanced",null,createPanel3()); |
172 |
jpanel1.add(tabSearchMode,cc.xy(2,3));
|
|
195 |
jpanel1.add(tabSearchMode,new CellConstraints(2,3,1,1,CellConstraints.FILL,CellConstraints.DEFAULT));
|
|
173 | 196 |
|
174 |
jpanel1.add(createPanel4(),new CellConstraints(2,4,1,1,CellConstraints.RIGHT,CellConstraints.DEFAULT)); |
|
175 |
jpanel1.add(createPanel5(),cc.xy(2,8)); |
|
176 |
jpanel1.add(createPanel6(),cc.xy(2,2)); |
|
177 | 197 |
tabResults.setName("tabResults"); |
178 |
tabResults.addTab("_normalResults",null,creategrdView1());
|
|
179 |
tabResults.addTab("_searchPostProcessResults",null,creategrdView2());
|
|
180 |
jpanel1.add(tabResults,new CellConstraints(2,6,1,1,CellConstraints.DEFAULT,CellConstraints.FILL));
|
|
198 |
tabResults.addTab("_normalResults",null,createPanel4());
|
|
199 |
tabResults.addTab("_searchPostProcessResults",null,createPanel5());
|
|
200 |
jpanel1.add(tabResults,new CellConstraints(2,6,1,1,CellConstraints.FILL,CellConstraints.FILL));
|
|
181 | 201 |
|
202 |
jpanel1.add(createPanel6(),new CellConstraints(2,4,1,1,CellConstraints.RIGHT,CellConstraints.DEFAULT)); |
|
203 |
jpanel1.add(createPanel7(),new CellConstraints(2,2,1,1,CellConstraints.RIGHT,CellConstraints.DEFAULT)); |
|
204 |
jpanel1.add(createPanel8(),cc.xy(2,8)); |
|
182 | 205 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5,6,7,8,9 }); |
183 | 206 |
return jpanel1; |
184 | 207 |
} |
... | ... | |
186 | 209 |
public JPanel createPanel1() |
187 | 210 |
{ |
188 | 211 |
JPanel jpanel1 = new JPanel(); |
189 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
|
|
212 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:MAX(120PX;DEFAULT):NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE"); |
|
190 | 213 |
CellConstraints cc = new CellConstraints(); |
191 | 214 |
jpanel1.setLayout(formlayout1); |
192 | 215 |
|
... | ... | |
294 | 317 |
jpanel1.add(lblNull4,cc.xy(21,4)); |
295 | 318 |
|
296 | 319 |
jpanel1.add(createPanel2(),cc.xywh(2,8,20,1)); |
297 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 },new int[]{ 1,2,3,4,5,6,7,8,9 });
|
|
320 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 },new int[]{ 1,2,3,4,5,6,7,8 }); |
|
298 | 321 |
return jpanel1; |
299 | 322 |
} |
300 | 323 |
|
... | ... | |
376 | 399 |
public JPanel createPanel4() |
377 | 400 |
{ |
378 | 401 |
JPanel jpanel1 = new JPanel(); |
379 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:6PX:NONE","CENTER:DEFAULT:NONE");
|
|
402 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE");
|
|
380 | 403 |
CellConstraints cc = new CellConstraints(); |
381 | 404 |
jpanel1.setLayout(formlayout1); |
382 | 405 |
|
406 |
tblResults.setName("tblResults"); |
|
407 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
408 |
jscrollpane1.setViewportView(tblResults); |
|
409 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
410 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
411 |
jpanel1.add(jscrollpane1,cc.xy(2,2)); |
|
412 |
|
|
413 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
414 |
return jpanel1; |
|
415 |
} |
|
416 |
|
|
417 |
public JPanel createPanel5() |
|
418 |
{ |
|
419 |
JPanel jpanel1 = new JPanel(); |
|
420 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:4DLU:GROW(1.0),CENTER:2DLU:NONE"); |
|
421 |
CellConstraints cc = new CellConstraints(); |
|
422 |
jpanel1.setLayout(formlayout1); |
|
423 |
|
|
424 |
tblSearchPostProcessResults.setName("tblSearchPostProcessResults"); |
|
425 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
426 |
jscrollpane1.setViewportView(tblSearchPostProcessResults); |
|
427 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
428 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
429 |
jpanel1.add(jscrollpane1,cc.xy(2,2)); |
|
430 |
|
|
431 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
432 |
return jpanel1; |
|
433 |
} |
|
434 |
|
|
435 |
public JPanel createPanel6() |
|
436 |
{ |
|
437 |
JPanel jpanel1 = new JPanel(); |
|
438 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:10PX:NONE","CENTER:DEFAULT:NONE"); |
|
439 |
CellConstraints cc = new CellConstraints(); |
|
440 |
jpanel1.setLayout(formlayout1); |
|
441 |
|
|
383 | 442 |
btnClear.setActionCommand("Limpiar"); |
384 | 443 |
btnClear.setName("btnClear"); |
385 | 444 |
btnClear.setText("_Clear"); |
... | ... | |
399 | 458 |
return jpanel1; |
400 | 459 |
} |
401 | 460 |
|
402 |
public JPanel createPanel5()
|
|
461 |
public JPanel createPanel7()
|
|
403 | 462 |
{ |
404 | 463 |
JPanel jpanel1 = new JPanel(); |
405 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
|
|
464 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:3PX:NONE,FILL:DEFAULT:NONE,FILL:3PX:NONE,FILL:DEFAULT:NONE,FILL:3PX:NONE,FILL:DEFAULT:NONE,FILL:10PX:NONE","CENTER:DEFAULT:NONE");
|
|
406 | 465 |
CellConstraints cc = new CellConstraints(); |
407 | 466 |
jpanel1.setLayout(formlayout1); |
408 | 467 |
|
409 |
lblMsg.setName("lblMsg"); |
|
410 |
jpanel1.add(lblMsg,cc.xy(1,1)); |
|
411 |
|
|
412 |
pnlActions.setName("pnlActions"); |
|
413 |
jpanel1.add(pnlActions,cc.xy(3,1)); |
|
414 |
|
|
415 |
addFillComponents(jpanel1,new int[]{ 2 },new int[0]); |
|
416 |
return jpanel1; |
|
417 |
} |
|
418 |
|
|
419 |
public JPanel createPanel6() |
|
420 |
{ |
|
421 |
JPanel jpanel1 = new JPanel(); |
|
422 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:3PX:NONE,FILL:DEFAULT:NONE,FILL:3PX:NONE,FILL:DEFAULT:NONE,FILL:3PX:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
|
423 |
CellConstraints cc = new CellConstraints(); |
|
424 |
jpanel1.setLayout(formlayout1); |
|
425 |
|
|
426 |
pnlCfgActions.setName("pnlCfgActions"); |
|
427 |
pnlCfgActions.setOpaque(false); |
|
428 |
jpanel1.add(pnlCfgActions,cc.xy(7,1)); |
|
429 |
|
|
430 | 468 |
btnHistory.setActionCommand("..."); |
431 | 469 |
btnHistory.setName("btnHistory"); |
432 | 470 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
... | ... | |
439 | 477 |
btnBookmarks.setBorder(emptyborder2); |
440 | 478 |
jpanel1.add(btnBookmarks,cc.xy(5,1)); |
441 | 479 |
|
442 |
addFillComponents(jpanel1,new int[]{ 1,2,4,6 },new int[]{ 1 }); |
|
480 |
pnlCfgActions.setName("pnlCfgActions"); |
|
481 |
pnlCfgActions.setOpaque(false); |
|
482 |
jpanel1.add(pnlCfgActions,cc.xy(7,1)); |
|
483 |
|
|
484 |
addFillComponents(jpanel1,new int[]{ 1,2,4,6,8 },new int[]{ 1 }); |
|
443 | 485 |
return jpanel1; |
444 | 486 |
} |
445 | 487 |
|
446 |
public JPanel creategrdView1()
|
|
488 |
public JPanel createPanel8()
|
|
447 | 489 |
{ |
448 |
grdView1.setName("grdView1");
|
|
449 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE");
|
|
490 |
JPanel jpanel1 = new JPanel();
|
|
491 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:6PX:NONE,FILL:DEFAULT:NONE,FILL:6PX:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
|
|
450 | 492 |
CellConstraints cc = new CellConstraints(); |
451 |
grdView1.setLayout(formlayout1);
|
|
493 |
jpanel1.setLayout(formlayout1);
|
|
452 | 494 |
|
453 |
tblResults.setName("tblResults"); |
|
454 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
455 |
jscrollpane1.setViewportView(tblResults); |
|
456 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
457 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
458 |
grdView1.add(jscrollpane1,cc.xy(2,2)); |
|
495 |
pgbStatus.setName("pgbStatus"); |
|
496 |
jpanel1.add(pgbStatus,cc.xy(1,1)); |
|
459 | 497 |
|
460 |
addFillComponents(grdView1,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
461 |
return grdView1; |
|
462 |
} |
|
498 |
lblStatusTitle.setName("lblStatusTitle"); |
|
499 |
jpanel1.add(lblStatusTitle,cc.xy(3,1)); |
|
463 | 500 |
|
464 |
public JPanel creategrdView2() |
|
465 |
{ |
|
466 |
grdView2.setName("grdView2"); |
|
467 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:4DLU:GROW(1.0),CENTER:2DLU:NONE"); |
|
468 |
CellConstraints cc = new CellConstraints(); |
|
469 |
grdView2.setLayout(formlayout1); |
|
501 |
lblMsg.setName("lblMsg"); |
|
502 |
jpanel1.add(lblMsg,cc.xy(5,1)); |
|
470 | 503 |
|
471 |
tblSearchPostProcessResults.setName("tblSearchPostProcessResults"); |
|
472 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
473 |
jscrollpane1.setViewportView(tblSearchPostProcessResults); |
|
474 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
475 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
476 |
grdView2.add(jscrollpane1,cc.xy(2,2)); |
|
504 |
pnlActions.setName("pnlActions"); |
|
505 |
jpanel1.add(pnlActions,cc.xy(6,1)); |
|
477 | 506 |
|
478 |
addFillComponents(grdView2,new int[]{ 1,2,3 },new int[]{ 1,2,3 });
|
|
479 |
return grdView2;
|
|
507 |
addFillComponents(jpanel1,new int[]{ 2,4 },new int[0]);
|
|
508 |
return jpanel1;
|
|
480 | 509 |
} |
481 | 510 |
|
482 | 511 |
/** |
Also available in: Unified diff