svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / SamplePanel.java @ 40561
History | View | Annotate | Download (3.82 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 |
/* CVS MESSAGES:
|
25 |
*
|
26 |
* $Id: SamplePanel.java 13655 2007-09-12 16:28:55Z bsanchez $
|
27 |
* $Log$
|
28 |
* Revision 1.3 2007-09-12 16:28:23 bsanchez
|
29 |
* *** empty log message ***
|
30 |
*
|
31 |
* Revision 1.2 2007/08/21 08:39:05 bsanchez
|
32 |
* - Sustituir "deprecated" show por setVisible
|
33 |
*
|
34 |
* Revision 1.1 2007/08/20 08:34:45 evercher
|
35 |
* He fusionado LibUI con LibUIComponents
|
36 |
*
|
37 |
* Revision 1.1 2006/03/22 11:18:29 jaume
|
38 |
* *** empty log message ***
|
39 |
*
|
40 |
* Revision 1.6 2006/02/28 15:25:14 jaume
|
41 |
* *** empty log message ***
|
42 |
*
|
43 |
* Revision 1.4.2.4 2006/02/16 10:36:41 jaume
|
44 |
* *** empty log message ***
|
45 |
*
|
46 |
* Revision 1.4.2.3 2006/01/31 16:25:24 jaume
|
47 |
* correcciones de bugs
|
48 |
*
|
49 |
* Revision 1.5 2006/01/26 16:07:14 jaume
|
50 |
* *** empty log message ***
|
51 |
*
|
52 |
* Revision 1.4.2.1 2006/01/26 12:59:32 jaume
|
53 |
* 0.5
|
54 |
*
|
55 |
* Revision 1.4 2006/01/26 12:50:20 jaume
|
56 |
* *** empty log message ***
|
57 |
*
|
58 |
* Revision 1.3 2006/01/25 15:14:02 jaume
|
59 |
* *** empty log message ***
|
60 |
*
|
61 |
* Revision 1.2 2006/01/24 14:36:33 jaume
|
62 |
* This is the new version
|
63 |
*
|
64 |
* Revision 1.1.2.5 2006/01/10 13:11:38 jaume
|
65 |
* *** empty log message ***
|
66 |
*
|
67 |
* Revision 1.1.2.4 2006/01/10 11:33:31 jaume
|
68 |
* Time dimension working against Jet Propulsion Laboratory's WMS server
|
69 |
*
|
70 |
* Revision 1.1.2.3 2006/01/09 18:10:38 jaume
|
71 |
* casi con el time dimension
|
72 |
*
|
73 |
* Revision 1.1.2.2 2006/01/02 18:08:01 jaume
|
74 |
* Tree de estilos
|
75 |
*
|
76 |
* Revision 1.1.2.1 2005/12/30 08:56:19 jaume
|
77 |
* *** empty log message ***
|
78 |
*
|
79 |
*
|
80 |
*/
|
81 |
/**
|
82 |
*
|
83 |
*/
|
84 |
package org.gvsig.gui.beans; |
85 |
|
86 |
import javax.swing.JFrame; |
87 |
import javax.swing.JPanel; |
88 |
|
89 |
import org.gvsig.gui.beans.listeners.BeanListener; |
90 |
/**
|
91 |
* Sample class for see how to use BeanListeners.
|
92 |
* <p>
|
93 |
* Have fun! ;-)
|
94 |
* </p>
|
95 |
* @author jaume
|
96 |
*/
|
97 |
public class SamplePanel extends JPanel { |
98 |
private static final long serialVersionUID = 3663247043945556938L; |
99 |
private Pager ep;
|
100 |
/**
|
101 |
* This is the default constructor
|
102 |
*/
|
103 |
public SamplePanel() {
|
104 |
super();
|
105 |
initialize(); |
106 |
} |
107 |
|
108 |
/**
|
109 |
* This method initializes this
|
110 |
*
|
111 |
* @return void
|
112 |
*/
|
113 |
private void initialize() { |
114 |
this.setSize(300, 200); |
115 |
this.setLayout(null); |
116 |
|
117 |
this.add(getEditionPanel(), null); |
118 |
|
119 |
} |
120 |
|
121 |
private Pager getEditionPanel(){
|
122 |
if (ep == null){ |
123 |
ep = new Pager(0, 20, Pager.HORIZONTAL); |
124 |
ep.addListener(new BeanListener(){
|
125 |
|
126 |
public void beanValueChanged(Object value) { |
127 |
System.out.println("("+((Integer) value).intValue()+")"); |
128 |
} |
129 |
|
130 |
}); |
131 |
} |
132 |
return ep;
|
133 |
} |
134 |
|
135 |
public static void main(String[] args){ |
136 |
//dim = new TimeDimension("units", "unitSymbol", "2004-12-24/2005-12-18/P1D");
|
137 |
|
138 |
JFrame frame = new JFrame(); |
139 |
frame.getContentPane().add(new SamplePanel());
|
140 |
frame.setBounds(0, 0, 279, 63); |
141 |
frame.pack(); |
142 |
frame.setVisible(true);
|
143 |
} |
144 |
} |