talx x1.0.5

talx.feature
Class BadTypingCorrection

java.lang.Object
  extended bytalx.feature.BadTypingCorrection
All Implemented Interfaces:
java.awt.event.AWTEventListener, ControllerConstants, java.util.EventListener, Interceptor, TALFeature

public class BadTypingCorrection
extends java.lang.Object
implements Interceptor, java.awt.event.AWTEventListener, ControllerConstants

Beeps and displays a message when the user types onto a button. Once the user types onto a button, the message will display in the marque until the user performs some other action.


Nested Class Summary
protected  class BadTypingCorrection.BadTypingAction
           
 
Field Summary
static java.lang.String BAD_TYPING_COMMAND
           
 
Fields inherited from interface talx.controller.ControllerConstants
EXIT_COMMAND, FILE_ATTACHMENTS_KEY, ILLEGAL_ACTION_COMMAND, LOGOUT_COMMAND, MAIL_COUNT_CHANGED_COMMAND, REMOTE_GAME_COMMAND, SAVE_COMMAND, STOP_COMMAND, TEST_COMMAND
 
Constructor Summary
BadTypingCorrection(java.lang.String param)
          Constructs a new correction object.
 
Method Summary
 boolean claim(java.awt.event.ActionEvent ev, Controller c)
          Determines whether this feature is responsible for the action.
 void eventDispatched(java.awt.AWTEvent event)
           
 void initialize(Controller c)
          Allows the interceptor to change the gui state.
 void release()
          Releases all system resources held by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BAD_TYPING_COMMAND

public static final java.lang.String BAD_TYPING_COMMAND
See Also:
Constant Field Values
Constructor Detail

BadTypingCorrection

public BadTypingCorrection(java.lang.String param)
Constructs a new correction object.

Parameters:
param - the text to show on the marque
Method Detail

claim

public boolean claim(java.awt.event.ActionEvent ev,
                     Controller c)
              throws ActionVetoException
Description copied from interface: Interceptor
Determines whether this feature is responsible for the action. In response to this method, the feature can: Each feature can manage its own state in any way, including updating its state in response to unclaimed or vetoed actions. However, a feature may not update the volatile state without claiming the action. This is because the controller will not fire a changeFinishedEvent if the action is vetoed. Since, by not claiming the state, a feature leaves open the possibilty that another feature will veto it, it is only safe to update the state on actions that it claims. Once an action is claimed, the controller fires a changeFinishedEvent and stops propagating the action through the chain of responsibility.

Interceptors that wish to make some minor change to the gui state but not stop other effects from an action must make their change, refire the action via the controller's doAction() method, and then claim the action. Obviously, such interceptors must remember the action event to prevent them from reacting to it the next time.

Unlike ActionHandlers, which are stateless, Interceptors must manage their own state.

Specified by:
claim in interface Interceptor
Returns:
true to claim the action, false otherwise.
Throws:
ActionVetoException - to veto the action.

eventDispatched

public void eventDispatched(java.awt.AWTEvent event)
Specified by:
eventDispatched in interface java.awt.event.AWTEventListener

initialize

public void initialize(Controller c)
Description copied from interface: Interceptor
Allows the interceptor to change the gui state. This method is called in the controller init method just after the controller restores the state but before it fires the first controller change event.

Specified by:
initialize in interface Interceptor

release

public void release()
Description copied from interface: TALFeature
Releases all system resources held by this object. The general contract of pluggable features is that once their release method is called, they should be elligible for garbage collection. The exceptions to this are references to this object held in the ActionDispatcher and in the Transport model. Both of those objects are cleared by the system. However, in all other cases, if this object subscribed to a listener interface, it must unsubscribe in this method. This method should block until all object clean-up has been accomplished. This includes closing all open files, etc. Once the object has returned from the release method, the system may go down without further warning.

Specified by:
release in interface TALFeature

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.