Revision 1846 org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.swing/org.gvsig.legend.aggregate.swing.impl/src/main/java/org/gvsig/legend/aggregate/swing/impl/DefaultAggregateLegendEditorView.java

View differences:

DefaultAggregateLegendEditorView.java
8 8
import java.awt.ComponentOrientation;
9 9
import java.awt.Container;
10 10
import java.awt.Dimension;
11
import java.awt.Font;
11 12
import javax.swing.Box;
13
import javax.swing.ButtonGroup;
12 14
import javax.swing.ImageIcon;
13 15
import javax.swing.JButton;
16
import javax.swing.JCheckBox;
17
import javax.swing.JComboBox;
14 18
import javax.swing.JFrame;
15 19
import javax.swing.JLabel;
16 20
import javax.swing.JPanel;
21
import javax.swing.JRadioButton;
22
import javax.swing.JSlider;
23
import javax.swing.JSpinner;
17 24
import javax.swing.JTextField;
18 25

  
19 26

  
20 27
public class DefaultAggregateLegendEditorView extends JPanel
21 28
{
22
   JLabel lblDistance = new JLabel();
23
   JTextField txtDistance = new JTextField();
29
   JRadioButton rdbBasic = new JRadioButton();
30
   ButtonGroup buttongroup1 = new ButtonGroup();
31
   JRadioButton rdbStyled = new JRadioButton();
32
   JLabel lblOutlineColor = new JLabel();
33
   JLabel lblFillColor = new JLabel();
34
   JLabel lblTextColor = new JLabel();
35
   JLabel lblTextFont = new JLabel();
36
   JLabel lblShowBounds = new JLabel();
37
   JCheckBox chkShowBounds = new JCheckBox();
38
   JLabel lblSymbolSize = new JLabel();
39
   JTextField txtOutlineColor = new JTextField();
40
   JButton btnOutlineColor = new JButton();
41
   JLabel lblOutlineColorAlpha = new JLabel();
42
   JSlider sldOutlineColorAlpha = new JSlider();
43
   JTextField txtFillColor = new JTextField();
44
   JButton btnFillColor = new JButton();
45
   JLabel lblFillColorAlpha = new JLabel();
46
   JSlider sldFillColorAlpha = new JSlider();
47
   JTextField txtTextColor = new JTextField();
48
   JButton btnTextColor = new JButton();
49
   JLabel lblTextColorAlpha = new JLabel();
50
   JSlider sldTextColorAlpha = new JSlider();
51
   JTextField txtTextFont = new JTextField();
52
   JButton btnTextFont = new JButton();
53
   JSpinner spnSymbolSize = new JSpinner();
24 54
   JLabel lblStyle = new JLabel();
25 55
   JTextField txtStyle = new JTextField();
26 56
   JButton btnStyle = new JButton();
57
   JPanel pnlStylePreview = new JPanel();
58
   JLabel lblOperation = new JLabel();
59
   JComboBox cboOperation = new JComboBox();
60
   JLabel lblOperationAttribute = new JLabel();
61
   JLabel lblOperationValue = new JLabel();
62
   JComboBox cboOperationAttribute = new JComboBox();
63
   JTextField txtOperationValue = new JTextField();
64
   JLabel lblOperationDescription = new JLabel();
27 65

  
28 66
   /**
29 67
    * Default constructor
......
115 153
   public JPanel createPanel()
116 154
   {
117 155
      JPanel jpanel1 = new JPanel();
118
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE");
156
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:8DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
119 157
      CellConstraints cc = new CellConstraints();
120 158
      jpanel1.setLayout(formlayout1);
121 159

  
122
      lblDistance.setName("lblDistance");
123
      lblDistance.setText("Distance");
124
      jpanel1.add(lblDistance,cc.xy(2,2));
160
      rdbBasic.setActionCommand("Basic");
161
      rdbBasic.setName("rdbBasic");
162
      rdbBasic.setText("_Use_basic_cluster_mark");
163
      buttongroup1.add(rdbBasic);
164
      jpanel1.add(rdbBasic,cc.xywh(2,2,3,1));
125 165

  
126
      txtDistance.setName("txtDistance");
127
      jpanel1.add(txtDistance,cc.xywh(4,2,3,1));
166
      rdbStyled.setActionCommand("Styled");
167
      rdbStyled.setName("rdbStyled");
168
      rdbStyled.setText("_Use_styled_cluster_mark");
169
      buttongroup1.add(rdbStyled);
170
      jpanel1.add(rdbStyled,cc.xywh(2,6,3,1));
128 171

  
172
      jpanel1.add(createPanel1(),cc.xywh(3,4,2,1));
173
      jpanel1.add(createPanel6(),cc.xywh(3,8,2,1));
174
      jpanel1.add(createPanel7(),cc.xywh(2,10,3,1));
175
      addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11 });
176
      return jpanel1;
177
   }
178

  
179
   public JPanel createPanel1()
180
   {
181
      JPanel jpanel1 = new JPanel();
182
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE");
183
      CellConstraints cc = new CellConstraints();
184
      jpanel1.setLayout(formlayout1);
185

  
186
      lblOutlineColor.setName("lblOutlineColor");
187
      lblOutlineColor.setText("_Outline_color");
188
      jpanel1.add(lblOutlineColor,cc.xy(1,3));
189

  
190
      lblFillColor.setName("lblFillColor");
191
      lblFillColor.setText("_Fill_color");
192
      jpanel1.add(lblFillColor,cc.xy(1,5));
193

  
194
      lblTextColor.setName("lblTextColor");
195
      lblTextColor.setText("_Text_color");
196
      jpanel1.add(lblTextColor,cc.xy(1,7));
197

  
198
      lblTextFont.setName("lblTextFont");
199
      lblTextFont.setText("_Text_font");
200
      jpanel1.add(lblTextFont,cc.xy(1,9));
201

  
202
      lblShowBounds.setName("lblShowBounds");
203
      lblShowBounds.setText("_Show_bounds");
204
      jpanel1.add(lblShowBounds,cc.xy(1,11));
205

  
206
      chkShowBounds.setName("chkShowBounds");
207
      jpanel1.add(chkShowBounds,cc.xy(3,11));
208

  
209
      lblSymbolSize.setName("lblSymbolSize");
210
      lblSymbolSize.setText("_Symbol_size");
211
      jpanel1.add(lblSymbolSize,cc.xy(1,1));
212

  
213
      jpanel1.add(createPanel2(),cc.xy(3,3));
214
      jpanel1.add(createPanel3(),cc.xy(3,5));
215
      jpanel1.add(createPanel4(),cc.xy(3,7));
216
      jpanel1.add(createPanel5(),cc.xy(3,9));
217
      spnSymbolSize.setName("spnSymbolSize");
218
      jpanel1.add(spnSymbolSize,cc.xy(3,1));
219

  
220
      addFillComponents(jpanel1,new int[]{ 2 },new int[]{ 2,4,6,8,10 });
221
      return jpanel1;
222
   }
223

  
224
   public JPanel createPanel2()
225
   {
226
      JPanel jpanel1 = new JPanel();
227
      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");
228
      CellConstraints cc = new CellConstraints();
229
      jpanel1.setLayout(formlayout1);
230

  
231
      txtOutlineColor.setBackground(new Color(236,233,216));
232
      txtOutlineColor.setEditable(false);
233
      txtOutlineColor.setFont(new Font("Courier 10 Pitch",Font.PLAIN,11));
234
      txtOutlineColor.setName("txtOutlineColor");
235
      txtOutlineColor.setHorizontalAlignment(JTextField.RIGHT);
236
      jpanel1.add(txtOutlineColor,cc.xy(1,1));
237

  
238
      btnOutlineColor.setActionCommand("...");
239
      btnOutlineColor.setName("btnOutlineColor");
240
      btnOutlineColor.setText("...");
241
      jpanel1.add(btnOutlineColor,cc.xy(3,1));
242

  
243
      lblOutlineColorAlpha.setName("lblOutlineColorAlpha");
244
      lblOutlineColorAlpha.setText("Alpha");
245
      jpanel1.add(lblOutlineColorAlpha,cc.xy(5,1));
246

  
247
      sldOutlineColorAlpha.setMajorTickSpacing(20);
248
      sldOutlineColorAlpha.setName("sldOutlineColorAlpha");
249
      jpanel1.add(sldOutlineColorAlpha,cc.xy(7,1));
250

  
251
      addFillComponents(jpanel1,new int[]{ 2,4,6 },new int[0]);
252
      return jpanel1;
253
   }
254

  
255
   public JPanel createPanel3()
256
   {
257
      JPanel jpanel1 = new JPanel();
258
      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");
259
      CellConstraints cc = new CellConstraints();
260
      jpanel1.setLayout(formlayout1);
261

  
262
      txtFillColor.setBackground(new Color(236,233,216));
263
      txtFillColor.setEditable(false);
264
      txtFillColor.setFont(new Font("Courier 10 Pitch",Font.PLAIN,11));
265
      txtFillColor.setName("txtFillColor");
266
      txtFillColor.setScrollOffset(1);
267
      txtFillColor.setHorizontalAlignment(JTextField.RIGHT);
268
      jpanel1.add(txtFillColor,cc.xy(1,1));
269

  
270
      btnFillColor.setActionCommand("...");
271
      btnFillColor.setName("btnFillColor");
272
      btnFillColor.setText("...");
273
      jpanel1.add(btnFillColor,cc.xy(3,1));
274

  
275
      lblFillColorAlpha.setName("lblFillColorAlpha");
276
      lblFillColorAlpha.setText("Alpha");
277
      jpanel1.add(lblFillColorAlpha,cc.xy(5,1));
278

  
279
      sldFillColorAlpha.setMajorTickSpacing(20);
280
      sldFillColorAlpha.setName("sldFillColorAlpha");
281
      jpanel1.add(sldFillColorAlpha,cc.xy(7,1));
282

  
283
      addFillComponents(jpanel1,new int[]{ 2,4,6 },new int[0]);
284
      return jpanel1;
285
   }
286

  
287
   public JPanel createPanel4()
288
   {
289
      JPanel jpanel1 = new JPanel();
290
      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");
291
      CellConstraints cc = new CellConstraints();
292
      jpanel1.setLayout(formlayout1);
293

  
294
      txtTextColor.setBackground(new Color(236,233,216));
295
      txtTextColor.setEditable(false);
296
      txtTextColor.setFont(new Font("Courier 10 Pitch",Font.PLAIN,11));
297
      txtTextColor.setName("txtTextColor");
298
      txtTextColor.setScrollOffset(1);
299
      txtTextColor.setHorizontalAlignment(JTextField.RIGHT);
300
      jpanel1.add(txtTextColor,cc.xy(1,1));
301

  
302
      btnTextColor.setActionCommand("...");
303
      btnTextColor.setName("btnTextColor");
304
      btnTextColor.setText("...");
305
      jpanel1.add(btnTextColor,cc.xy(3,1));
306

  
307
      lblTextColorAlpha.setName("lblTextColorAlpha");
308
      lblTextColorAlpha.setText("Alpha");
309
      jpanel1.add(lblTextColorAlpha,cc.xy(5,1));
310

  
311
      sldTextColorAlpha.setMajorTickSpacing(20);
312
      sldTextColorAlpha.setName("sldTextColorAlpha");
313
      jpanel1.add(sldTextColorAlpha,cc.xy(7,1));
314

  
315
      addFillComponents(jpanel1,new int[]{ 2,4,6 },new int[0]);
316
      return jpanel1;
317
   }
318

  
319
   public JPanel createPanel5()
320
   {
321
      JPanel jpanel1 = new JPanel();
322
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
323
      CellConstraints cc = new CellConstraints();
324
      jpanel1.setLayout(formlayout1);
325

  
326
      txtTextFont.setBackground(new Color(236,233,216));
327
      txtTextFont.setEditable(false);
328
      txtTextFont.setName("txtTextFont");
329
      jpanel1.add(txtTextFont,cc.xy(1,1));
330

  
331
      btnTextFont.setActionCommand("...");
332
      btnTextFont.setName("btnTextFont");
333
      btnTextFont.setText("...");
334
      jpanel1.add(btnTextFont,cc.xy(3,1));
335

  
336
      addFillComponents(jpanel1,new int[]{ 2 },new int[0]);
337
      return jpanel1;
338
   }
339

  
340
   public JPanel createPanel6()
341
   {
342
      JPanel jpanel1 = new JPanel();
343
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE");
344
      CellConstraints cc = new CellConstraints();
345
      jpanel1.setLayout(formlayout1);
346

  
129 347
      lblStyle.setName("lblStyle");
130
      lblStyle.setText("Style");
131
      jpanel1.add(lblStyle,cc.xy(2,4));
348
      lblStyle.setText("_Style");
349
      jpanel1.add(lblStyle,cc.xy(1,1));
132 350

  
133 351
      txtStyle.setBackground(new Color(236,233,216));
134 352
      txtStyle.setEditable(false);
135 353
      txtStyle.setName("txtStyle");
136
      jpanel1.add(txtStyle,cc.xy(4,4));
354
      jpanel1.add(txtStyle,cc.xy(3,1));
137 355

  
138 356
      btnStyle.setActionCommand("...");
139 357
      btnStyle.setName("btnStyle");
140 358
      btnStyle.setText("...");
141
      jpanel1.add(btnStyle,cc.xy(6,4));
359
      jpanel1.add(btnStyle,cc.xy(5,1));
142 360

  
143
      addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7 },new int[]{ 1,2,3,4,5 });
361
      pnlStylePreview.setName("pnlStylePreview");
362
      jpanel1.add(pnlStylePreview,cc.xy(3,3));
363

  
364
      addFillComponents(jpanel1,new int[]{ 2,4 },new int[]{ 2,3 });
144 365
      return jpanel1;
145 366
   }
146 367

  
368
   public JPanel createPanel7()
369
   {
370
      JPanel jpanel1 = new JPanel();
371
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE");
372
      CellConstraints cc = new CellConstraints();
373
      jpanel1.setLayout(formlayout1);
374

  
375
      lblOperation.setName("lblOperation");
376
      lblOperation.setText("_Operation");
377
      jpanel1.add(lblOperation,cc.xy(1,1));
378

  
379
      cboOperation.setName("cboOperation");
380
      cboOperation.addItem("Count");
381
      cboOperation.addItem("Maximum");
382
      cboOperation.addItem("Minimum");
383
      cboOperation.addItem("Average");
384
      jpanel1.add(cboOperation,cc.xywh(3,1,3,1));
385

  
386
      lblOperationAttribute.setName("lblOperationAttribute");
387
      lblOperationAttribute.setText("_Attribute");
388
      jpanel1.add(lblOperationAttribute,cc.xy(3,5));
389

  
390
      lblOperationValue.setName("lblOperationValue");
391
      lblOperationValue.setText("_Aditional_value");
392
      jpanel1.add(lblOperationValue,cc.xy(3,7));
393

  
394
      cboOperationAttribute.setName("cboOperationAttribute");
395
      jpanel1.add(cboOperationAttribute,cc.xy(5,5));
396

  
397
      txtOperationValue.setName("txtOperationValue");
398
      jpanel1.add(txtOperationValue,cc.xy(5,7));
399

  
400
      lblOperationDescription.setName("lblOperationDescription");
401
      jpanel1.add(lblOperationDescription,cc.xywh(3,3,3,1));
402

  
403
      addFillComponents(jpanel1,new int[]{ 2,4,5,6 },new int[]{ 2,3,4,5,6,7 });
404
      return jpanel1;
405
   }
406

  
147 407
   /**
148 408
    * Initializer
149 409
    */

Also available in: Unified diff