Revision 5497 trunk/extensions/extRasterTools/src/org/gvsig/rasterTools/brightnessContrast/ui/CheckSliderText.java

View differences:

CheckSliderText.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
1 20
package org.gvsig.rasterTools.brightnessContrast.ui;
2 21

  
3 22
import java.awt.GridBagConstraints;
......
8 27
import javax.swing.JCheckBox;
9 28
import javax.swing.JLabel;
10 29

  
30
/**
31
 * Clase que contiene slider, campo de texto, etiqueta para el nombre y un 
32
 * checkBox para habilitar o deshabilitar el slider y el campo de texto.
33
 * @author Miguel ?ngel Querol Carratal?  <querol_mig@gva.es>
34
 *
35
 */
11 36
public class CheckSliderText extends SliderTextPanel implements ActionListener{
12 37
	
13 38
	public JLabel lName = null;
......
33 58
	 * Inicializa cSliderText
34 59
	 * @return
35 60
	 */
36
	private JCheckBox getJCheckBox(){
61
	public JCheckBox getJCheckBox(){
37 62
		if(cSliderText == null){
38 63
			cSliderText = new JCheckBox();
39 64
		}
......
50 75
		return lName;
51 76
	}
52 77
	
78
	/**
79
	 * Pone nombre al panel en la etiqueta que est? encima del slider
80
	 */
53 81
	public void setName(String name){
54 82
		lName.setText(name);
55 83
	}
56 84
	
85
	/**
86
	 * Activa o desactiva el slider y el campo de texto 
87
	 */
57 88
	public void setControlEnabled(boolean active){
58 89
		this.cSliderText.setEnabled(active);
59 90
		this.lName.setEnabled(active);
91
		this.getJTextField().setEnabled(active);
60 92
		super.setControlEnabled(active);
61 93
		if(cSliderText.isSelected() == false){
62 94
			super.setControlEnabled(false);
63
			this.lName.setEnabled(false);
64 95
		}
65 96
		
66 97
	}
67 98
	
68
	public boolean isSelected(){
69
		return this.getJCheckBox().isSelected();
70
	}
71 99
	
72 100
	public void actionPerformed(ActionEvent e) {
73 101
		super.actionPerformed(e);

Also available in: Unified diff