org.w3c.dom.events
Interface EventTarget

All Known Subinterfaces:
SVGAnimationElement, SVGElement, SVGLocatableElement, SVGSVGElement

public interface EventTarget

This interface represents an event target, and is a subset of the EventTarget interface defined in the DOM Level 2 Event model.
This interface is implemented by an object (SVGElements) that can notify listeners about events and allows registration and removal of EventListener objects.


Method Summary
 void addEventListener(java.lang.String type, EventListener listener, boolean useCapture)
          This method registers the specified listener with the event target.
 void removeEventListener(java.lang.String type, EventListener listener, boolean useCapture)
          This method removes the specified listener from the event target.
 

Method Detail

addEventListener

void addEventListener(java.lang.String type,
                      EventListener listener,
                      boolean useCapture)
This method registers the specified listener with the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.

Parameters:
type - The type of event to listen to.
listener - Will be notified when an event of the desired type happens on this target or one of its descendant.
useCapture - If true, the listener will be called during the event flow capture phase. Otherwise, the listener will be called during the bubble phase. If the event's target is this target, then the listener will be called during the 'at target' phase of event flow.
Throws:
DOMException - with error code NOT_SUPPORTED_ERR if useCapture is true since capture phase is not required in SVG Tiny and implementations may not support registering listeners for the capture phase.
java.lang.NullPointerException - if listener is null.
java.lang.NullPointerException - if type is null.

removeEventListener

void removeEventListener(java.lang.String type,
                         EventListener listener,
                         boolean useCapture)
This method removes the specified listener from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.

Parameters:
type - The type of event that was listened to.
listener - The listener that was previously registered.
useCapture - If true, the listener was listening to events in the capture phase of event flow, otherwise the listener was listening to events in the bubble phase.
Throws:
DOMException - with error code NOT_SUPPORTED_ERR if useCapture is true since capture phase is not required in SVG Tiny and implementations may not support registering listeners for the capture phase.
java.lang.NullPointerException - if listener is null.
java.lang.NullPointerException - if type is null.


Copyright © 2003-2006 Nokia Corporation. See the Copyright Notice for details.