|
talx x1.0.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Stateless objects to handle actions. Although the interface definition cannot specify this, the Thinkandlink specification requires that each ActionHandler implementation class also have a static, no argument getInstance() method that returns an object of that class's type. ActionHandlers are not allowed to be stateful, so no public constructors should be present. The only method for getting a new ActionHandler reference should be to call the getInstance() method on an implementation class.
| Method Summary | |
boolean |
canRun(GUIState state,
Controller c)
This method tells the controller whether the given handler will function in the given GUIState. |
ActionHandler |
handleAction(java.awt.event.ActionEvent ev,
Controller c)
Handles an action event and transitions to a new action handler. |
| Method Detail |
public ActionHandler handleAction(java.awt.event.ActionEvent ev,
Controller c)
throws ActionVetoException
If the GUIState changes as a result of the action, this method should call the controller's fireControllerChange method after setting the new state. Although a normal return from this method will trigger a controller change finished event, visual components are not required to listen for changes that were not introduced via controller change events.
It is also customary for handlers to "initialize" themselves and/or the controller when ev == null. The interpretation of initialization is left to the handler writer; however, handler classes that are used as initial handlers will be called with ev == null at system start-up. Classes that cannot be used as initialHandlers should throw a NullPointerException when called with a null event.
java.lang.NullPointerException - if ev is null and this handler
cannot be used as the initial handler class.
ActionVetoException - to suppress a controller change
finished event upon termination.
public boolean canRun(GUIState state,
Controller c)
state - the current visual state of the system
|
talx x1.0.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.