1
/*FreeMind - A Program for creating and viewing Mindmaps
2
*Copyright (C) 2000-2006 Joerg Mueller, Daniel Polansky, Christian Foltin and others.
4
*See COPYING for Details
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 2
9
*of the License, or (at your option) any later version.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
* Created on 25.02.2006
22
/*$Id: PropertyBean.java,v 1.1.2.2 2006/02/28 18:56:50 christianfoltin Exp $*/
23
package freemind.common;
25
import java.beans.PropertyChangeEvent;
26
import java.beans.PropertyChangeListener;
27
import java.util.Iterator;
28
import java.util.Vector;
30
public abstract class PropertyBean {
32
private Vector mPropertyChangeListeners = new Vector();
34
/** The key of the property. */
35
public abstract String getLabel();
37
public abstract void setValue(String value);
39
public abstract String getValue();
41
public void addPropertyChangeListener(PropertyChangeListener listener) {
42
mPropertyChangeListeners.add(listener);
44
public void removePropertyChangeListener(PropertyChangeListener listener) {
45
mPropertyChangeListeners.remove(listener);
48
protected void firePropertyChangeEvent() {
49
PropertyChangeEvent evt = new PropertyChangeEvent(this, getLabel(), null, getValue());
50
for (Iterator i = mPropertyChangeListeners.iterator(); i.hasNext();)
52
PropertyChangeListener listener = (PropertyChangeListener) i.next();
53
listener.propertyChange(evt);
b'\\ No newline at end of file'