FileDocCategorySizeDatePackage
AccessKeyCondition.javaAPI DocphoneME MR2 API (J2ME)3555Wed May 02 18:00:34 BST 2007com.sun.perseus.model

AccessKeyCondition

public final class AccessKeyCondition extends EventBaseCondition
A AccessKeyCondition generates a TimeInstance everytime the associated key event occurs with the expected accessKey value.
version
$Id: AccessKeyCondition.java,v 1.2 2006/04/21 06:36:24 st125089 Exp $

Fields Summary
char
accessKey
The key code which triggers the condition.
Constructors Summary
public AccessKeyCondition(TimedElementSupport timedElement, boolean isBegin, long offset, char accessKey)

param
timedElement the associated TimedElementSupport. Should not be null.
param
isBegin defines whether this condition is for a begin list.
param
offset offset from the sync base. This means that time instances synchronized on the syncBase begin or end time are offset by this amount.
param
accessKey only when the eventBase generates a key event with this accessKey will a TimeInstance be generated.

        super(timedElement, 
              isBegin, 
              null, 
              timedElement.animationElement.ownerDocument,
              SVGConstants.SVG_KEYDOWN_EVENT_TYPE, 
              offset);
        
        this.accessKey = accessKey;
    
Methods Summary
public voidhandleEvent(org.w3c.dom.events.Event evt)
Implementation of the EventListener interface. This is a simple filtered version of the handleEvent implementation in EventBaseCondition.

param
evt the event that occured

        if (((ModelEvent) evt).keyChar == accessKey) {
            super.handleEvent(evt);
        }
    
protected java.lang.StringtoStringTrait()
Converts this AccessKeyCondition to a String trait.

return
a string describing this TimeCondition

        StringBuffer sb = new StringBuffer();

        sb.append("accessKey(");
        sb.append(accessKey);
        sb.append(')");

        if (offset != 0) {
            if (offset > 0) {
                sb.append('+");
            } 
            sb.append(offset / 1000f);
            sb.append('s");
        }

        return sb.toString();