All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface openstar.generic.IModel

public interface IModel
Generic model interface.

A model in the OpenStar system is an object, probably consisting of many different other objects, that has the following characteristics:

Note: In most cases, applications will use the class Model as the base for own model classes instead of always implementing all the methods of this interface from scratch. The interface definition is provided, so own model classes can be derived from application specific domain classes, while also implementing the IModel interface. Just remember, when implementing own extensions to the framework, that wherever a model object is expected, it must be an IModel, and not a Model.

Version:
16 Jun 1997
Author:
Nils Schwabe

Method Index

 o addModelChangeListener(ModelChangeListener)
Adds a listener to this model.
 o getEnableNotifications()
 o removeModelChangeListener(ModelChangeListener)
Removes a listener from the model.
 o setEnableNotifications(boolean)
Enable or disable notification of registered event listeners.
 o setModelChanged(Object)
Fires a ModelChangeEvent to all registered listeners.

Methods

 o addModelChangeListener
  public abstract void addModelChangeListener(ModelChangeListener listener)
Adds a listener to this model.

The listener gets notified when the model changes.

 o removeModelChangeListener
  public abstract void removeModelChangeListener(ModelChangeListener listener)
Removes a listener from the model.

 o setModelChanged
  public abstract void setModelChanged(Object source)
Fires a ModelChangeEvent to all registered listeners.

Nothing happens if the notifications switch of this model is "off" (@see getEnableNotifications(), @see getEnableNotifications()).

Parameters:
source - The originator of the change (often the calling object)
 o setEnableNotifications
  public abstract void setEnableNotifications(boolean enable)
Enable or disable notification of registered event listeners.

If notifications are turned off, the setModelChanged() methods do nothing. The default setting is "on". You can turn notifications off to make extensive changes to a model without every change triggering an event. When finished, you should turn notifications "on" again and make one call to the setModelChanged() method to inform all listeners of the changes.

 o getEnableNotifications
  public abstract boolean getEnableNotifications()
Returns:
true -- notifications are currently enabled.
false -- notifications are currently disabled.

All Packages  Class Hierarchy  This Package  Previous  Next  Index