svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / test / java / org / gvsig / gui / beans / checkslidertext / TestCheckColorSliderTextTable.java @ 40561
History | View | Annotate | Download (2.15 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.gui.beans.checkslidertext; |
25 |
|
26 |
import java.awt.Color; |
27 |
|
28 |
import org.gvsig.gui.beans.TestUI; |
29 |
import org.gvsig.gui.beans.doubleslider.DoubleSliderEvent; |
30 |
import org.gvsig.gui.beans.doubleslider.DoubleSliderListener; |
31 |
|
32 |
public class TestCheckColorSliderTextTable implements DoubleSliderListener { |
33 |
private int w = 375, h = 150; |
34 |
private TestUI frame = new TestUI("TestCheckColorSliderTextTable"); |
35 |
private CheckColorSliderTextContainer sliderRed = null; |
36 |
|
37 |
public TestCheckColorSliderTextTable() {
|
38 |
sliderRed = new CheckColorSliderTextContainer(0, 255, 0, "R", false); |
39 |
sliderRed.setColor1(Color.BLACK, false); |
40 |
sliderRed.setColor2(Color.RED, true); |
41 |
sliderRed.setCheckboxVisible(true);
|
42 |
|
43 |
frame.getContentPane().add(sliderRed); |
44 |
sliderRed.setEnabled(true);
|
45 |
frame.setSize(w, h); |
46 |
frame.setVisible(true);
|
47 |
sliderRed.addValueChangedListener(this);
|
48 |
} |
49 |
|
50 |
public static void main(String[] args) { |
51 |
new TestCheckColorSliderTextTable();
|
52 |
} |
53 |
|
54 |
public void actionValueChanged(DoubleSliderEvent e) { |
55 |
System.out.println("Changed: " + sliderRed.getValue()); |
56 |
} |
57 |
|
58 |
public void actionValueDragged(DoubleSliderEvent e) { |
59 |
System.out.println("Dragged: " + sliderRed.getValue()); |
60 |
} |
61 |
} |