Revision 2669 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/EnhancedPanel.java

View differences:

EnhancedPanel.java
1 1
/*
2 2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 * 
4
 * Copyright (C) 2004-5. 
5 3
 *
4
 * Copyright (C) 2004-5.
5
 *
6 6
 * This program is free software; you can redistribute it and/or
7 7
 * modify it under the terms of the GNU General Public License
8 8
 * as published by the Free Software Foundation; either version 2
......
18 18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19 19
 *
20 20
 * For more information, contact:
21
 * 
21
 *
22 22
 * cresques@gmail.com
23 23
 */
24 24
package org.cresques.ui.raster;
......
37 37
import javax.swing.JRadioButton;
38 38
import javax.swing.JSlider;
39 39
import javax.swing.JTextField;
40

  
41

  
40 42
/**
41
 * Panel que contiene los elementos para el dialogo del filtro de realce 
43
 * Panel que contiene los elementos para el dialogo del filtro de realce
42 44
 * @author Nacho Brodin <brodin_ign@gva.es>
43 45
 */
44
public class EnhancedPanel extends JPanel{
45
	
46
	final private static long serialVersionUID = -3370601314380922368L;
47
	public String nom = "Realce";
48
	FilterRasterDialogPanel parent = null;
49
		
50
	private JPanel jPanel = null;
51
	private JPanel jPanel1 = null;
52
	private JPanel jPanel2 = null;
53
	private JPanel jPanel3 = null;
54
	private JRadioButton jRadioButton = null;
55
	private JRadioButton jRadioButton1 = null;
56
	private JCheckBox jCheckBox = null;
57
	public JLabel jLabel = null;
58
	public JLabel jLabel2 = null;
59
	public JPanel jPanel4 = null;
60
	private	ButtonGroup grupo= new ButtonGroup();
61
	private Image iconoLineal = null;
62
	private Image iconoSinRealce = null;
63
	
64
	private JPanel jPanel5 = null;
65
	private JSlider jSlider = null;
66
	private JTextField jTextField = null;
67
	
68
	
69
	private JPanel jPanel6 = null;
70
	private JCheckBox jCheckBox1 = null;
71
	public JLabel jLabel4 = null;
72
	public JPanel jPanel7 = null;
73
	public JLabel jLabel1 = null;
74
	public JPanel jPanel8 = null;
75
	public JPanel jPanel9 = null;
76
	public JLabel jLabel5 = null;
77
	
78
	/**
79
	 * Constructor. 
80
	 * @param parent
81
	 */
82
	public EnhancedPanel(FilterRasterDialogPanel parent){
83
		this.parent = parent;	
84
		initialize();
85
	}		
46
public class EnhancedPanel extends JPanel {
47
    final private static long serialVersionUID = -3370601314380922368L;
48
    public String nom = "Realce";
49
    FilterRasterDialogPanel parent = null;
50
    private JPanel jPanel = null;
51
    private JPanel jPanel1 = null;
52
    private JPanel jPanel2 = null;
53
    private JPanel jPanel3 = null;
54
    private JRadioButton jRadioButton = null;
55
    private JRadioButton jRadioButton1 = null;
56
    private JCheckBox jCheckBox = null;
57
    public JLabel jLabel = null;
58
    public JLabel jLabel2 = null;
59
    public JPanel jPanel4 = null;
60
    private ButtonGroup grupo = new ButtonGroup();
61
    private Image iconoLineal = null;
62
    private Image iconoSinRealce = null;
63
    private JPanel jPanel5 = null;
64
    private JSlider jSlider = null;
65
    private JTextField jTextField = null;
66
    private JPanel jPanel6 = null;
67
    private JCheckBox jCheckBox1 = null;
68
    public JLabel jLabel4 = null;
69
    public JPanel jPanel7 = null;
70
    public JLabel jLabel1 = null;
71
    public JPanel jPanel8 = null;
72
    public JPanel jPanel9 = null;
73
    public JLabel jLabel5 = null;
86 74

  
87
	/**
88
	 * This method initializes this
89
	 * 
90
	 * @return void
91
	 */
92
	private void initialize() {
75
    /**
76
     * Constructor.
77
     * @param parent
78
     */
79
    public EnhancedPanel(FilterRasterDialogPanel parent) {
80
        this.parent = parent;
81
        initialize();
82
    }
83

  
84
    /**
85
     * This method initializes this
86
     *
87
     * @return void
88
     */
89
    private void initialize() {
93 90
        this.setLayout(new BorderLayout());
94 91
        this.setSize(445, 239);
95
        this.setPreferredSize(new java.awt.Dimension(445,239));
92
        this.setPreferredSize(new java.awt.Dimension(445, 239));
96 93
        this.add(getJPanel(), java.awt.BorderLayout.CENTER);
97
        
98
       	initControls();
99
	}
100
	
101
	/**
102
	 * Inicializa controles a sus valores por defecto
103
	 */
104
	public void initControls(){
105
		jRadioButton1.setSelected(true);
106
		this.getTailText().setText("0.0");
107
		this.getTailSlider().setValue(0);
108
		this.setActiveTailControl(false);
109
		this.getTailCheck().setEnabled(false);
110
		this.getRemoveCheck().setEnabled(false);
111
	}
112
	
113
	
114
	/**
115
	 * This method initializes jPanel	
116
	 * 	
117
	 * @return javax.swing.JPanel	
118
	 */    
119
	private JPanel getJPanel() {
120
		if (jPanel == null) {
121
			FlowLayout flowLayout2 = new FlowLayout();
122
			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
123
			jPanel = new JPanel();
124
			jPanel.setLayout(flowLayout2);
125
			gridBagConstraints4.gridx = 0;
126
			gridBagConstraints4.gridy = 0;
127
			jPanel.setPreferredSize(new java.awt.Dimension(445,239));
128
			flowLayout2.setAlignment(java.awt.FlowLayout.CENTER);
129
			jPanel.add(getJPanel4(), null);
130
			jPanel.add(getJPanel8(), null);
131
		}
132
		return jPanel;
133
	}
134
	/**
135
	 * This method initializes jPanel1	
136
	 * 	
137
	 * @return javax.swing.JPanel	
138
	 */    
139
	private JPanel getJPanel1() {
140
		if (jPanel1 == null) {
141
			jLabel  = new JLabel("Lineal directo",new ImageIcon("images/lineal.gif"), JLabel.CENTER);
142
			jPanel1 = new JPanel();
143
			jPanel1.setLayout(new BorderLayout());
144
			jPanel1.add(getLinealDirectoRadioButton(), java.awt.BorderLayout.WEST);
145
			jPanel1.add(jLabel, java.awt.BorderLayout.EAST);
146
		}
147
		return jPanel1;
148
	}
149
	/**
150
	 * This method initializes jPanel2	
151
	 * 	
152
	 * @return javax.swing.JPanel	
153
	 */    
154
	private JPanel getJPanel2() {
155
		if (jPanel2 == null) {
156
			jPanel2 = new JPanel();
157
			jPanel2.setLayout(new BorderLayout());
158
			jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
159
			jPanel2.setPreferredSize(new java.awt.Dimension(220,95));
160
			jPanel2.add(getJPanel5(), java.awt.BorderLayout.CENTER);
161
			jPanel2.add(getJPanel6(), java.awt.BorderLayout.SOUTH);
162
			jPanel2.add(getJPanel7(), java.awt.BorderLayout.NORTH);
163
		}
164
		return jPanel2;
165
	}
166
	/**
167
	 * This method initializes jPanel3	
168
	 * 	
169
	 * @return javax.swing.JPanel	
170
	 */    
171
	private JPanel getJPanel3() {
172
		if (jPanel3 == null) {
173
			jLabel2 = new JLabel("Sin Realce",new ImageIcon("images/sinrealce.gif"), JLabel.CENTER);
174
			jPanel3 = new JPanel();
175
			jPanel3.setLayout(new BorderLayout());
176
			jPanel3.add(getSinRealceRadioButton(), java.awt.BorderLayout.WEST);
177
			jPanel3.add(jLabel2, java.awt.BorderLayout.EAST);
178
		}
179
		return jPanel3;
180
	}
181
	/**
182
	 * This method initializes jRadioButton	
183
	 * 	
184
	 * @return javax.swing.JRadioButton	
185
	 */    
186
	public JRadioButton getLinealDirectoRadioButton() {
187
		if (jRadioButton == null) {
188
			jRadioButton = new JRadioButton();
189
			grupo.add(jRadioButton);
190
		}
191
		return jRadioButton;
192
	}
193
	/**
194
	 * This method initializes jRadioButton1	
195
	 * 	
196
	 * @return javax.swing.JRadioButton	
197
	 */    
198
	public JRadioButton getSinRealceRadioButton() {
199
		if (jRadioButton1 == null) {
200
			jRadioButton1 = new JRadioButton();
201
			jRadioButton1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
202
			grupo.add(jRadioButton1);
203
		}
204
		return jRadioButton1;
205
	}
206
	/**
207
	 * This method initializes jCheckBox	
208
	 * 	
209
	 * @return javax.swing.JCheckBox	
210
	 */    
211
	public JCheckBox getTailCheck() {
212
		if (jCheckBox == null) {
213
			jCheckBox = new JCheckBox();
214
		}
215
		return jCheckBox;
216
	}
217
	/**
218
	 * This method initializes jPanel4	
219
	 * 	
220
	 * @return javax.swing.JPanel	
221
	 */    
222
	private JPanel getJPanel4() {
223
		if (jPanel4 == null) {
224
			GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
225
			GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
226
			jPanel4 = new JPanel();
227
			jPanel4.setLayout(new GridBagLayout());
228
			gridBagConstraints9.gridx = 0;
229
			gridBagConstraints9.gridy = 0;
230
			gridBagConstraints9.insets = new java.awt.Insets(5,0,5,2);
231
			gridBagConstraints9.anchor = java.awt.GridBagConstraints.WEST;
232
			gridBagConstraints10.gridx = 0;
233
			gridBagConstraints10.gridy = 1;
234
			gridBagConstraints10.insets = new java.awt.Insets(5,0,5,5);
235
			jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0));
236
			jPanel4.setPreferredSize(new java.awt.Dimension(175,200));
237
			jPanel4.add(getJPanel3(), gridBagConstraints9);
238
			jPanel4.add(getJPanel1(), gridBagConstraints10);
239
		}
240
		return jPanel4;
241
	}
242
	
243
	
244
	/**
245
	 * This method initializes jPanel5	
246
	 * 	
247
	 * @return javax.swing.JPanel	
248
	 */    
249
	private JPanel getJPanel5() {
250
		if (jPanel5 == null) {
251
			jPanel5 = new JPanel();
252
			jPanel5.add(getTailSlider(), null);
253
		}
254
		return jPanel5;
255
	}
256
	/**
257
	 * This method initializes jSlider	
258
	 * 	
259
	 * @return javax.swing.JSlider	
260
	 */    
261
	public JSlider getTailSlider() {
262
		if (jSlider == null) {
263
			jSlider = new JSlider();
264
			jSlider.setPreferredSize(new java.awt.Dimension(240,16));
265
		}
266
		return jSlider;
267
	}
268
	/**
269
	 * This method initializes jTextField	
270
	 * 	
271
	 * @return javax.swing.JTextField	
272
	 */    
273
	public JTextField getTailText() {
274
		if (jTextField == null) {
275
			jTextField = new JTextField();
276
			jTextField.setPreferredSize(new java.awt.Dimension(40,19));
277
			jTextField.setText("0.0");
278
		}
279
		return jTextField;
280
	}
281
	
282
	/**
283
	 * Activa/Desactiva los controles de Recorte de colas
284
	 * @param active
285
	 */
286
	public void setActiveTailControl(boolean active){
287
		this.getTailSlider().setEnabled(active);
288
		this.getTailText().setEnabled(active);
289
		this.jLabel1.setEnabled(active);
290
		this.jLabel4.setEnabled(active);
291
	}
292
	
293
	/**
294
	 * 
295
	 * @param active
296
	 */
297
	public void setActiveRemoveCheck(boolean active){
298
		this.getRemoveCheck().setEnabled(active);
299
		this.jLabel5.setEnabled(active);
300
	}
301
	
302
	/**
303
	 * Asigna el procentaje de recorte de colas aplicado
304
	 * @param tail
305
	 */
306
	public void setPercentTail(int tail){
307
		jTextField.setText(String.valueOf(tail));
308
		jSlider.setValue(tail);
309
	}
310
		
311
	/**
312
	 * Asigna el filtro seleccionado cuando se abre el dialogo
313
	 * @param filter
314
	 */
315
	public void setSelectedFilter(int filter){
316
		switch(filter){
317
			case 0:	jRadioButton1.setSelected(true); 	//Sin realce
318
					jCheckBox.setEnabled(false);
319
					setActiveTailControl(false);
320
					this.setActiveRemoveCheck(false);
321
					break;
322
					
323
			case 1: this.getRemoveCheck().setSelected(true);
324
										
325
			case 2:	jRadioButton.setSelected(true);		//Realce lineal
326
					this.getTailCheck().setEnabled(true);
327
					this.setActiveRemoveCheck(true);
328
					if(!this.getTailText().getText().equals("") && !this.getTailText().getText().equals("0.0")){
329
						this.getTailCheck().setSelected(true);
330
						this.setActiveTailControl(true);
331
					}
332
					break;
333
		}
334
	}
335
	
336
	/**
337
	 * This method initializes jPanel6	
338
	 * 	
339
	 * @return javax.swing.JPanel	
340
	 */    
341
	private JPanel getJPanel6() {
342
		if (jPanel6 == null) {
343
			FlowLayout flowLayout3 = new FlowLayout();
344
			jLabel4 = new JLabel();
345
			jPanel6 = new JPanel();
346
			jPanel6.setLayout(flowLayout3);
347
			jLabel4.setText("% recorte");
348
			flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
349
			jPanel6.add(getTailText(), null);
350
			jPanel6.add(jLabel4, null);
351
		}
352
		return jPanel6;
353
	}
354
	/**
355
	 * This method initializes jCheckBox1	
356
	 * 	
357
	 * @return javax.swing.JCheckBox	
358
	 */    
359
	public JCheckBox getRemoveCheck() {
360
		if (jCheckBox1 == null) {
361
			jCheckBox1 = new JCheckBox();
362
		}
363
		return jCheckBox1;
364
	}
365
	/**
366
	 * This method initializes jPanel7	
367
	 * 	
368
	 * @return javax.swing.JPanel	
369
	 */    
370
	private JPanel getJPanel7() {
371
		if (jPanel7 == null) {
372
			jLabel1 = new JLabel();
373
			FlowLayout flowLayout1 = new FlowLayout();
374
			jPanel7 = new JPanel();
375
			jPanel7.setLayout(flowLayout1);
376
			jLabel1.setText("Recorte de colas");
377
			flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
378
			jPanel7.add(getTailCheck(), null);
379
			jPanel7.add(jLabel1, null);
380
		}
381
		return jPanel7;
382
	}
383
	/**
384
	 * This method initializes jPanel8	
385
	 * 	
386
	 * @return javax.swing.JPanel	
387
	 */    
388
	private JPanel getJPanel8() {
389
		if (jPanel8 == null) {
390
			jPanel8 = new JPanel();
391
			jPanel8.setLayout(new BorderLayout());
392
			jPanel8.setPreferredSize(new java.awt.Dimension(250,130));
393
			jPanel8.add(getJPanel2(), java.awt.BorderLayout.SOUTH);
394
			jPanel8.add(getJPanel9(), java.awt.BorderLayout.NORTH);
395
		}
396
		return jPanel8;
397
	}
398
	/**
399
	 * This method initializes jPanel9	
400
	 * 	
401
	 * @return javax.swing.JPanel	
402
	 */    
403
	private JPanel getJPanel9() {
404
		if (jPanel9 == null) {
405
			jLabel5 = new JLabel();
406
			FlowLayout flowLayout11 = new FlowLayout();
407
			jPanel9 = new JPanel();
408
			jPanel9.setLayout(flowLayout11);
409
			jLabel5.setText("Eliminar Extremos");
410
			flowLayout11.setAlignment(java.awt.FlowLayout.LEFT);
411
			jPanel9.add(getRemoveCheck(), null);
412
			jPanel9.add(jLabel5, null);
413
		}
414
		return jPanel9;
415
	}
416
     }  //  @jve:decl-index=0:visual-constraint="36,15"
94

  
95
        initControls();
96
    }
97

  
98
    /**
99
     * Inicializa controles a sus valores por defecto
100
     */
101
    public void initControls() {
102
        jRadioButton1.setSelected(true);
103
        this.getTailText().setText("0.0");
104
        this.getTailSlider().setValue(0);
105
        this.setActiveTailControl(false);
106
        this.getTailCheck().setEnabled(false);
107
        this.getRemoveCheck().setEnabled(false);
108
    }
109

  
110
    /**
111
     * This method initializes jPanel
112
     *
113
     * @return javax.swing.JPanel
114
     */
115
    private JPanel getJPanel() {
116
        if (jPanel == null) {
117
            FlowLayout flowLayout2 = new FlowLayout();
118
            GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
119
            jPanel = new JPanel();
120
            jPanel.setLayout(flowLayout2);
121
            gridBagConstraints4.gridx = 0;
122
            gridBagConstraints4.gridy = 0;
123
            jPanel.setPreferredSize(new java.awt.Dimension(445, 239));
124
            flowLayout2.setAlignment(java.awt.FlowLayout.CENTER);
125
            jPanel.add(getJPanel4(), null);
126
            jPanel.add(getJPanel8(), null);
127
        }
128

  
129
        return jPanel;
130
    }
131

  
132
    /**
133
     * This method initializes jPanel1
134
     *
135
     * @return javax.swing.JPanel
136
     */
137
    private JPanel getJPanel1() {
138
        if (jPanel1 == null) {
139
            jLabel = new JLabel("Lineal directo",
140
                                new ImageIcon("images/lineal.gif"),
141
                                JLabel.CENTER);
142
            jPanel1 = new JPanel();
143
            jPanel1.setLayout(new BorderLayout());
144
            jPanel1.add(getLinealDirectoRadioButton(),
145
                        java.awt.BorderLayout.WEST);
146
            jPanel1.add(jLabel, java.awt.BorderLayout.EAST);
147
        }
148

  
149
        return jPanel1;
150
    }
151

  
152
    /**
153
     * This method initializes jPanel2
154
     *
155
     * @return javax.swing.JPanel
156
     */
157
    private JPanel getJPanel2() {
158
        if (jPanel2 == null) {
159
            jPanel2 = new JPanel();
160
            jPanel2.setLayout(new BorderLayout());
161
            jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,
162
                                                                         1));
163
            jPanel2.setPreferredSize(new java.awt.Dimension(220, 95));
164
            jPanel2.add(getJPanel5(), java.awt.BorderLayout.CENTER);
165
            jPanel2.add(getJPanel6(), java.awt.BorderLayout.SOUTH);
166
            jPanel2.add(getJPanel7(), java.awt.BorderLayout.NORTH);
167
        }
168

  
169
        return jPanel2;
170
    }
171

  
172
    /**
173
     * This method initializes jPanel3
174
     *
175
     * @return javax.swing.JPanel
176
     */
177
    private JPanel getJPanel3() {
178
        if (jPanel3 == null) {
179
            jLabel2 = new JLabel("Sin Realce",
180
                                 new ImageIcon("images/sinrealce.gif"),
181
                                 JLabel.CENTER);
182
            jPanel3 = new JPanel();
183
            jPanel3.setLayout(new BorderLayout());
184
            jPanel3.add(getSinRealceRadioButton(), java.awt.BorderLayout.WEST);
185
            jPanel3.add(jLabel2, java.awt.BorderLayout.EAST);
186
        }
187

  
188
        return jPanel3;
189
    }
190

  
191
    /**
192
     * This method initializes jRadioButton
193
     *
194
     * @return javax.swing.JRadioButton
195
     */
196
    public JRadioButton getLinealDirectoRadioButton() {
197
        if (jRadioButton == null) {
198
            jRadioButton = new JRadioButton();
199
            grupo.add(jRadioButton);
200
        }
201

  
202
        return jRadioButton;
203
    }
204

  
205
    /**
206
     * This method initializes jRadioButton1
207
     *
208
     * @return javax.swing.JRadioButton
209
     */
210
    public JRadioButton getSinRealceRadioButton() {
211
        if (jRadioButton1 == null) {
212
            jRadioButton1 = new JRadioButton();
213
            jRadioButton1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
214
            grupo.add(jRadioButton1);
215
        }
216

  
217
        return jRadioButton1;
218
    }
219

  
220
    /**
221
     * This method initializes jCheckBox
222
     *
223
     * @return javax.swing.JCheckBox
224
     */
225
    public JCheckBox getTailCheck() {
226
        if (jCheckBox == null) {
227
            jCheckBox = new JCheckBox();
228
        }
229

  
230
        return jCheckBox;
231
    }
232

  
233
    /**
234
     * This method initializes jPanel4
235
     *
236
     * @return javax.swing.JPanel
237
     */
238
    private JPanel getJPanel4() {
239
        if (jPanel4 == null) {
240
            GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
241
            GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
242
            jPanel4 = new JPanel();
243
            jPanel4.setLayout(new GridBagLayout());
244
            gridBagConstraints9.gridx = 0;
245
            gridBagConstraints9.gridy = 0;
246
            gridBagConstraints9.insets = new java.awt.Insets(5, 0, 5, 2);
247
            gridBagConstraints9.anchor = java.awt.GridBagConstraints.WEST;
248
            gridBagConstraints10.gridx = 0;
249
            gridBagConstraints10.gridy = 1;
250
            gridBagConstraints10.insets = new java.awt.Insets(5, 0, 5, 5);
251
            jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0,
252
                                                                          0, 0));
253
            jPanel4.setPreferredSize(new java.awt.Dimension(175, 200));
254
            jPanel4.add(getJPanel3(), gridBagConstraints9);
255
            jPanel4.add(getJPanel1(), gridBagConstraints10);
256
        }
257

  
258
        return jPanel4;
259
    }
260

  
261
    /**
262
     * This method initializes jPanel5
263
     *
264
     * @return javax.swing.JPanel
265
     */
266
    private JPanel getJPanel5() {
267
        if (jPanel5 == null) {
268
            jPanel5 = new JPanel();
269
            jPanel5.add(getTailSlider(), null);
270
        }
271

  
272
        return jPanel5;
273
    }
274

  
275
    /**
276
     * This method initializes jSlider
277
     *
278
     * @return javax.swing.JSlider
279
     */
280
    public JSlider getTailSlider() {
281
        if (jSlider == null) {
282
            jSlider = new JSlider();
283
            jSlider.setPreferredSize(new java.awt.Dimension(240, 16));
284
        }
285

  
286
        return jSlider;
287
    }
288

  
289
    /**
290
     * This method initializes jTextField
291
     *
292
     * @return javax.swing.JTextField
293
     */
294
    public JTextField getTailText() {
295
        if (jTextField == null) {
296
            jTextField = new JTextField();
297
            jTextField.setPreferredSize(new java.awt.Dimension(40, 19));
298
            jTextField.setText("0.0");
299
        }
300

  
301
        return jTextField;
302
    }
303

  
304
    /**
305
     * Activa/Desactiva los controles de Recorte de colas
306
     * @param active
307
     */
308
    public void setActiveTailControl(boolean active) {
309
        this.getTailSlider().setEnabled(active);
310
        this.getTailText().setEnabled(active);
311
        this.jLabel1.setEnabled(active);
312
        this.jLabel4.setEnabled(active);
313
    }
314

  
315
    /**
316
     *
317
     * @param active
318
     */
319
    public void setActiveRemoveCheck(boolean active) {
320
        this.getRemoveCheck().setEnabled(active);
321
        this.jLabel5.setEnabled(active);
322
    }
323

  
324
    /**
325
     * Asigna el procentaje de recorte de colas aplicado
326
     * @param tail
327
     */
328
    public void setPercentTail(int tail) {
329
        jTextField.setText(String.valueOf(tail));
330
        jSlider.setValue(tail);
331
    }
332

  
333
    /**
334
     * Asigna el filtro seleccionado cuando se abre el dialogo
335
     * @param filter
336
     */
337
    public void setSelectedFilter(int filter) {
338
        switch (filter) {
339
        case 0:
340
            jRadioButton1.setSelected(true); //Sin realce
341
            jCheckBox.setEnabled(false);
342
            setActiveTailControl(false);
343
            this.setActiveRemoveCheck(false);
344

  
345
            break;
346

  
347
        case 1:
348
            this.getRemoveCheck().setSelected(true);
349

  
350
        case 2:
351
            jRadioButton.setSelected(true); //Realce lineal
352
            this.getTailCheck().setEnabled(true);
353
            this.setActiveRemoveCheck(true);
354

  
355
            if (!this.getTailText().getText().equals("") &&
356
                    !this.getTailText().getText().equals("0.0")) {
357
                this.getTailCheck().setSelected(true);
358
                this.setActiveTailControl(true);
359
            }
360

  
361
            break;
362
        }
363
    }
364

  
365
    /**
366
     * This method initializes jPanel6
367
     *
368
     * @return javax.swing.JPanel
369
     */
370
    private JPanel getJPanel6() {
371
        if (jPanel6 == null) {
372
            FlowLayout flowLayout3 = new FlowLayout();
373
            jLabel4 = new JLabel();
374
            jPanel6 = new JPanel();
375
            jPanel6.setLayout(flowLayout3);
376
            jLabel4.setText("% recorte");
377
            flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
378
            jPanel6.add(getTailText(), null);
379
            jPanel6.add(jLabel4, null);
380
        }
381

  
382
        return jPanel6;
383
    }
384

  
385
    /**
386
     * This method initializes jCheckBox1
387
     *
388
     * @return javax.swing.JCheckBox
389
     */
390
    public JCheckBox getRemoveCheck() {
391
        if (jCheckBox1 == null) {
392
            jCheckBox1 = new JCheckBox();
393
        }
394

  
395
        return jCheckBox1;
396
    }
397

  
398
    /**
399
     * This method initializes jPanel7
400
     *
401
     * @return javax.swing.JPanel
402
     */
403
    private JPanel getJPanel7() {
404
        if (jPanel7 == null) {
405
            jLabel1 = new JLabel();
406

  
407
            FlowLayout flowLayout1 = new FlowLayout();
408
            jPanel7 = new JPanel();
409
            jPanel7.setLayout(flowLayout1);
410
            jLabel1.setText("Recorte de colas");
411
            flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
412
            jPanel7.add(getTailCheck(), null);
413
            jPanel7.add(jLabel1, null);
414
        }
415

  
416
        return jPanel7;
417
    }
418

  
419
    /**
420
     * This method initializes jPanel8
421
     *
422
     * @return javax.swing.JPanel
423
     */
424
    private JPanel getJPanel8() {
425
        if (jPanel8 == null) {
426
            jPanel8 = new JPanel();
427
            jPanel8.setLayout(new BorderLayout());
428
            jPanel8.setPreferredSize(new java.awt.Dimension(250, 130));
429
            jPanel8.add(getJPanel2(), java.awt.BorderLayout.SOUTH);
430
            jPanel8.add(getJPanel9(), java.awt.BorderLayout.NORTH);
431
        }
432

  
433
        return jPanel8;
434
    }
435

  
436
    /**
437
     * This method initializes jPanel9
438
     *
439
     * @return javax.swing.JPanel
440
     */
441
    private JPanel getJPanel9() {
442
        if (jPanel9 == null) {
443
            jLabel5 = new JLabel();
444

  
445
            FlowLayout flowLayout11 = new FlowLayout();
446
            jPanel9 = new JPanel();
447
            jPanel9.setLayout(flowLayout11);
448
            jLabel5.setText("Eliminar Extremos");
449
            flowLayout11.setAlignment(java.awt.FlowLayout.LEFT);
450
            jPanel9.add(getRemoveCheck(), null);
451
            jPanel9.add(jLabel5, null);
452
        }
453

  
454
        return jPanel9;
455
    }
456
} //  @jve:decl-index=0:visual-constraint="36,15"

Also available in: Unified diff