package com.planetmayo.debrief.satc.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;

public abstract class ModelObject implements Serializable
{
	private static final long serialVersionUID = 1L;

	private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
			this);

	public void addPropertyChangeListener(PropertyChangeListener listener)
	{
		changeSupport.addPropertyChangeListener(listener);
	}

	public void addPropertyChangeListener(String propertyName,
			PropertyChangeListener listener)
	{
		changeSupport.addPropertyChangeListener(propertyName, listener);
	}
	
	public int getPropertyChangeListenersCount() 
	{
		return changeSupport.getPropertyChangeListeners().length;
	}

	protected void firePropertyChange(String propertyName, Object oldValue,
			Object newValue)
	{
		changeSupport.firePropertyChange(propertyName, oldValue, newValue);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener)
	{
		changeSupport.removePropertyChangeListener(listener);
	}

	public void removePropertyChangeListener(String propertyName,
			PropertyChangeListener listener)
	{
		changeSupport.removePropertyChangeListener(propertyName, listener);
	}
}

@@ -270,16 +270,26 @@
 private 
+transient 
 Property
@@ -302,16 +302,244 @@
 Support 
+changeSupport;%0A%0A%09/** note: we provide this method so that we can correctly initialise the %0A%09 * transient changeSupport object when we're deserialising a model object%0A%09 * %0A%09 * @return this%0A%09 */%0A%09private Object readResolve()%0A%09%7B%0A%09%09
 changeSu
@@ -576,18 +576,32 @@
 ort(
-%0A%09%09%09
+this);%0A%09%09return 
 this
-)
 ;
+%0A%09%7D
 %0A%0A%09p
@@ -899,17 +899,16 @@
 er);%0A%09%7D%0A
-%09
 %0A%09public
@@ -945,17 +945,16 @@
 sCount()
- 
 %0A%09%7B%0A%09%09re

initialise our transient object when stream is reading them back in