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

AbstractAppView Class Reference

Inheritance diagram for AbstractAppView:

Inheritance graph
[legend]
Collaboration diagram for AbstractAppView:

Collaboration graph
[legend]
List of all members.

Detailed Description

A basic application view which should be subclassed and specialized by specific application implementations.

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

Definition at line 30 of file AbstractAppView.java.

Public Member Functions

void actionPerformed (ActionEvent evt)
 A method that dispatches all events received by this view.
synchronized void setController (AppViewEventListener controller) throws TooManyListenersException
 Registers ActionListener to receive events.
String toString ()
 Returns a string representation of this object.

Protected Member Functions

void notifyController (ActionEvent event)
 Notifies the registered listener about the event.
abstract ActionEvent processEvent (ActionEvent evt)
 The method that processes incoming events.

Protected Attributes

transient AppViewEventListener controller = null
 The controller that will listen to this application view.


Member Function Documentation

void actionPerformed ActionEvent  evt  ) 
 

A method that dispatches all events received by this view.

This method should be overridden by subclasses.

Parameters:
evt The event to process.

Definition at line 41 of file AbstractAppView.java.

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

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

void notifyController ActionEvent  event  )  [protected]
 

Notifies the registered listener about the event.

Parameters:
event The event to be fired

Definition at line 88 of file AbstractAppView.java.

References AbstractAppView.controller.

Referenced by AbstractAppView.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 AbstractAppView.actionPerformed().

synchronized void setController AppViewEventListener  controller  )  throws TooManyListenersException
 

Registers ActionListener to receive events.

Parameters:
controller The listener to register.
Exceptions:
TooManyListenersException If more than one controller is associated with this view.

Definition at line 54 of file AbstractAppView.java.

References AbstractAppView.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 AbstractAppView.java.

00068 {return super.toString();}


Member Data Documentation

transient AppViewEventListener controller = null [protected]
 

The controller that will listen to this application view.

Definition at line 33 of file AbstractAppView.java.

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


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