Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

AbstractAppModel Class Reference

Inheritance diagram for AbstractAppModel:

Inheritance graph
[legend]
Collaboration diagram for AbstractAppModel:

Collaboration graph
[legend]
List of all members.

Detailed Description

A basic application model which should be subclassed and specialized by specific application implementations by implementing the processEvent method.

Author:
Author
tvaline
Version:
Revision
1.3
,
Date
2005/03/05 04:06:16

Definition at line 30 of file AbstractAppModel.java.

Public Member Functions

void actionPerformed (ActionEvent evt)
 A method to perform an processing of actions received by the application controller.
synchronized void setController (AppModelEventListener controller) throws TooManyListenersException
 Adds the controller as a listener of this model.
String toString ()
 Returns a string representation of this object.

Protected Member Functions

void notifyController (ActionEvent event)
 Issues events from this application model to the application controller.
abstract ActionEvent processEvent (ActionEvent evt)
 The method that processes incoming events.

Protected Attributes

transient AppModelEventListener controller = null
 The controller listening to this application model.


Member Function Documentation

void actionPerformed ActionEvent  evt  ) 
 

A method to perform an processing of actions received by the application controller.

Parameters:
evt The event to process.

Definition at line 41 of file AbstractAppModel.java.

References AbstractAppModel.notifyController(), and AbstractAppModel.processEvent().

00041                                                {
00042     ActionEvent response = processEvent(evt);
00043     if(response != null){notifyController(response);}
00044   }

void notifyController ActionEvent  event  )  [protected]
 

Issues events from this application model to the application controller.

Parameters:
event The event to issue.

Definition at line 88 of file AbstractAppModel.java.

References AbstractAppModel.controller.

Referenced by AbstractAppModel.actionPerformed().

00088                                                      {
00089     if(controller == null){return;}
00090     controller.actionPerformed(event);
00091   }

abstract ActionEvent processEvent ActionEvent  evt  )  [protected, pure virtual]
 

The method that processes incoming events.

Parameters:
evt The incoming event from the controller
Returns:
The outgoing response event to the controller. This method should return null if no response is required. For instance if a the controller sends a request to change a model member variable but the new value is the same as the existing value, then no action need be taken, therefore no response should be generated.

Referenced by AbstractAppModel.actionPerformed().

synchronized void setController AppModelEventListener  controller  )  throws TooManyListenersException
 

Adds the controller as a listener of this model.

Parameters:
controller The controller that will listen to this model
Exceptions:
TooManyListenersException If more than one controller is being registered.

Definition at line 54 of file AbstractAppModel.java.

References AbstractAppModel.controller.

00055                                      {
00056     if(controller == null){this.controller = null;}
00057     else {
00058       if(this.controller != null){throw new TooManyListenersException();}
00059       this.controller = controller;
00060     }
00061   }

String toString  ) 
 

Returns a string representation of this object.

Returns:
The physical address of this instance.

Definition at line 68 of file AbstractAppModel.java.

00068 {return super.toString();}


Member Data Documentation

transient AppModelEventListener controller = null [protected]
 

The controller listening to this application model.

Definition at line 33 of file AbstractAppModel.java.

Referenced by AbstractAppModel.notifyController(), and AbstractAppModel.setController().


The documentation for this class was generated from the following file:
Generated on Tue Nov 1 23:43:37 2005 for JavaBasicApplicationFrameworkAPI(JBAF) by  doxygen 1.4.2