Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.core
Interface ModelChangeEventSource  view ModelChangeEventSource download ModelChangeEventSource.java

All Superinterfaces:
ModelChangeListener

public interface ModelChangeEventSource
extends ModelChangeListener

Implemented by model objects that fire ModelChangeEvents when their state changes: an implementation of the Observer Pattern. The Swing components in org.scopemvc.view.swing are aware to ModelChangeEvents: model objects that implement this interface are able to automatically refresh any Views bound to them.

If a submodel of a model changes, the parent must also fire a ModelChangeEvent to notify of the change in state of one of its properties. For example, if a Person has a Pet as a property, then when the Pet changes its age it fires an event to notify of a change to the "age" property. The Person must then also fire an event to notify that the "pet.age" property changed. The Swing components rely on this behaviour.

A useful base implementation of ModelChangeEventSource is provided in org.scopemvc.model.basic.BasicModel, which provides several convenience methods.

Version:
$Revision: 1.2 $ $Date: 2002/01/12 09:35:40 $

Method Summary
 void addModelChangeListener(ModelChangeListener inListener)
           
 void fireModelChange(int inChangeType, Selector inSelector)
           
 void modelChanged(ModelChangeEvent inEvent)
          Implement ModelChangeListener to respond to a ModelChangeEvent from a contained sub-model that needs changes to be propogated up the model hierarchy.
 void removeModelChangeListener(ModelChangeListener inListener)
           
 

Method Detail

addModelChangeListener

public void addModelChangeListener(ModelChangeListener inListener)

removeModelChangeListener

public void removeModelChangeListener(ModelChangeListener inListener)

fireModelChange

public void fireModelChange(int inChangeType,
                            Selector inSelector)

modelChanged

public void modelChanged(ModelChangeEvent inEvent)
Implement ModelChangeListener to respond to a ModelChangeEvent from a contained sub-model that needs changes to be propogated up the model hierarchy.

Specified by:
modelChanged in interface ModelChangeListener