1 17 package org.eclipse.emf.importer.rose.parser; 18 19 import java.beans.PropertyChangeEvent ; 20 import java.beans.PropertyChangeListener ; 21 import java.util.ArrayList ; 22 import java.util.Iterator ; 23 import java.util.List ; 24 25 26 29 public class RoseComponent 30 { 31 protected List listeners = new ArrayList (); 32 33 public void addPropertyChangeListener(PropertyChangeListener l) 34 { 35 listeners.add(l); 36 } 37 38 public void firePropertyChange(String propertyName, int oldValue, int newValue) 39 { 40 for (Iterator i = listeners.iterator(); i.hasNext();) 41 { 42 PropertyChangeListener propertyChangeListener = (PropertyChangeListener )i.next(); 43 Integer oldInt = new Integer (oldValue); 44 Integer newInt = new Integer (newValue); 45 PropertyChangeEvent propertyChangeEvent = new PropertyChangeEvent (this, propertyName, oldInt, newInt); 46 propertyChangeListener.propertyChange(propertyChangeEvent); 47 } 48 } 49 } 50 | Popular Tags |