org.bs.mdi
Interface ActionObservable

All Known Subinterfaces:
RootView, View
All Known Implementing Classes:
Data, SwingRootView, SwingView

public interface ActionObservable

An interface for objects that can be observed by an ActionObserver.


Method Summary
 void addObserver(ActionObserver observer)
          Registers this observer so that it will receive notification messages.
 int countObservers()
          Counts all registered observers.
 boolean isObserver(ActionObserver observer)
          Determines if the given observer is currently observing this object.
 void notifyObservers(Action action, boolean undo)
          Notifies the observers about an action which has been recently performed.
 void removeObserver(ActionObserver observer)
          Un-registers this observer so that it will not receive notifications any longer.
 

Method Detail

addObserver

public void addObserver(ActionObserver observer)
Registers this observer so that it will receive notification messages.

Parameters:
observer - the observer to be registered

removeObserver

public void removeObserver(ActionObserver observer)
Un-registers this observer so that it will not receive notifications any longer.

Parameters:
observer - the observer to be un-registered

countObservers

public int countObservers()
Counts all registered observers.

Returns:
the number of registered observers.

isObserver

public boolean isObserver(ActionObserver observer)
Determines if the given observer is currently observing this object.

Parameters:
observer - the observer
Returns:
true if the observer is currently observing this object, false otherwise

notifyObservers

public void notifyObservers(Action action,
                            boolean undo)
Notifies the observers about an action which has been recently performed. Note that the implementation may use threading to deliver the notification messages.

Parameters:
action - the action which has been performed
undo - true if the action has been undone, false otherwise