Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libUIComponent / src / org / gvsig / gui / beans / DefaultBean.java @ 38564

History | View | Annotate | Download (3.29 KB)

1 13136 evercher
/* 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
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
42
/* CVS MESSAGES:
43
*
44
* $Id$
45
* $Log$
46 13184 bsanchez
* Revision 1.2  2007-08-21 08:38:21  bsanchez
47
* - Quitados warnings en imports innecesarios
48
*
49
* Revision 1.1  2007/08/20 08:34:45  evercher
50 13136 evercher
* He fusionado LibUI con LibUIComponents
51
*
52
* Revision 1.4  2006/09/14 08:30:11  cesar
53
* Remove static initialization of gvsig-i18n; it's done in the Messages class now
54
*
55
* Revision 1.3.2.1  2006/09/14 07:55:48  cesar
56
* Remove static initialization of gvsig-i18n; it's done in the Messages class now
57
*
58
* Revision 1.3  2006/08/10 07:33:12  cesar
59
* *** empty log message ***
60
*
61
* Revision 1.2  2006/07/11 12:42:10  cesar
62
* Load properties for libUI
63
*
64
* Revision 1.1  2006/03/22 11:18:29  jaume
65
* *** empty log message ***
66
*
67
* Revision 1.4  2006/02/28 15:25:14  jaume
68
* *** empty log message ***
69
*
70
* Revision 1.2.2.3  2006/01/31 16:25:24  jaume
71
* correcciones de bugs
72
*
73
* Revision 1.3  2006/01/26 16:07:14  jaume
74
* *** empty log message ***
75
*
76
* Revision 1.2.2.1  2006/01/26 12:59:32  jaume
77
* 0.5
78
*
79
* Revision 1.2  2006/01/24 14:36:33  jaume
80
* This is the new version
81
*
82
* Revision 1.1.2.3  2006/01/10 13:11:38  jaume
83
* *** empty log message ***
84
*
85
* Revision 1.1.2.2  2006/01/10 11:33:31  jaume
86
* Time dimension working against Jet Propulsion Laboratory's WMS server
87
*
88
* Revision 1.1.2.1  2005/12/30 08:56:19  jaume
89
* *** empty log message ***
90
*
91
*
92
*/
93
/**
94 17327 bsanchez
 *
95 13136 evercher
 */
96
package org.gvsig.gui.beans;
97
98
import java.util.ArrayList;
99
import java.util.Iterator;
100
101
import javax.swing.JPanel;
102
103
import org.gvsig.gui.beans.listeners.BeanListener;
104
/**
105 17327 bsanchez
 * A JPanel with addListener(BeanListener l), removeListener(BeanListener l),
106 13136 evercher
 * and callValueChange(Object value) methods for adding and removing listeners,
107
 * and firing BeanValueChange events.
108
 *
109 17327 bsanchez
 * @author jaume
110 13136 evercher
 */
111 17327 bsanchez
public abstract class DefaultBean extends JPanel {
112
        ArrayList<BeanListener> listeners = new ArrayList<BeanListener>();
113 13136 evercher
114 17327 bsanchez
        public void addListener(BeanListener l) {
115
                listeners.add(l);
116
        }
117 13136 evercher
118 17327 bsanchez
        public void removeListener(BeanListener l) {
119
                listeners.remove(l);
120
        }
121
122
        public void callValueChanged(Object value) {
123
                Iterator<BeanListener> i = listeners.iterator();
124
125
                while (i.hasNext()) {
126
                        i.next().beanValueChanged(value);
127
                }
128
        }
129
}