|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ohrasys.app.AbstractAppController
public abstract class AbstractAppController
A basic controller that negotiates the state between a model and one or more views.
Field Summary | |
---|---|
protected AppControllerEventListener |
model
The application model |
protected AppOption[] |
options
Command line options |
protected java.util.concurrent.ThreadFactory |
pool
The application thread pool |
protected java.util.List<AppControllerEventListener> |
views
The application views |
Constructor Summary | |
---|---|
AbstractAppController(AbstractAppModel model,
AbstractAppView view,
AppOption[] options)
Creates a new AppController object. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
ActionEvent perform method. |
void |
addView(AppControllerEventListener view)
Registers ActionListener to receive events. |
protected void |
notifyModel(java.awt.event.ActionEvent event)
Sends notification to update the model |
protected void |
notifyViews(java.awt.event.ActionEvent event)
Sends notification to update the views |
abstract java.awt.event.ActionEvent |
processEvent(java.awt.event.ActionEvent evt)
Event processing method. |
void |
removeView(AppControllerEventListener view)
Removes ActionListener from the list of listeners. |
protected void |
setModel(AppControllerEventListener model)
Registers ActionListener to receive events. |
abstract void |
startController()
This method starts the controller and should perform any application initialization that is required. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient AppControllerEventListener model
protected AppOption[] options
protected java.util.concurrent.ThreadFactory pool
protected transient java.util.List<AppControllerEventListener> views
Constructor Detail |
---|
public AbstractAppController(AbstractAppModel model, AbstractAppView view, AppOption[] options) throws AppException
model
- The application model to controlview
- The application view to controloptions
- The applications command line options
AppException
- If an error in processing occursMethod Detail |
---|
public abstract java.awt.event.ActionEvent processEvent(java.awt.event.ActionEvent evt)
evt
- The event to process.
public abstract void startController()
public final void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- The event to processpublic void addView(AppControllerEventListener view)
view
- The listener to register.public void removeView(AppControllerEventListener view)
view
- The listener to remove.public java.lang.String toString()
toString
in class java.lang.Object
protected void notifyModel(java.awt.event.ActionEvent event)
event
- The event to send to the modelprotected void notifyViews(java.awt.event.ActionEvent event)
event
- The event to send to the viewsprotected void setModel(AppControllerEventListener model) throws java.util.TooManyListenersException
model
- The listener to register.
java.util.TooManyListenersException
- If an attempt is made to associate more
than one model with this controller.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |