root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / doubleslider / TestDoubleSlider.java @ 11446
History | View | Annotate | Download (2.21 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2005 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.doubleslider; |
20 |
|
21 |
import java.awt.BorderLayout; |
22 |
import java.awt.Dimension; |
23 |
|
24 |
import javax.swing.JFrame; |
25 |
import javax.swing.JPanel; |
26 |
import javax.swing.UIManager; |
27 |
|
28 |
public class TestDoubleSlider { |
29 |
private JFrame jFrame = null; |
30 |
private DoubleSlider doubleSlider = null; |
31 |
private JPanel jPanel = null; |
32 |
|
33 |
public TestDoubleSlider() {
|
34 |
jFrame = new JFrame(); |
35 |
jFrame.setSize(new Dimension(498, 267)); |
36 |
jFrame.setContentPane(getJPanel()); |
37 |
jFrame.show(); |
38 |
jFrame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
39 |
} |
40 |
|
41 |
/**
|
42 |
* This method initializes multiSlider
|
43 |
*
|
44 |
* @return borsanza.src.multislider.MultiSlider
|
45 |
*/
|
46 |
private DoubleSlider getMultiSlider() {
|
47 |
if (doubleSlider == null) { |
48 |
doubleSlider = new DoubleSlider();
|
49 |
doubleSlider.setMinimum(0);
|
50 |
doubleSlider.setMaximum(255);
|
51 |
} |
52 |
return doubleSlider;
|
53 |
} |
54 |
|
55 |
/**
|
56 |
* This method initializes jPanel
|
57 |
*
|
58 |
* @return javax.swing.JPanel
|
59 |
*/
|
60 |
private JPanel getJPanel() { |
61 |
if (jPanel == null) { |
62 |
jPanel = new JPanel(); |
63 |
jPanel.setLayout(new BorderLayout()); |
64 |
jPanel.add(getMultiSlider(), BorderLayout.CENTER);
|
65 |
} |
66 |
return jPanel;
|
67 |
} |
68 |
|
69 |
public static void main(String[] args) { |
70 |
try {
|
71 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
72 |
} catch (Exception e) { |
73 |
System.err.println("No se puede cambiar al LookAndFeel"); |
74 |
} |
75 |
new TestDoubleSlider();
|
76 |
} |
77 |
} |
78 |
|