Revision 44707 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/DefaultSearchPanelView.java

View differences:

DefaultSearchPanelView.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;
12 10
import javax.swing.Box;
13 11
import javax.swing.ImageIcon;
14 12
import javax.swing.JButton;
......
19 17
import javax.swing.JScrollPane;
20 18
import javax.swing.JTabbedPane;
21 19
import javax.swing.JTable;
22
import javax.swing.JTextField;
20
import javax.swing.JTextArea;
23 21
import javax.swing.border.EmptyBorder;
24 22

  
25 23

  
......
45 43
   JLabel lblExtraFields2 = new JLabel();
46 44
   JLabel lblExtraFields3 = new JLabel();
47 45
   JLabel lblExtraFields4 = new JLabel();
48
   JTextField txtAdvancedExpression = new JTextField();
46
   JButton btnRemoveAccumulatedFilter = new JButton();
47
   JButton btnAddAccumulatedFilter = new JButton();
48
   JButton btnViewAccumulatedFilter = new JButton();
49 49
   JLabel lblExpressionDeBusqueda = new JLabel();
50 50
   JButton btnAdvancedExpression = new JButton();
51 51
   JButton btnAdvancedExpressionHistory = new JButton();
52 52
   JButton btnAdvancedExpressionBookmarks = new JButton();
53
   JTextArea txtAdvancedExpression = new JTextArea();
53 54
   JTable tblResults = new JTable();
54 55
   JButton btnSearch = new JButton();
55 56
   JButton btnClear = new JButton();
......
66 67
   }
67 68

  
68 69
   /**
69
    * Main method for panel
70
    */
71
   public static void main(String[] args)
72
   {
73
      JFrame frame = new JFrame();
74
      frame.setSize(600, 400);
75
      frame.setLocation(100, 100);
76
      frame.getContentPane().add(new DefaultSearchPanelView());
77
      frame.setVisible(true);
78

  
79
      frame.addWindowListener( new WindowAdapter()
80
      {
81
         public void windowClosing( WindowEvent evt )
82
         {
83
            System.exit(0);
84
         }
85
      });
86
   }
87

  
88
   /**
89 70
    * Adds fill components to empty cells in the first row and first column of the grid.
90 71
    * This ensures that the grid spacing will be the same as shown in the designer.
91 72
    * @param cols an array of column indices in the first row where fill components should be added.
......
176 157
      tabSearchMode.setBorder(emptyborder1);
177 158
      tabSearchMode.setTabPlacement(JTabbedPane.BOTTOM);
178 159
      tabSearchMode.addTab("_Simplified",null,createPanel1());
179
      tabSearchMode.addTab("_Advanced",null,createPanel2());
160
      tabSearchMode.addTab("_Advanced",null,createPanel3());
180 161
      jpanel1.add(tabSearchMode,cc.xy(2,3));
181 162

  
182 163
      tblResults.setName("tblResults");
......
186 167
      jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
187 168
      jpanel1.add(jscrollpane1,cc.xy(2,6));
188 169

  
189
      jpanel1.add(createPanel3(),cc.xy(2,4));
190
      jpanel1.add(createPanel4(),cc.xy(2,8));
191
      jpanel1.add(createPanel5(),cc.xy(2,2));
170
      jpanel1.add(createPanel4(),cc.xy(2,4));
171
      jpanel1.add(createPanel5(),cc.xy(2,8));
172
      jpanel1.add(createPanel6(),cc.xy(2,2));
192 173
      addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5,6,7,8,9 });
193 174
      return jpanel1;
194 175
   }
......
196 177
   public JPanel createPanel1()
197 178
   {
198 179
      JPanel jpanel1 = new JPanel();
199
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),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");
180
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:12DLU:GROW(1.0),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");
200 181
      CellConstraints cc = new CellConstraints();
201 182
      jpanel1.setLayout(formlayout1);
202 183

  
......
271 252
      lblField4.setHorizontalAlignment(JLabel.CENTER);
272 253
      jpanel1.add(lblField4,cc.xy(20,2));
273 254

  
274
      lblExtraFields1.setIcon(loadImage("datos/devel/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/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
255
      lblExtraFields1.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
275 256
      lblExtraFields1.setName("lblExtraFields1");
276 257
      jpanel1.add(lblExtraFields1,cc.xy(4,2));
277 258

  
278
      lblExtraFields2.setIcon(loadImage("datos/devel/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/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
259
      lblExtraFields2.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
279 260
      lblExtraFields2.setName("lblExtraFields2");
280 261
      jpanel1.add(lblExtraFields2,cc.xy(10,2));
281 262

  
282
      lblExtraFields3.setIcon(loadImage("datos/devel/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/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
263
      lblExtraFields3.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
283 264
      lblExtraFields3.setName("lblExtraFields3");
284 265
      jpanel1.add(lblExtraFields3,cc.xy(16,2));
285 266

  
286
      lblExtraFields4.setIcon(loadImage("datos/devel/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/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
267
      lblExtraFields4.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/featurestore-column.png"));
287 268
      lblExtraFields4.setName("lblExtraFields4");
288 269
      jpanel1.add(lblExtraFields4,cc.xy(21,2));
289 270

  
290
      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 });
271
      jpanel1.add(createPanel2(),cc.xywh(2,8,20,1));
272
      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 });
291 273
      return jpanel1;
292 274
   }
293 275

  
294 276
   public JPanel createPanel2()
295 277
   {
296 278
      JPanel jpanel1 = new JPanel();
297
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
279
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
298 280
      CellConstraints cc = new CellConstraints();
299 281
      jpanel1.setLayout(formlayout1);
300 282

  
301
      txtAdvancedExpression.setName("txtAdvancedExpression");
302
      jpanel1.add(txtAdvancedExpression,cc.xy(2,4));
283
      btnRemoveAccumulatedFilter.setActionCommand("...");
284
      btnRemoveAccumulatedFilter.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/search-simplifiedcondition-clear-accumulate.png"));
285
      btnRemoveAccumulatedFilter.setName("btnRemoveAccumulatedFilter");
286
      btnRemoveAccumulatedFilter.setToolTipText("_Remove_accumulated_filter");
287
      EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2);
288
      btnRemoveAccumulatedFilter.setBorder(emptyborder1);
289
      jpanel1.add(btnRemoveAccumulatedFilter,cc.xy(3,1));
303 290

  
291
      btnAddAccumulatedFilter.setActionCommand("...");
292
      btnAddAccumulatedFilter.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/search-simplifiedcondition-add-accumulate.png"));
293
      btnAddAccumulatedFilter.setName("btnAddAccumulatedFilter");
294
      btnAddAccumulatedFilter.setToolTipText("_Accumulate_filter");
295
      EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2);
296
      btnAddAccumulatedFilter.setBorder(emptyborder2);
297
      jpanel1.add(btnAddAccumulatedFilter,cc.xy(7,1));
298

  
299
      btnViewAccumulatedFilter.setActionCommand("...");
300
      btnViewAccumulatedFilter.setIcon(loadImage("src/main/resources/org/gvsig/fmap/dal/swing/impl/searchpanel/search-simplifiedcondition-edit-accumulate.png"));
301
      btnViewAccumulatedFilter.setName("btnViewAccumulatedFilter");
302
      btnViewAccumulatedFilter.setToolTipText("_View_accumulated_filter");
303
      EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2);
304
      btnViewAccumulatedFilter.setBorder(emptyborder3);
305
      jpanel1.add(btnViewAccumulatedFilter,cc.xy(5,1));
306

  
307
      addFillComponents(jpanel1,new int[]{ 1,2,4,6 },new int[]{ 1 });
308
      return jpanel1;
309
   }
310

  
311
   public JPanel createPanel3()
312
   {
313
      JPanel jpanel1 = new JPanel();
314
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE");
315
      CellConstraints cc = new CellConstraints();
316
      jpanel1.setLayout(formlayout1);
317

  
304 318
      lblExpressionDeBusqueda.setName("lblExpressionDeBusqueda");
305 319
      lblExpressionDeBusqueda.setText("_Insert_a_search_expression");
306 320
      jpanel1.add(lblExpressionDeBusqueda,cc.xy(2,2));
......
309 323
      btnAdvancedExpression.setName("btnAdvancedExpression");
310 324
      EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2);
311 325
      btnAdvancedExpression.setBorder(emptyborder1);
312
      jpanel1.add(btnAdvancedExpression,cc.xy(4,4));
326
      jpanel1.add(btnAdvancedExpression,new CellConstraints(4,4,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
313 327

  
314 328
      btnAdvancedExpressionHistory.setActionCommand("...");
315 329
      btnAdvancedExpressionHistory.setName("btnAdvancedExpressionHistory");
316 330
      EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2);
317 331
      btnAdvancedExpressionHistory.setBorder(emptyborder2);
318
      jpanel1.add(btnAdvancedExpressionHistory,cc.xy(6,4));
332
      jpanel1.add(btnAdvancedExpressionHistory,new CellConstraints(6,4,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
319 333

  
320 334
      btnAdvancedExpressionBookmarks.setActionCommand("...");
321 335
      btnAdvancedExpressionBookmarks.setName("btnAdvancedExpressionBookmarks");
322 336
      EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2);
323 337
      btnAdvancedExpressionBookmarks.setBorder(emptyborder3);
324
      jpanel1.add(btnAdvancedExpressionBookmarks,cc.xy(8,4));
338
      jpanel1.add(btnAdvancedExpressionBookmarks,new CellConstraints(8,4,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
325 339

  
340
      txtAdvancedExpression.setName("txtAdvancedExpression");
341
      JScrollPane jscrollpane1 = new JScrollPane();
342
      jscrollpane1.setViewportView(txtAdvancedExpression);
343
      jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
344
      jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
345
      jpanel1.add(jscrollpane1,cc.xy(2,4));
346

  
326 347
      addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9 },new int[]{ 1,2,3,4,5 });
327 348
      return jpanel1;
328 349
   }
329 350

  
330
   public JPanel createPanel3()
351
   public JPanel createPanel4()
331 352
   {
332 353
      JPanel jpanel1 = new JPanel();
333 354
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
......
348 369
      return jpanel1;
349 370
   }
350 371

  
351
   public JPanel createPanel4()
372
   public JPanel createPanel5()
352 373
   {
353 374
      JPanel jpanel1 = new JPanel();
354 375
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
......
365 386
      return jpanel1;
366 387
   }
367 388

  
368
   public JPanel createPanel5()
389
   public JPanel createPanel6()
369 390
   {
370 391
      JPanel jpanel1 = new JPanel();
371 392
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");

Also available in: Unified diff