Revision 43983 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultJExpressionBuilderView.java

View differences:

DefaultJExpressionBuilderView.java
11 11
import javax.swing.Box;
12 12
import javax.swing.ImageIcon;
13 13
import javax.swing.JButton;
14
import javax.swing.JComboBox;
14 15
import javax.swing.JEditorPane;
15 16
import javax.swing.JFrame;
17
import javax.swing.JLabel;
16 18
import javax.swing.JList;
17 19
import javax.swing.JPanel;
18 20
import javax.swing.JScrollPane;
......
41 43
   JTextField txtGroupElement = new JTextField();
42 44
   JButton btnGroupElementInsert = new JButton();
43 45
   JButton btnSimpleElementInsert = new JButton();
46
   JButton btnSimpleElementSortDown = new JButton();
44 47
   JButton btnSimpleElementSortUp = new JButton();
45
   JButton btnSimpleElementSortDown = new JButton();
48
   JLabel lblSimpleElementsMsg = new JLabel();
46 49
   JTextField txtSimpleElementFilter = new JTextField();
47 50
   JButton btnSimpleElementFilter = new JButton();
51
   JPanel pnlScriptEditorContainer = new JPanel();
52
   JComboBox cboPickerScripts = new JComboBox();
53
   JButton btnPickerRemove = new JButton();
54
   JButton btnPickerSelectScript = new JButton();
48 55

  
49 56
   /**
50 57
    * Default constructor
......
152 159
   public JPanel createPanel1()
153 160
   {
154 161
      JPanel jpanel1 = new JPanel();
155
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE");
162
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:80DLU:NONE,FILL:4DLU:NONE,FILL:100DLU:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(0.3),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE");
156 163
      CellConstraints cc = new CellConstraints();
157 164
      jpanel1.setLayout(formlayout1);
158 165

  
......
171 178
      jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
172 179
      jpanel1.add(jscrollpane2,cc.xywh(2,4,1,6));
173 180

  
181
      txtDescription.setEditable(false);
174 182
      txtDescription.setName("txtDescription");
175 183
      JScrollPane jscrollpane3 = new JScrollPane();
176 184
      jscrollpane3.setViewportView(txtDescription);
......
188 196
   public JPanel createPanel2()
189 197
   {
190 198
      JPanel jpanel1 = new JPanel();
191
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","FILL:DEFAULT:GROW(1.0)");
199
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE","FILL:DEFAULT:GROW(1.0)");
192 200
      CellConstraints cc = new CellConstraints();
193 201
      jpanel1.setLayout(formlayout1);
194 202

  
......
207 215
   public JPanel createPanel3()
208 216
   {
209 217
      JPanel jpanel1 = new JPanel();
210
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE");
218
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE");
211 219
      CellConstraints cc = new CellConstraints();
212 220
      jpanel1.setLayout(formlayout1);
213 221

  
......
223 231
      btnAdd.setText("+");
224 232
      EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2);
225 233
      btnAdd.setBorder(emptyborder2);
226
      jpanel1.add(btnAdd,cc.xy(1,2));
234
      jpanel1.add(btnAdd,cc.xy(1,3));
227 235

  
228 236
      btnSubst.setActionCommand("+");
229 237
      btnSubst.setName("btnSubst");
230 238
      btnSubst.setText("-");
231 239
      EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2);
232 240
      btnSubst.setBorder(emptyborder3);
233
      jpanel1.add(btnSubst,cc.xy(2,2));
241
      jpanel1.add(btnSubst,cc.xy(3,3));
234 242

  
235 243
      btnMult.setActionCommand("+");
236 244
      btnMult.setName("btnMult");
237 245
      btnMult.setText("*");
238 246
      EmptyBorder emptyborder4 = new EmptyBorder(2,2,2,2);
239 247
      btnMult.setBorder(emptyborder4);
240
      jpanel1.add(btnMult,cc.xy(1,3));
248
      jpanel1.add(btnMult,cc.xy(1,5));
241 249

  
242 250
      btnDiv.setActionCommand("+");
243 251
      btnDiv.setName("btnDiv");
244 252
      btnDiv.setText("/");
245 253
      EmptyBorder emptyborder5 = new EmptyBorder(2,2,2,2);
246 254
      btnDiv.setBorder(emptyborder5);
247
      jpanel1.add(btnDiv,cc.xy(2,3));
255
      jpanel1.add(btnDiv,cc.xy(3,5));
248 256

  
249 257
      btnParentOpen.setActionCommand("+");
250 258
      btnParentOpen.setName("btnParentOpen");
251 259
      btnParentOpen.setText("(");
252 260
      EmptyBorder emptyborder6 = new EmptyBorder(2,2,2,2);
253 261
      btnParentOpen.setBorder(emptyborder6);
254
      jpanel1.add(btnParentOpen,cc.xy(1,4));
262
      jpanel1.add(btnParentOpen,cc.xy(1,7));
255 263

  
256 264
      btnParentClose.setActionCommand("+");
257 265
      btnParentClose.setName("btnParentClose");
258 266
      btnParentClose.setText(")");
259 267
      EmptyBorder emptyborder7 = new EmptyBorder(2,2,2,2);
260 268
      btnParentClose.setBorder(emptyborder7);
261
      jpanel1.add(btnParentClose,cc.xy(2,4));
269
      jpanel1.add(btnParentClose,cc.xy(3,7));
262 270

  
263 271
      btnNeq.setActionCommand("+");
264 272
      btnNeq.setName("btnNeq");
265 273
      btnNeq.setText("<>");
266 274
      EmptyBorder emptyborder8 = new EmptyBorder(2,2,2,2);
267 275
      btnNeq.setBorder(emptyborder8);
268
      jpanel1.add(btnNeq,cc.xy(2,1));
276
      jpanel1.add(btnNeq,cc.xy(3,1));
269 277

  
270
      addFillComponents(jpanel1,new int[0],new int[0]);
278
      addFillComponents(jpanel1,new int[]{ 2 },new int[]{ 2,4,6 });
271 279
      return jpanel1;
272 280
   }
273 281

  
......
284 292
      jpanel1.add(txtGroupElement,cc.xy(1,1));
285 293

  
286 294
      btnGroupElementInsert.setActionCommand("+");
287
      btnGroupElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expresionbuilder-insert-text.png"));
295
      btnGroupElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-insert-text.png"));
288 296
      btnGroupElementInsert.setName("btnGroupElementInsert");
289 297
      EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2);
290 298
      btnGroupElementInsert.setBorder(emptyborder1);
......
302 310
      jpanel1.setLayout(formlayout1);
303 311

  
304 312
      btnSimpleElementInsert.setActionCommand("+");
305
      btnSimpleElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expresionbuilder-insert-text.png"));
313
      btnSimpleElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-insert-text.png"));
306 314
      btnSimpleElementInsert.setName("btnSimpleElementInsert");
307 315
      EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2);
308 316
      btnSimpleElementInsert.setBorder(emptyborder1);
309 317
      jpanel1.add(btnSimpleElementInsert,cc.xy(6,1));
310 318

  
319
      btnSimpleElementSortDown.setActionCommand("+");
320
      btnSimpleElementSortDown.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortdown.png"));
321
      btnSimpleElementSortDown.setName("btnSimpleElementSortDown");
322
      EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2);
323
      btnSimpleElementSortDown.setBorder(emptyborder2);
324
      jpanel1.add(btnSimpleElementSortDown,cc.xy(4,1));
325

  
311 326
      btnSimpleElementSortUp.setActionCommand("+");
312 327
      btnSimpleElementSortUp.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortup.png"));
313 328
      btnSimpleElementSortUp.setName("btnSimpleElementSortUp");
314
      EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2);
315
      btnSimpleElementSortUp.setBorder(emptyborder2);
316
      jpanel1.add(btnSimpleElementSortUp,cc.xy(4,1));
317

  
318
      btnSimpleElementSortDown.setActionCommand("+");
319
      btnSimpleElementSortDown.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortdown.png"));
320
      btnSimpleElementSortDown.setName("btnSimpleElementSortDown");
321 329
      EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2);
322
      btnSimpleElementSortDown.setBorder(emptyborder3);
323
      jpanel1.add(btnSimpleElementSortDown,cc.xy(2,1));
330
      btnSimpleElementSortUp.setBorder(emptyborder3);
331
      jpanel1.add(btnSimpleElementSortUp,cc.xy(2,1));
324 332

  
325
      addFillComponents(jpanel1,new int[]{ 1,3,5 },new int[]{ 1 });
333
      lblSimpleElementsMsg.setName("lblSimpleElementsMsg");
334
      jpanel1.add(lblSimpleElementsMsg,cc.xy(1,1));
335

  
336
      addFillComponents(jpanel1,new int[]{ 3,5 },new int[0]);
326 337
      return jpanel1;
327 338
   }
328 339

  
......
350 361
   public JPanel createPanel7()
351 362
   {
352 363
      JPanel jpanel1 = new JPanel();
353
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE");
364
      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,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
354 365
      CellConstraints cc = new CellConstraints();
355 366
      jpanel1.setLayout(formlayout1);
356 367

  
357
      addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 });
368
      pnlScriptEditorContainer.setName("pnlScriptEditorContainer");
369
      jpanel1.add(pnlScriptEditorContainer,cc.xy(2,2));
370

  
371
      jpanel1.add(createPanel8(),cc.xy(2,4));
372
      addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5 });
358 373
      return jpanel1;
359 374
   }
360 375

  
376
   public JPanel createPanel8()
377
   {
378
      JPanel jpanel1 = new JPanel();
379
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
380
      CellConstraints cc = new CellConstraints();
381
      jpanel1.setLayout(formlayout1);
382

  
383
      cboPickerScripts.setName("cboPickerScripts");
384
      jpanel1.add(cboPickerScripts,cc.xy(1,1));
385

  
386
      btnPickerRemove.setActionCommand("+");
387
      btnPickerRemove.setName("btnPickerRemove");
388
      btnPickerRemove.setText("R");
389
      EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2);
390
      btnPickerRemove.setBorder(emptyborder1);
391
      jpanel1.add(btnPickerRemove,cc.xy(3,1));
392

  
393
      btnPickerSelectScript.setActionCommand("+");
394
      btnPickerSelectScript.setName("btnPickerSelectScript");
395
      btnPickerSelectScript.setText("S");
396
      EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2);
397
      btnPickerSelectScript.setBorder(emptyborder2);
398
      jpanel1.add(btnPickerSelectScript,cc.xy(5,1));
399

  
400
      addFillComponents(jpanel1,new int[]{ 2,4 },new int[0]);
401
      return jpanel1;
402
   }
403

  
361 404
   /**
362 405
    * Initializer
363 406
    */

Also available in: Unified diff