Statistics
| Revision:

root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / checkslidertext / TestCheckColorSliderTextTable.java @ 12939

History | View | Annotate | Download (2.08 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 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
package org.gvsig.gui.beans.checkslidertext;
20

    
21
import java.awt.Color;
22

    
23
import javax.swing.JFrame;
24

    
25
import org.gvsig.gui.beans.doubleslider.DoubleSliderEvent;
26
import org.gvsig.gui.beans.doubleslider.DoubleSliderListener;
27

    
28
public class TestCheckColorSliderTextTable implements DoubleSliderListener {
29
        private int                           w      = 375, h = 150;
30
        private JFrame                        frame  = new JFrame();
31
        private CheckColorSliderTextContainer sliderRed = null;
32

    
33
        public TestCheckColorSliderTextTable() {
34
                sliderRed = new CheckColorSliderTextContainer(0, 255, 0, "R", false);
35
                sliderRed.setColor1(Color.BLACK, false);
36
                sliderRed.setColor2(Color.RED, true);
37
                sliderRed.setCheckboxVisible(true);
38

    
39
                frame.getContentPane().add(sliderRed);
40
                sliderRed.setEnabled(true);
41
                frame.setSize(w, h);
42
                frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
43
                frame.setVisible(true);
44
                sliderRed.addValueChangedListener(this);
45
        }
46

    
47
        public static void main(String[] args) {
48
                new TestCheckColorSliderTextTable();
49
        }
50

    
51
        public void actionValueChanged(DoubleSliderEvent e) {
52
                System.out.println("Changed: " + sliderRed.getValue());
53
        }
54

    
55
        public void actionValueDragged(DoubleSliderEvent e) {
56
                System.out.println("Dragged: " + sliderRed.getValue());
57
        }
58
}