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

ModelEvent

public class ModelEvent extends Object implements Event
Events happen on a specific target and have a specific type.
see
EventListener
see
EventSupport
version
$Id: ModelEvent.java,v 1.5 2006/06/29 10:47:33 ln156897 Exp $

Fields Summary
public static final char
CHAR_UNDEFINED
Used when for undefined key char events
protected String
type
The event's type
protected ModelNode
target
The event target
protected EventTarget
currentTarget
The current event target.
protected Anchor
anchor
The event's anchor is used to ease the implementation of hyperlinking.
protected boolean
stopPropagation
Controls whether or not the event's dispatch should be stopped
protected Time
eventTime
Time stamp. The time is in document simple time, i.e., in the root container's time.
protected int
repeatCount
Used to provide the repeat iteration in a repeat event
protected char
keyChar
Used to provide the key character in a key event
Constructors Summary
public ModelEvent(String type, ModelNode target)

param
type the event's type. Should not be null.
param
target the event's target. Should not be null.


                           
           
        if (type == null) {
            throw new NullPointerException();
        }

        this.type = type;
        
        if (target == null) {
            throw new NullPointerException();
        }

        this.target = target;

        // Set the event time.
        this.eventTime = 
                target.ownerDocument.timeContainerRootSupport.getCurrentTime();
    
public ModelEvent(String type, ModelNode target, char keyChar)

param
type the event's type. Should not be null
param
target the event's target. Should not be null.
param
keyChar the event's character key

        this(type, target);
        this.keyChar = keyChar;
    
Methods Summary
public AnchorgetAnchor()

return
the current value of the anchor property

        return anchor;
    
public org.w3c.dom.events.EventTargetgetCurrentTarget()

return
this node's current target

        return currentTarget;
    
public chargetKeyChar()

return
the key that was stroked.

        return keyChar;
    
public booleangetStopPropagation()

return
true if propagation should stop. false otherwise

        return stopPropagation;
    
public org.w3c.dom.events.EventTargetgetTarget()

return
this node's target

        return target;
    
public java.lang.StringgetType()

return
this event's type

        return type;
    
public voidsetAnchor(Anchor anchor)

param
anchor the Event's associated Anchor
throws
IllegalStateException if the anchor property is not null

        if (this.anchor == null) {
            this.anchor = anchor;
        } else {
            throw new IllegalStateException();
        }
    
public voidstopPropagation()
Stops propagation of the Event during dispatch. See the DOM Level 2 Event model specification for details.

        stopPropagation = true;