root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / colorslideredition / TestColorSliderEdition.java @ 12898
History | View | Annotate | Download (2.76 KB)
1 | 12898 | bsanchez | /* 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.colorslideredition; |
||
20 | |||
21 | import java.awt.Dimension; |
||
22 | import java.awt.GridBagConstraints; |
||
23 | import java.awt.event.ActionEvent; |
||
24 | import java.awt.event.ActionListener; |
||
25 | |||
26 | import javax.swing.JCheckBox; |
||
27 | import javax.swing.JFrame; |
||
28 | import javax.swing.JPanel; |
||
29 | import javax.swing.border.EmptyBorder; |
||
30 | |||
31 | public class TestColorSliderEdition implements ActionListener { |
||
32 | private JFrame jFrame = null; |
||
33 | private ColorSliderEdition colorSliderEdition = null; |
||
34 | JCheckBox jCBInterpolated = null; |
||
35 | |||
36 | public TestColorSliderEdition() {
|
||
37 | jCBInterpolated = new JCheckBox("Interpolated"); |
||
38 | jCBInterpolated.addActionListener(this);
|
||
39 | |||
40 | jFrame = new JFrame(); |
||
41 | jFrame.setSize(new Dimension(498, 127)); |
||
42 | colorSliderEdition = new ColorSliderEdition();
|
||
43 | colorSliderEdition.setPreferredSize(new Dimension(0, 44)); |
||
44 | colorSliderEdition.setMinimumSize(new Dimension(0, 44)); |
||
45 | JPanel jPanel = new JPanel(); |
||
46 | jFrame.setContentPane(jPanel); |
||
47 | |||
48 | jPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); |
||
49 | jPanel.setLayout(new java.awt.GridBagLayout());
|
||
50 | |||
51 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
||
52 | gridBagConstraints.gridx = 0;
|
||
53 | gridBagConstraints.gridy = 0;
|
||
54 | gridBagConstraints.weightx = 1;
|
||
55 | gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
|
||
56 | gridBagConstraints.insets = new java.awt.Insets(5, 5, 2, 5); |
||
57 | jPanel.add(colorSliderEdition, gridBagConstraints); |
||
58 | |||
59 | gridBagConstraints = new GridBagConstraints(); |
||
60 | gridBagConstraints.gridx = 0;
|
||
61 | gridBagConstraints.gridy = 1;
|
||
62 | gridBagConstraints.insets = new java.awt.Insets(2, 5, 5, 5); |
||
63 | jPanel.add(jCBInterpolated, gridBagConstraints); |
||
64 | |||
65 | |||
66 | |||
67 | |||
68 | jFrame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
||
69 | jFrame.setVisible(true);
|
||
70 | } |
||
71 | |||
72 | public static void main(String[] args) { |
||
73 | new TestColorSliderEdition();
|
||
74 | } |
||
75 | |||
76 | public void actionPerformed(ActionEvent e) { |
||
77 | if (e.getSource() == jCBInterpolated) {
|
||
78 | colorSliderEdition.setInterpolated(jCBInterpolated.isSelected()); |
||
79 | return;
|
||
80 | } |
||
81 | } |
||
82 | } |