You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2006/11/24 05:50:15 UTC
svn commit: r478769 [2/3] - in /xmlgraphics/batik/trunk: ./
documentation-sources/content/xdocs/
documentation-sources/content/xdocs/using/ lib/ lib/build/
resources/org/apache/batik/apps/svgbrowser/resources/ sources/
sources/org/apache/batik/bridge/ ...
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg12/XBLEventSupport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg12/XBLEventSupport.java?view=diff&rev=478769&r1=478768&r2=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg12/XBLEventSupport.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg12/XBLEventSupport.java Thu Nov 23 20:50:12 2006
@@ -22,7 +22,6 @@
import org.apache.batik.dom.AbstractNode;
import org.apache.batik.dom.events.AbstractEvent;
-import org.apache.batik.dom.events.CustomEvent;
import org.apache.batik.dom.events.EventListenerList;
import org.apache.batik.dom.events.EventSupport;
import org.apache.batik.dom.events.NodeEventTarget;
@@ -191,7 +190,7 @@
* <code>dispatchEvent</code> is called.
*
* @param target the target node
- * @param e Specifies the event type, behavior, and contextual
+ * @param evt Specifies the event type, behavior, and contextual
* information to be used in processing the event.
*
* @return The return value of <code>dispatchEvent</code>
@@ -208,30 +207,19 @@
* <code>null</code> or an empty string will also trigger this
* exception.
*/
- public boolean dispatchEvent(NodeEventTarget target, Event e)
+ public boolean dispatchEvent(NodeEventTarget target, Event evt)
throws EventException {
// System.err.println("\t[] dispatching " + e.getType() + " on " + ((Node) target).getNodeName());
- if (e == null) {
+ if (evt == null) {
return false;
}
- AbstractEvent aevt = null;
- CustomEvent ce = null;
- boolean isCustom;
- if (e instanceof CustomEvent) {
- isCustom = true;
- ce = (CustomEvent) e;
- } else if (e instanceof org.w3c.dom.events.CustomEvent) {
- isCustom = true;
- ce = new WrappedEvent((org.w3c.dom.events.CustomEvent) e);
- } else if (e instanceof AbstractEvent) {
- isCustom = false;
- aevt = (AbstractEvent) e;
- } else {
+ if (!(evt instanceof AbstractEvent)) {
throw createEventException
(DOMException.NOT_SUPPORTED_ERR,
"unsupported.event",
new Object[] {});
}
+ AbstractEvent e = (AbstractEvent) evt;
String type = e.getType();
if (type == null || type.length() == 0) {
throw createEventException
@@ -240,22 +228,15 @@
new Object[] {});
}
// fix event status
- if (!isCustom) {
- setTarget(aevt, target);
- stopPropagation(aevt, false);
- stopImmediatePropagation(aevt, false);
- preventDefault(aevt, false);
- } else {
- ce.setTarget(target);
- }
+ setTarget(e, target);
+ stopPropagation(e, false);
+ stopImmediatePropagation(e, false);
+ preventDefault(e, false);
// dump the tree hierarchy from top to the target
NodeEventTarget[] ancestors = getAncestors(target);
- int bubbleLimit = 0;
- if (aevt != null) {
- bubbleLimit = aevt.getBubbleLimit();
- }
+ int bubbleLimit = e.getBubbleLimit();
int minAncestor = 0;
- if (isSingleScopeEvent(aevt)) {
+ if (isSingleScopeEvent(e)) {
// DOM Mutation events are dispatched only within the
// one shadow scope
AbstractNode targetNode = (AbstractNode) target;
@@ -263,8 +244,8 @@
if (boundElement != null) {
minAncestor = ancestors.length;
while (minAncestor > 0) {
- AbstractNode ancestorNode
- = (AbstractNode) ancestors[minAncestor - 1];
+ AbstractNode ancestorNode =
+ (AbstractNode) ancestors[minAncestor - 1];
if (ancestorNode.getXblBoundElement() != boundElement) {
break;
}
@@ -287,14 +268,7 @@
// }
// System.err.println(((Node) ancestors[i]).getNodeName());
// }
- Object evts = getRetargettedEvents(target, ancestors, e, isCustom);
- CustomEvent[] ces = null;
- AbstractEvent[] aevts = null;
- if (isCustom) {
- ces = (CustomEvent[]) evts;
- } else {
- aevts = (AbstractEvent[]) evts;
- }
+ AbstractEvent[] es = getRetargettedEvents(target, ancestors, e);
boolean preventDefault = false;
// CAPTURING_PHASE : fire event listeners from top to EventTarget
HashSet stoppedGroups = new HashSet();
@@ -302,111 +276,61 @@
for (int i = 0; i < minAncestor; i++) {
NodeEventTarget node = ancestors[i];
// System.err.println("\t-- CAPTURING " + e.getType() + " " + ((Node) node).getNodeName());
- if (isCustom) {
- ces[i].setDispatchState(node, Event.CAPTURING_PHASE);
- fireImplementationEventListeners(node, ces[i], true, true);
- } else {
- setCurrentTarget(aevts[i], node);
- setEventPhase(aevts[i], Event.CAPTURING_PHASE);
- fireImplementationEventListeners(node, aevts[i], true, false);
- }
+ setCurrentTarget(es[i], node);
+ setEventPhase(es[i], Event.CAPTURING_PHASE);
+ fireImplementationEventListeners(node, es[i], true);
}
for (int i = minAncestor; i < ancestors.length; i++) {
NodeEventTarget node = ancestors[i];
// System.err.println("\t-- * CAPTURING " + e.getType() + " " + ((Node) node).getNodeName());
- if (isCustom) {
- ces[i].setDispatchState(node, Event.CAPTURING_PHASE);
- fireImplementationEventListeners(node, ces[i], true, true);
- fireEventListeners(node, ces[i], true,
- stoppedGroups, toBeStoppedGroups, true);
- fireHandlerGroupEventListeners
- (node, ces[i], true,
- stoppedGroups, toBeStoppedGroups, true);
- preventDefault = preventDefault || ces[i].isDefaultPrevented();
- } else {
- setCurrentTarget(aevts[i], node);
- setEventPhase(aevts[i], Event.CAPTURING_PHASE);
- fireImplementationEventListeners(node, aevts[i], true, false);
- fireEventListeners(node, aevts[i], true,
- stoppedGroups, toBeStoppedGroups, false);
- fireHandlerGroupEventListeners
- (node, aevts[i], true,
- stoppedGroups, toBeStoppedGroups, false);
- preventDefault = preventDefault || aevts[i].isDefaultPrevented();
- }
+ setCurrentTarget(es[i], node);
+ setEventPhase(es[i], Event.CAPTURING_PHASE);
+ fireImplementationEventListeners(node, es[i], true);
+ fireEventListeners(node, es[i], true, stoppedGroups,
+ toBeStoppedGroups);
+ fireHandlerGroupEventListeners(node, es[i], true, stoppedGroups,
+ toBeStoppedGroups);
+ preventDefault = preventDefault || es[i].getDefaultPrevented();
stoppedGroups.addAll(toBeStoppedGroups);
toBeStoppedGroups.clear();
}
// AT_TARGET : fire local event listeners
// System.err.println("\t-- * AT_TARGET " + e.getType() + " " + ((Node) target).getNodeName());
- if (isCustom) {
- ce.setDispatchState(target, Event.AT_TARGET);
- } else {
- setEventPhase(aevt, Event.AT_TARGET);
- setCurrentTarget(aevt, target);
- }
- fireImplementationEventListeners(target, e, false, isCustom);
- fireEventListeners(target, e, false,
- stoppedGroups, toBeStoppedGroups, isCustom);
- fireHandlerGroupEventListeners
- (node, e, false, stoppedGroups, toBeStoppedGroups, isCustom);
+ setEventPhase(e, Event.AT_TARGET);
+ setCurrentTarget(e, target);
+ fireImplementationEventListeners(target, e, false);
+ fireEventListeners(target, e, false, stoppedGroups,
+ toBeStoppedGroups);
+ fireHandlerGroupEventListeners(node, e, false, stoppedGroups,
+ toBeStoppedGroups);
stoppedGroups.addAll(toBeStoppedGroups);
toBeStoppedGroups.clear();
- if (isCustom) {
- preventDefault = preventDefault || ce.isDefaultPrevented();
- } else {
- preventDefault = preventDefault || aevt.isDefaultPrevented();
- }
+ preventDefault = preventDefault || e.getDefaultPrevented();
// BUBBLING_PHASE : fire event listeners from target to top
if (e.getBubbles()) {
for (int i = ancestors.length - 1; i >= minAncestor; i--) {
NodeEventTarget node = ancestors[i];
// System.err.println("\t-- * BUBBLING " + e.getType() + " " + ((Node) node).getNodeName());
- if (isCustom) {
- ces[i].setDispatchState(node, Event.BUBBLING_PHASE);
- fireImplementationEventListeners(node, ces[i], false, true);
- fireEventListeners(node, ces[i], false,
- stoppedGroups, toBeStoppedGroups,
- true);
- fireHandlerGroupEventListeners
- (node, ces[i], false,
- stoppedGroups, toBeStoppedGroups, true);
- preventDefault
- = preventDefault || ces[i].isDefaultPrevented();
- } else {
- setCurrentTarget(aevts[i], node);
- setEventPhase(aevts[i], Event.BUBBLING_PHASE);
- fireImplementationEventListeners
- (node, aevts[i], false, false);
- fireEventListeners(node, aevts[i], false,
- stoppedGroups, toBeStoppedGroups,
- isCustom);
- fireHandlerGroupEventListeners
- (node, aevts[i], false,
- stoppedGroups, toBeStoppedGroups, false);
- preventDefault
- = preventDefault || aevts[i].isDefaultPrevented();
- }
+ setCurrentTarget(es[i], node);
+ setEventPhase(es[i], Event.BUBBLING_PHASE);
+ fireImplementationEventListeners(node, es[i], false);
+ fireEventListeners(node, es[i], false, stoppedGroups,
+ toBeStoppedGroups);
+ fireHandlerGroupEventListeners
+ (node, es[i], false, stoppedGroups, toBeStoppedGroups);
+ preventDefault =
+ preventDefault || es[i].getDefaultPrevented();
stoppedGroups.addAll(toBeStoppedGroups);
toBeStoppedGroups.clear();
}
for (int i = minAncestor - 1; i >= 0; i--) {
NodeEventTarget node = ancestors[i];
// System.err.println("\t-- BUBBLING " + e.getType() + " " + ((Node) node).getNodeName());
- if (isCustom) {
- ces[i].setDispatchState(node, Event.BUBBLING_PHASE);
- fireImplementationEventListeners
- (node, ces[i], false, false);
- preventDefault
- = preventDefault || ces[i].isDefaultPrevented();
- } else {
- setCurrentTarget(aevts[i], node);
- setEventPhase(aevts[i], Event.BUBBLING_PHASE);
- fireImplementationEventListeners
- (node, aevts[i], false, false);
- preventDefault
- = preventDefault || aevts[i].isDefaultPrevented();
- }
+ setCurrentTarget(es[i], node);
+ setEventPhase(es[i], Event.BUBBLING_PHASE);
+ fireImplementationEventListeners(node, es[i], false);
+ preventDefault =
+ preventDefault || es[i].getDefaultPrevented();
}
}
return preventDefault;
@@ -416,18 +340,17 @@
* Fires the event handlers registered on an XBL 'handlerGroup' element.
*/
protected void fireHandlerGroupEventListeners(NodeEventTarget node,
- Event e,
+ AbstractEvent e,
boolean useCapture,
HashSet stoppedGroups,
- HashSet toBeStoppedGroups,
- boolean isCustom) {
+ HashSet toBeStoppedGroups) {
// get the XBL definitions in effect for the event target
NodeList defs = ((NodeXBL) node).getXblDefinitions();
for (int j = 0; j < defs.getLength(); j++) {
// find the 'handlerGroup' element
Node n = defs.item(j).getFirstChild();
- while (n != null
- && !(n instanceof XBLOMHandlerGroupElement)) {
+ while (n != null &&
+ !(n instanceof XBLOMHandlerGroupElement)) {
n = n.getNextSibling();
}
if (n == null) {
@@ -448,7 +371,7 @@
// dump event listeners, we get the registered listeners NOW
EventListenerList.Entry[] listeners = list.getEventListeners();
fireEventListeners(node, e, listeners, stoppedGroups,
- toBeStoppedGroups, isCustom);
+ toBeStoppedGroups);
}
}
@@ -466,66 +389,45 @@
* in the event flow. The Event objects are retargetted if an sXBL
* shadow scope is crossed and the event is not a DOM mutation event.
*/
- protected Event[] getRetargettedEvents(NodeEventTarget target,
- NodeEventTarget[] ancestors,
- Event evt,
- boolean isCustom) {
- boolean singleScope = isSingleScopeEvent(evt);
+ protected AbstractEvent[] getRetargettedEvents(NodeEventTarget target,
+ NodeEventTarget[] ancestors,
+ AbstractEvent e) {
+ boolean singleScope = isSingleScopeEvent(e);
AbstractNode targetNode = (AbstractNode) target;
- Event[] events = new Event[ancestors.length];
+ AbstractEvent[] es = new AbstractEvent[ancestors.length];
if (ancestors.length > 0) {
int index = ancestors.length - 1;
Node boundElement = targetNode.getXblBoundElement();
AbstractNode ancestorNode = (AbstractNode) ancestors[index];
- if (!singleScope
- && ancestorNode.getXblBoundElement() != boundElement) {
- events[index] = retargetEvent(evt, ancestors[index], isCustom);
+ if (!singleScope &&
+ ancestorNode.getXblBoundElement() != boundElement) {
+ es[index] = retargetEvent(e, ancestors[index]);
} else {
- events[index] = evt;
+ es[index] = e;
}
while (--index >= 0) {
ancestorNode = (AbstractNode) ancestors[index + 1];
boundElement = ancestorNode.getXblBoundElement();
- AbstractNode nextAncestorNode
- = (AbstractNode) ancestors[index];
+ AbstractNode nextAncestorNode = (AbstractNode) ancestors[index];
Node nextBoundElement = nextAncestorNode.getXblBoundElement();
if (!singleScope && nextBoundElement != boundElement) {
- events[index] = retargetEvent
- (events[index + 1], ancestors[index], isCustom);
+ es[index] = retargetEvent(es[index + 1], ancestors[index]);
} else {
- events[index] = events[index + 1];
+ es[index] = es[index + 1];
}
}
}
- if (isCustom) {
- CustomEvent[] ces = new CustomEvent[events.length];
- for (int i = 0; i < ces.length; i++) {
- ces[i] = (CustomEvent) events[i];
- }
- return ces;
- } else {
- AbstractEvent[] aevts = new AbstractEvent[events.length];
- for (int i = 0; i < aevts.length; i++) {
- aevts[i] = (AbstractEvent) events[i];
- }
- return aevts;
- }
+ return es;
}
/**
* Clones and retargets the given event.
*/
- protected Event retargetEvent(Event evt,
- NodeEventTarget target,
- boolean isCustom) {
- if (isCustom) {
- CustomEvent ce = ((CustomEvent) evt).retarget(target);
- return ce;
- } else {
- AbstractEvent ae = ((AbstractEvent) evt).cloneEvent();
- setTarget(ae, target);
- return ae;
- }
+ protected AbstractEvent retargetEvent(AbstractEvent e,
+ NodeEventTarget target) {
+ AbstractEvent clonedEvent = e.cloneEvent();
+ setTarget(clonedEvent, target);
+ return clonedEvent;
}
/**
@@ -546,23 +448,22 @@
* target.
*/
protected void fireImplementationEventListeners(NodeEventTarget node,
- Event e,
- boolean useCapture,
- boolean isCustom) {
+ AbstractEvent e,
+ boolean useCapture) {
String type = e.getType();
XBLEventSupport support = (XBLEventSupport) node.getEventSupport();
// check if the event support has been instantiated
if (support == null) {
return;
}
- EventListenerList list
- = support.getImplementationEventListeners(type, useCapture);
+ EventListenerList list =
+ support.getImplementationEventListeners(type, useCapture);
// check if the event listeners list is not empty
if (list == null) {
return;
}
// dump event listeners, we get the registered listeners NOW
EventListenerList.Entry[] listeners = list.getEventListeners();
- fireEventListeners(node, e, listeners, null, null, isCustom);
+ fireEventListeners(node, e, listeners, null, null);
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/EventTargetWrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/EventTargetWrapper.java?view=diff&rev=478769&r1=478768&r2=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/EventTargetWrapper.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/EventTargetWrapper.java Thu Nov 23 20:50:12 2006
@@ -23,7 +23,6 @@
import java.util.WeakHashMap;
import org.apache.batik.dom.AbstractNode;
-import org.apache.batik.dom.events.CustomEvent;
import org.apache.batik.script.ScriptEventWrapper;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextAction;
@@ -100,190 +99,6 @@
}
}
- /**
- * A Java object wrapper for a javascript custom event object.
- */
- static class ObjectCustomEvent implements CustomEvent, ScriptEventWrapper {
-
- public Scriptable scriptable;
- public RhinoInterpreter interpreter;
- protected Map eventMap;
-
- public ObjectCustomEvent(Scriptable s,
- RhinoInterpreter interpreter,
- Map eventMap) {
- scriptable = s;
- this.interpreter = interpreter;
- this.eventMap = eventMap;
- }
-
- public Object getEventObject() {
- return scriptable;
- }
-
- protected Object call(String fn) {
- return call(fn, null);
- }
-
- protected Object call(final String fn, final Object[] args) {
- ContextAction callMethodAction = new ContextAction() {
- public Object run(Context cx) {
- return ScriptableObject.callMethod(scriptable, fn, args);
- }
- };
- return interpreter.call(callMethodAction);
- }
-
- public String getType() {
- return (String) Context.jsToJava
- (scriptable.get("type", scriptable), String.class);
- }
-
- public EventTarget getTarget() {
- Object target = scriptable.get("target", scriptable);
- if (target instanceof NativeJavaObject) {
- target = ((NativeJavaObject) target).unwrap();
- }
- return (EventTarget) target;
- }
-
- public void setTarget(EventTarget target) {
- scriptable.put("target", scriptable,
- Context.toObject(target, scriptable));
- }
-
- public EventTarget getCurrentTarget() {
- Object target = scriptable.get("currentTarget", scriptable);
- if (target instanceof NativeJavaObject) {
- target = ((NativeJavaObject) target).unwrap();
- }
- return (EventTarget) target;
- }
-
- public short getEventPhase() {
- Object ep = scriptable.get("eventPhase", scriptable);
- Integer i = (Integer) Context.jsToJava(ep, Integer.class);
- return (short) i.intValue();
- }
-
- public boolean getBubbles() {
- Object ep = scriptable.get("bubbles", scriptable);
- Boolean i = (Boolean) Context.jsToJava(ep, Boolean.class);
- return i.booleanValue();
- }
-
- public boolean getCancelable() {
- Object ep = scriptable.get("cancelable", scriptable);
- Boolean i = (Boolean) Context.jsToJava(ep, Boolean.class);
- return i.booleanValue();
- }
-
- public long getTimeStamp() {
- Object ts = scriptable.get("timeStamp", scriptable);
- Double d = (Double) Context.jsToJava(ts, Double.class);
- return (long) d.doubleValue();
- }
-
- public void stopPropagation() {
- call("stopPropagation");
- }
-
- public void preventDefault() {
- call("preventDefault");
- }
-
- public void initEvent(String t, boolean b, boolean c) {
- call("initEvent", new Object[] { t,
- b ? Boolean.TRUE : Boolean.FALSE,
- c ? Boolean.TRUE : Boolean.FALSE });
- }
-
- public String getNamespaceURI() {
- return (String) Context.jsToJava
- (scriptable.get("namespaceURI", scriptable), String.class);
- }
-
- public boolean isCustom() {
- Boolean b = (Boolean) Context.jsToJava
- (call("isCustom"), Boolean.class);
- return b.booleanValue();
- }
-
- public void stopImmediatePropagation() {
- call("stopImmediatePropagation");
- }
-
- public boolean isDefaultPrevented() {
- Boolean b = (Boolean) Context.jsToJava
- (call("isDefaultPrevented"), Boolean.class);
- return b.booleanValue();
- }
-
- public void initEventNS(String ns, String t, boolean b, boolean c) {
- call("initEventNS", new Object[] { ns, t,
- b ? Boolean.TRUE : Boolean.FALSE,
- c ? Boolean.TRUE : Boolean.FALSE });
- }
-
- public void setDispatchState(EventTarget t, short phase) {
- call("setDispatchState", new Object[] { t, new Double(phase) });
- }
-
- public boolean isPropagationStopped() {
- Boolean b = (Boolean) Context.jsToJava
- (call("isPropagationStopped"), Boolean.class);
- return b.booleanValue();
- }
-
- public boolean isImmediatePropagationStopped() {
- Boolean b = (Boolean) Context.jsToJava
- (call("isImmediatePropagationStopped"), Boolean.class);
- return b.booleanValue();
- }
-
- public void resumePropagation() {
- call("resumePropagation");
- }
-
- public CustomEvent retarget(EventTarget target) {
- Object ret = call("cloneEventObject", new Object[] { target });
- if (ret instanceof ScriptableObject) {
- ScriptableObject e = (ScriptableObject) ret;
- e.put("originalEvent", e, scriptable);
- e.put("target", e, Context.toObject(target, scriptable));
- e.put("type", e,
- scriptable.get("type", scriptable));
- e.put("currentTarget", e,
- scriptable.get("currentTarget", scriptable));
- e.put("eventPhase", e,
- scriptable.get("eventPhase", scriptable));
- e.put("bubbles", e,
- scriptable.get("bubbles", scriptable));
- e.put("cancelable", e,
- scriptable.get("cancelable", scriptable));
- e.put("timeStamp", e,
- scriptable.get("timeStamp", scriptable));
- e.put("namespaceURI", e,
- scriptable.get("namespaceURI", scriptable));
- CustomEvent evt = new ObjectCustomEvent((NativeObject) ret,
- interpreter,
- eventMap);
- eventMap.put(ret, new SoftReference(evt));
- return evt;
- }
- // XXX some error here
- return null;
- }
-
- public Event getOriginalEvent() {
- Object target = scriptable.get("target", scriptable);
- if (target instanceof NativeJavaObject) {
- target = ((NativeJavaObject) target).unwrap();
- }
- return (Event) target;
- }
- }
-
abstract static class FunctionProxy implements Function {
protected Function delegate;
@@ -588,32 +403,6 @@
}
}
- static class FunctionDispatchProxy extends FunctionProxy {
- protected Map eventMap;
- protected RhinoInterpreter interpreter;
- FunctionDispatchProxy(RhinoInterpreter interpreter,
- Function delegate, Map eventMap) {
- super(delegate);
- this.eventMap = eventMap;
- this.interpreter = interpreter;
- }
-
- public Object call(Context ctx, Scriptable scope,
- Scriptable thisObj, Object[] args) {
- NativeJavaObject njo = (NativeJavaObject) thisObj;
- if (args[0] instanceof NativeObject) {
- Event evt = new ObjectCustomEvent((NativeObject) args[0],
- interpreter,
- eventMap);
- eventMap.put(args[0], new SoftReference(evt));
- args[0] = Context.jsToJava(args[0], Scriptable.class);
- ((EventTarget) njo.unwrap()).dispatchEvent(evt);
- return Undefined.instance;
- }
- return delegate.call(ctx, scope, thisObj, args);
- }
- }
-
// the keys are the underlying Java object, in order
// to remove potential memory leaks use a WeakHashMap to allow
// to collect entries as soon as the underlying Java object is
@@ -624,7 +413,6 @@
public static final String ADDNS_NAME = "addEventListenerNS";
public static final String REMOVE_NAME = "removeEventListener";
public static final String REMOVENS_NAME = "removeEventListenerNS";
- public static final String DISPATCH_NAME = "dispatchEvent";
protected RhinoInterpreter interpreter;
EventTargetWrapper(Scriptable scope, EventTarget object,
@@ -653,8 +441,6 @@
(Function) method, initMap());
} else if (name.equals(REMOVENS_NAME)) {
method = new FunctionRemoveNSProxy((Function) method, initMap());
- } else if (name.equals(DISPATCH_NAME)) {
- method = new FunctionDispatchProxy(interpreter, (Function) method, initMap());
}
return method;
}
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/CustomEvent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/CustomEvent.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/CustomEvent.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/CustomEvent.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The CustomEvent interface is the recommended interface for
+ * application-specific event types. Unlike the <code>Event</code>
+ * interface, it allows applications to provide contextual information about
+ * the event type. Application-specific event types should have an
+ * associated namespace to avoid clashes with future general-purpose event
+ * types.
+ * <p> To create an instance of the <code>CustomEvent</code> interface, use
+ * the <code>DocumentEvent.createEvent("CustomEvent")</code> method call.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 3
+ */
+public interface CustomEvent extends Event {
+ /**
+ * Specifies some detail information about the <code>Event</code>.
+ */
+ public Object getDetail();
+
+ /**
+ * The <code>initCustomEventNS</code> method is used to initialize the
+ * value of a <code>CustomEvent</code> object and has the same behavior
+ * as <code>Event.initEventNS()</code>.
+ * @param namespaceURI Refer to the <code>Event.initEventNS()</code>
+ * method for a description of this parameter.
+ * @param typeArg Refer to the <code>Event.initEventNS()</code> method
+ * for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>Event.initEventNS()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>Event.initEventNS()</code>
+ * method for a description of this parameter.
+ * @param detailArg Specifies <code>CustomEvent.detail</code>. This
+ * value may be <code>null</code>.
+ */
+ public void initCustomEventNS(String namespaceURI,
+ String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ Object detailArg);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/CustomEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/DocumentEvent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/DocumentEvent.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/DocumentEvent.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/DocumentEvent.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+import org.w3c.dom.DOMException;
+
+/**
+ * The <code>DocumentEvent</code> interface provides a mechanism by which the
+ * user can create an <code>Event</code> object of a type supported by the
+ * implementation. If the feature "Events" is supported by the
+ * <code>Document</code> object, the <code>DocumentEvent</code> interface
+ * must be implemented on the same object. If the feature "+Events" is
+ * supported by the <code>Document</code> object, an object that supports
+ * the <code>DocumentEvent</code> interface must be returned by invoking the
+ * method <code>Node.getFeature("+Events", "3.0")</code> on the
+ * <code>Document</code> object.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public interface DocumentEvent {
+ /**
+ *
+ * @param eventType The <code>eventType</code> parameter specifies the
+ * name of the DOM Events interface to be supported by the created
+ * event object, e.g. <code>"Event"</code>, <code>"MouseEvent"</code>,
+ * <code>"MutationEvent"</code> and so on. If the <code>Event</code>
+ * is to be dispatched via the <code>EventTarget.dispatchEvent()</code>
+ * method the appropriate event init method must be called after
+ * creation in order to initialize the <code>Event</code>'s values.
+ * As an example, a user wishing to synthesize some kind of
+ * <code>UIEvent</code> would invoke
+ * <code>DocumentEvent.createEvent("UIEvent")</code>. The
+ * <code>UIEvent.initUIEventNS()</code> method could then be called on
+ * the newly created <code>UIEvent</code> object to set the specific
+ * type of user interface event to be dispatched, DOMActivate for
+ * example, and set its context information, e.g.
+ * <code>UIEvent.detail</code> in this example.
+ * <p ><b>Note:</b> For backward compatibility reason, "UIEvents",
+ * "MouseEvents", "MutationEvents", and "HTMLEvents" feature names are
+ * valid values for the parameter <code>eventType</code> and represent
+ * respectively the interfaces "UIEvent", "MouseEvent",
+ * "MutationEvent", and "Event".
+ * @return The newly created event object.
+ * @exception DOMException
+ * NOT_SUPPORTED_ERR: Raised if the implementation does not support the
+ * <code>Event</code> interface requested.
+ */
+ public Event createEvent(String eventType)
+ throws DOMException;
+
+ /**
+ * Test if the implementation can generate events of a specified type.
+ * @param namespaceURI Specifies the <code>Event.namespaceURI</code> of
+ * the event.
+ * @param type Specifies the <code>Event.type</code> of the event.
+ * @return <code>true</code> if the implementation can generate and
+ * dispatch this event type, <code>false</code> otherwise.
+ * @since DOM Level 3
+ */
+ public boolean canDispatch(String namespaceURI,
+ String type);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/DocumentEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/Event.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/Event.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/Event.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/Event.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The <code>Event</code> interface is used to provide contextual information
+ * about an event to the listener processing the event. An object which
+ * implements the <code>Event</code> interface is passed as the parameter to
+ * an <code>EventListener</code>. More specific context information is
+ * passed to event listeners by deriving additional interfaces from
+ * <code>Event</code> which contain information directly relating to the
+ * type of event they represent. These derived interfaces are also
+ * implemented by the object passed to the event listener.
+ * <p> To create an instance of the <code>Event</code> interface, use the
+ * <code>DocumentEvent.createEvent("Event")</code> method call.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public interface Event {
+ // PhaseType
+ /**
+ * The current event phase is the capture phase.
+ */
+ public static final short CAPTURING_PHASE = 1;
+ /**
+ * The current event is in the target phase, i.e. it is being evaluated
+ * at the event target.
+ */
+ public static final short AT_TARGET = 2;
+ /**
+ * The current event phase is the bubbling phase.
+ */
+ public static final short BUBBLING_PHASE = 3;
+
+ /**
+ * The local name of the event type. The name must be an <a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/#NT-NCName'>NCName</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
+ * and is case-sensitive.
+ */
+ public String getType();
+
+ /**
+ * Used to indicate the event target. This attribute contains the target
+ * node when used with the .
+ */
+ public EventTarget getTarget();
+
+ /**
+ * Used to indicate the <code>EventTarget</code> whose
+ * <code>EventListeners</code> are currently being processed. This is
+ * particularly useful during the capture and bubbling phases. This
+ * attribute could contain the target node or a target ancestor when
+ * used with the .
+ */
+ public EventTarget getCurrentTarget();
+
+ /**
+ * Used to indicate which phase of event flow is currently being
+ * accomplished.
+ */
+ public short getEventPhase();
+
+ /**
+ * Used to indicate whether or not an event is a bubbling event. If the
+ * event can bubble the value is <code>true</code>, otherwise the value
+ * is <code>false</code>.
+ */
+ public boolean getBubbles();
+
+ /**
+ * Used to indicate whether or not an event can have its default action
+ * prevented (see also ). If the default action can be prevented the
+ * value is <code>true</code>, otherwise the value is <code>false</code>
+ * .
+ */
+ public boolean getCancelable();
+
+ /**
+ * Used to specify the time at which the event was created in
+ * milliseconds relative to 1970-01-01T00:00:00Z. Due to the fact that
+ * some systems may not provide this information the value of
+ * <code>timeStamp</code> may be not available for all events. When not
+ * available, the value is <code>0</code>.
+ */
+ public long getTimeStamp();
+
+ /**
+ * This method is used to prevent event listeners of the same group to be
+ * triggered but its effect is deferred until all event listeners
+ * attached on the <code>Event.currentTarget</code> have been triggered
+ * (see ). Once it has been called, further calls to that method have no
+ * additional effect.
+ * <p ><b>Note:</b> This method does not prevent the default action from
+ * being invoked; use <code>Event.preventDefault()</code> for that
+ * effect.
+ */
+ public void stopPropagation();
+
+ /**
+ * If an event is cancelable, the <code>preventDefault</code> method is
+ * used to signify that the event is to be canceled, meaning any default
+ * action normally taken by the implementation as a result of the event
+ * will not occur (see also ), and thus independently of event groups.
+ * Calling this method for a non-cancelable event has no effect.
+ * <p ><b>Note:</b> This method does not stop the event propagation; use
+ * <code>Event.stopPropagation()</code> or
+ * <code>Event.stopImmediatePropagation()</code> for that effect.
+ */
+ public void preventDefault();
+
+ /**
+ * The <code>initEvent</code> method is used to initialize the value of
+ * an <code>Event</code> created through the
+ * <code>DocumentEvent.createEvent</code> method. This method may only
+ * be called before the <code>Event</code> has been dispatched via the
+ * <code>EventTarget.dispatchEvent()</code> method. If the method is
+ * called several times before invoking
+ * <code>EventTarget.dispatchEvent</code>, only the final invocation
+ * takes precedence. This method has no effect if called after the event
+ * has been dispatched. If called from a subclass of the
+ * <code>Event</code> interface only the values specified in this method
+ * are modified, all other attributes are left unchanged.
+ * <br> This method sets the <code>Event.type</code> attribute to
+ * <code>eventTypeArg</code>, and <code>Event.namespaceURI</code> to
+ * <code>null</code>. To initialize an event with a namespace URI, use
+ * the <code>Event.initEventNS()</code> method.
+ * @param eventTypeArg Specifies <code>Event.type</code>, the local name
+ * of the event type.
+ * @param canBubbleArg Specifies <code>Event.bubbles</code>. This
+ * parameter overrides the intrinsic bubbling behavior of the event.
+ * @param cancelableArg Specifies <code>Event.cancelable</code>. This
+ * parameter overrides the intrinsic cancelable behavior of the event.
+ *
+ */
+ public void initEvent(String eventTypeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg);
+
+ /**
+ * The namespace URI associated with this event at creation time, or
+ * <code>null</code> if it is unspecified.
+ * <br> For events initialized with a DOM Level 2 Events method, such as
+ * <code>Event.initEvent()</code>, this is always <code>null</code>.
+ * @since DOM Level 3
+ */
+ public String getNamespaceURI();
+
+ /**
+ * This method is used to prevent event listeners of the same group to be
+ * triggered and, unlike <code>Event.stopPropagation()</code> its effect
+ * is immediate (see ). Once it has been called, further calls to that
+ * method have no additional effect.
+ * <p ><b>Note:</b> This method does not prevent the default action from
+ * being invoked; use <code>Event.preventDefault()</code> for that
+ * effect.
+ * @since DOM Level 3
+ */
+ public void stopImmediatePropagation();
+
+ /**
+ * Used to indicate whether <code>Event.preventDefault()</code> has been
+ * called for this event.
+ * @since DOM Level 3
+ */
+ public boolean getDefaultPrevented();
+
+ /**
+ * The <code>initEventNS</code> method is used to initialize the value of
+ * an <code>Event</code> object and has the same behavior as
+ * <code>Event.initEvent()</code>.
+ * @param namespaceURIArg Specifies <code>Event.namespaceURI</code>, the
+ * namespace URI associated with this event, or <code>null</code> if
+ * no namespace.
+ * @param eventTypeArg Refer to the <code>Event.initEvent()</code>
+ * method for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>Event.initEvent()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>Event.initEvent()</code>
+ * method for a description of this parameter.
+ * @since DOM Level 3
+ */
+ public void initEventNS(String namespaceURIArg,
+ String eventTypeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/Event.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventException.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventException.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventException.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * Event operations may throw an <code>EventException</code> as specified in
+ * their method descriptions.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public class EventException extends RuntimeException {
+ public EventException(short code, String message) {
+ super(message);
+ this.code = code;
+ }
+ public short code;
+ // EventExceptionCode
+ /**
+ * If the <code>Event.type</code> was not specified by initializing the
+ * event before the method was called. Specification of the
+ * <code>Event.type</code> as <code>null</code> or an empty string will
+ * also trigger this exception.
+ */
+ public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0;
+ /**
+ * If the <code>Event</code> object is already dispatched in the tree.
+ * @since DOM Level 3
+ */
+ public static final short DISPATCH_REQUEST_ERR = 1;
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventException.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventListener.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventListener.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventListener.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventListener.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The <code>EventListener</code> interface is the primary way for handling
+ * events. Users implement the <code>EventListener</code> interface and
+ * register their event listener on an <code>EventTarget</code>. The users
+ * should also remove their <code>EventListener</code> from its
+ * <code>EventTarget</code> after they have completed using the listener.
+ * <p> Copying a <code>Node</code>, with methods such as
+ * <code>Node.cloneNode</code> or <code>Range.cloneContents</code>, does not
+ * copy the event listeners attached to it. Event listeners must be attached
+ * to the newly created <code>Node</code> afterwards if so desired.
+ * <p> Moving a <code>Node</code>, with methods <code>Document.adoptNode</code>
+ * , <code>Node.appendChild</code>, or <code>Range.extractContents</code>,
+ * does not affect the event listeners attached to it.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public interface EventListener {
+ /**
+ * This method is called whenever an event occurs of the event type for
+ * which the <code>EventListener</code> interface was registered.
+ * @param evt The <code>Event</code> contains contextual information
+ * about the event.
+ */
+ public void handleEvent(Event evt);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventTarget.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventTarget.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventTarget.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventTarget.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+import org.w3c.dom.DOMException;
+
+/**
+ * The <code>EventTarget</code> interface is implemented by all the objects
+ * which could be event targets in an implementation which supports the .
+ * The interface allows registration and removal of event listeners, and
+ * dispatch of events to an event target.
+ * <p> When used with , this interface is implemented by all target nodes and
+ * target ancestors, i.e. all DOM <code>Nodes</code> of the tree support
+ * this interface when the implementation conforms to DOM Level 3 Events
+ * and, therefore, this interface can be obtained by using binding-specific
+ * casting methods on an instance of the <code>Node</code> interface.
+ * <p> Invoking <code>addEventListener</code> or
+ * <code>addEventListenerNS</code> repeatedly on the same
+ * <code>EventTarget</code> with the same values for the parameters
+ * <code>namespaceURI</code>, <code>type</code>, <code>listener</code>, and
+ * <code>useCapture</code> has no effect. Doing so does not cause the
+ * <code>EventListener</code> to be called more than once and does not cause
+ * a change in the triggering order. In order to register a listener for a
+ * different event group () the previously registered listener has to be
+ * removed first.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public interface EventTarget {
+ /**
+ * This method allows the registration of an event listener in the
+ * default group and, depending on the <code>useCapture</code>
+ * parameter, on the capture phase of the DOM event flow or its target
+ * and bubbling phases. Invoking this method is equivalent to invoking
+ * <code>addEventListenerNS</code> with the same values for the
+ * parameters <code>type</code>, <code>listener</code>, and
+ * <code>useCapture</code>, and the value <code>null</code> for the
+ * parameters <code>namespaceURI</code> and <code>evtGroup</code>.
+ * @param type Specifies the <code>Event.type</code> associated with the
+ * event for which the user is registering.
+ * @param listener The <code>listener</code> parameter takes an object
+ * implemented by the user which implements the
+ * <code>EventListener</code> interface and contains the method to be
+ * called when the event occurs.
+ * @param useCapture If true, <code>useCapture</code> indicates that the
+ * user wishes to add the event listener for the capture phase only,
+ * i.e. this event listener will not be triggered during the target
+ * and bubbling phases. If <code>false</code>, the event listener will
+ * only be triggered during the target and bubbling phases.
+ */
+ public void addEventListener(String type,
+ EventListener listener,
+ boolean useCapture);
+
+ /**
+ * This method allows the removal of event listeners from the default
+ * group. Calling <code>removeEventListener</code> with arguments which
+ * do not identify any currently registered <code>EventListener</code>
+ * on the <code>EventTarget</code> has no effect. The
+ * <code>Event.namespaceURI</code> for which the user registered the
+ * event listener is implied and is <code>null</code>.
+ * <p ><b>Note:</b> Event listeners registered for other event groups
+ * than the default group cannot be removed using this method; see
+ * <code>EventTarget.removeEventListenerNS()</code> for that effect.
+ * @param type Specifies the <code>Event.type</code> for which the user
+ * registered the event listener.
+ * @param listener The <code>EventListener</code> to be removed.
+ * @param useCapture Specifies whether the <code>EventListener</code>
+ * being removed was registered for the capture phase or not. If a
+ * listener was registered twice, once for the capture phase and once
+ * for the target and bubbling phases, each must be removed
+ * separately. Removal of an event listener registered for the capture
+ * phase does not affect the same event listener registered for the
+ * target and bubbling phases, and vice versa.
+ */
+ public void removeEventListener(String type,
+ EventListener listener,
+ boolean useCapture);
+
+ /**
+ * This method allows the dispatch of events into the implementation's
+ * event model. The event target of the event is the
+ * <code>EventTarget</code> object on which <code>dispatchEvent</code>
+ * is called.
+ * @param evt The event to be dispatched.
+ * @return Indicates whether any of the listeners which handled the
+ * event called <code>Event.preventDefault()</code>. If
+ * <code>Event.preventDefault()</code> was called the returned value
+ * is <code>false</code>, else it is <code>true</code>.
+ * @exception EventException
+ * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event.type</code>
+ * was not specified by initializing the event before
+ * <code>dispatchEvent</code> was called. Specification of the
+ * <code>Event.type</code> as <code>null</code> or an empty string
+ * will also trigger this exception.
+ * <br> DISPATCH_REQUEST_ERR: Raised if the <code>Event</code> object is
+ * already being dispatched.
+ * @exception DOMException
+ * NOT_SUPPORTED_ERR: Raised if the <code>Event</code> object has not
+ * been created using <code>DocumentEvent.createEvent()</code>.
+ * <br> INVALID_CHARACTER_ERR: Raised if <code>Event.type</code> is not
+ * an <a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/#NT-NCName'>NCName</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
+ * .
+ * @version DOM Level 3
+ */
+ public boolean dispatchEvent(Event evt)
+ throws EventException, DOMException;
+
+ /**
+ * This method allows the registration of an event listener in a
+ * specified group or the default group and, depending on the
+ * <code>useCapture</code> parameter, on the capture phase of the DOM
+ * event flow or its target and bubbling phases.
+ * @param namespaceURI Specifies the <code>Event.namespaceURI</code>
+ * associated with the event for which the user is registering.
+ * @param type Refer to the <code>EventTarget.addEventListener()</code>
+ * method for a description of this parameter.
+ * @param listener Refer to the
+ * <code>EventTarget.addEventListener()</code> method for a
+ * description of this parameter.
+ * @param useCapture Refer to the
+ * <code>EventTarget.addEventListener()</code> method for a
+ * description of this parameter.
+ * @param evtGroup The object that represents the event group to
+ * associate with the <code>EventListener</code> (see also ). Use
+ * <code>null</code> to attach the event listener to the default
+ * group.
+ * @since DOM Level 3
+ */
+ public void addEventListenerNS(String namespaceURI,
+ String type,
+ EventListener listener,
+ boolean useCapture,
+ Object evtGroup);
+
+ /**
+ * This method allows the removal of an event listener, independently of
+ * the associated event group. Calling <code>removeEventListenerNS</code>
+ * with arguments which do not identify any currently registered
+ * <code>EventListener</code> on the <code>EventTarget</code> has no
+ * effect.
+ * @param namespaceURI Specifies the <code>Event.namespaceURI</code>
+ * associated with the event for which the user registered the event
+ * listener.
+ * @param type Refer to the
+ * <code>EventTarget.removeEventListener()</code> method for a
+ * description of this parameter.
+ * @param listener Refer to the
+ * <code>EventTarget.removeEventListener()</code> method for a
+ * description of this parameter.
+ * @param useCapture Refer to the
+ * <code>EventTarget.removeEventListener()</code> method for a
+ * description of this parameter.
+ * @since DOM Level 3
+ */
+ public void removeEventListenerNS(String namespaceURI,
+ String type,
+ EventListener listener,
+ boolean useCapture);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/EventTarget.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/KeyboardEvent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/KeyboardEvent.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/KeyboardEvent.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/KeyboardEvent.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+import org.w3c.dom.views.AbstractView;
+
+/**
+ * The <code>KeyboardEvent</code> interface provides specific contextual
+ * information associated with keyboard devices. Each keyboard event
+ * references a key using an identifier. Keyboard events are commonly
+ * directed at the element that has the focus.
+ * <p> The <code>KeyboardEvent</code> interface provides convenient attributes
+ * for some common modifiers keys: <code>KeyboardEvent.ctrlKey</code>,
+ * <code>KeyboardEvent.shiftKey</code>, <code>KeyboardEvent.altKey</code>,
+ * <code>KeyboardEvent.metaKey</code>. These attributes are equivalent to
+ * use the method
+ * <code>KeyboardEvent.getModifierState(keyIdentifierArg)</code> with
+ * "Control", "Shift", "Alt", or "Meta" respectively.
+ * <p> To create an instance of the <code>KeyboardEvent</code> interface, use
+ * the <code>DocumentEvent.createEvent("KeyboardEvent")</code> method call.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 3
+ */
+public interface KeyboardEvent extends UIEvent {
+ // KeyLocationCode
+ /**
+ * The key activation is not distinguished as the left or right version
+ * of the key, and did not originate from the numeric keypad (or did not
+ * originate with a virtual key corresponding to the numeric keypad).
+ * Example: the 'Q' key on a PC 101 Key US keyboard.
+ */
+ public static final int DOM_KEY_LOCATION_STANDARD = 0x00;
+ /**
+ * The key activated is in the left key location (there is more than one
+ * possible location for this key). Example: the left Shift key on a PC
+ * 101 Key US keyboard.
+ */
+ public static final int DOM_KEY_LOCATION_LEFT = 0x01;
+ /**
+ * The key activation is in the right key location (there is more than
+ * one possible location for this key). Example: the right Shift key on
+ * a PC 101 Key US keyboard.
+ */
+ public static final int DOM_KEY_LOCATION_RIGHT = 0x02;
+ /**
+ * The key activation originated on the numeric keypad or with a virtual
+ * key corresponding to the numeric keypad. Example: the '1' key on a PC
+ * 101 Key US keyboard located on the numeric pad.
+ */
+ public static final int DOM_KEY_LOCATION_NUMPAD = 0x03;
+
+ /**
+ * <code>keyIdentifier</code> holds the identifier of the key. The key
+ * identifiers are defined in Appendix A.2 "". Implementations that are
+ * unable to identify a key must use the key identifier
+ * <code>"Unidentified"</code>.
+ */
+ public String getKeyIdentifier();
+
+ /**
+ * The <code>keyLocation</code> attribute contains an indication of the
+ * location of they key on the device, as described in .
+ */
+ public int getKeyLocation();
+
+ /**
+ * <code>true</code> if the control (Ctrl) key modifier is activated.
+ */
+ public boolean getCtrlKey();
+
+ /**
+ * <code>true</code> if the shift (Shift) key modifier is activated.
+ */
+ public boolean getShiftKey();
+
+ /**
+ * <code>true</code> if the alternative (Alt) key modifier is activated.
+ * <p ><b>Note:</b> The Option key modifier on Macintosh systems must be
+ * represented using this key modifier.
+ */
+ public boolean getAltKey();
+
+ /**
+ * <code>true</code> if the meta (Meta) key modifier is activated.
+ * <p ><b>Note:</b> The Command key modifier on Macintosh systems must be
+ * represented using this key modifier.
+ */
+ public boolean getMetaKey();
+
+ /**
+ * This methods queries the state of a modifier using a key identifier.
+ * See also .
+ * @param keyIdentifierArg A modifier key identifier. Common modifier
+ * keys are <code>"Alt"</code>, <code>"AltGraph"</code>,
+ * <code>"CapsLock"</code>, <code>"Control"</code>, <code>"Meta"</code>
+ * , <code>"NumLock"</code>, <code>"Scroll"</code>, or
+ * <code>"Shift"</code>.
+ * <p ><b>Note:</b> If an application wishes to distinguish between
+ * right and left modifiers, this information could be deduced using
+ * keyboard events and <code>KeyboardEvent.keyLocation</code>.
+ * @return <code>true</code> if it is modifier key and the modifier is
+ * activated, <code>false</code> otherwise.
+ */
+ public boolean getModifierState(String keyIdentifierArg);
+
+ /**
+ * The <code>initKeyboardEvent</code> method is used to initialize the
+ * value of a <code>KeyboardEvent</code> object and has the same
+ * behavior as <code>UIEvent.initUIEvent()</code>. The value of
+ * <code>UIEvent.detail</code> remains undefined.
+ * @param typeArg Refer to the <code>UIEvent.initUIEvent()</code> method
+ * for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>UIEvent.initUIEvent()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>UIEvent.initUIEvent()</code>
+ * method for a description of this parameter.
+ * @param viewArg Refer to the <code>UIEvent.initUIEvent()</code> method
+ * for a description of this parameter.
+ * @param keyIdentifierArg Specifies
+ * <code>KeyboardEvent.keyIdentifier</code>.
+ * @param keyLocationArg Specifies <code>KeyboardEvent.keyLocation</code>
+ * .
+ * @param modifiersList A <a href='http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S'>white space</a> separated list of modifier key identifiers to be activated on this
+ * object.
+ */
+ public void initKeyboardEvent(String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ AbstractView viewArg,
+ String keyIdentifierArg,
+ int keyLocationArg,
+ String modifiersList);
+
+ /**
+ * The <code>initKeyboardEventNS</code> method is used to initialize the
+ * value of a <code>KeyboardEvent</code> object and has the same
+ * behavior as <code>UIEvent.initUIEventNS()</code>. The value of
+ * <code>UIEvent.detail</code> remains undefined.
+ * @param namespaceURI Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param typeArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param viewArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param keyIdentifierArg Refer to the
+ * <code>KeyboardEvent.initKeyboardEvent()</code> method for a
+ * description of this parameter.
+ * @param keyLocationArg Refer to the
+ * <code>KeyboardEvent.initKeyboardEvent()</code> method for a
+ * description of this parameter.
+ * @param modifiersList A <a href='http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S'>white space</a> separated list of modifier key identifiers to be activated on this
+ * object. As an example, <code>"Control Alt"</code> will activated
+ * the control and alt modifiers.
+ */
+ public void initKeyboardEventNS(String namespaceURI,
+ String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ AbstractView viewArg,
+ String keyIdentifierArg,
+ int keyLocationArg,
+ String modifiersList);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/KeyboardEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MouseEvent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MouseEvent.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MouseEvent.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MouseEvent.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+import org.w3c.dom.views.AbstractView;
+
+/**
+ * The <code>MouseEvent</code> interface provides specific contextual
+ * information associated with Mouse events.
+ * <p> In the case of nested elements mouse events are always targeted at the
+ * most deeply nested element. Ancestors of the targeted element may use
+ * bubbling to obtain notification of mouse events which occur within theirs
+ * descendent elements.
+ * <p> To create an instance of the <code>MouseEvent</code> interface, use the
+ * <code>DocumentEvent.createEvent("MouseEvent")</code> method call.
+ * <p ><b>Note:</b> When initializing <code>MouseEvent</code> objects using
+ * <code>initMouseEvent</code> or <code>initMouseEventNS</code>,
+ * implementations should use the client coordinates <code>clientX</code>
+ * and <code>clientY</code> for calculation of other coordinates (such as
+ * target coordinates exposed by DOM Level 0 implementations).
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public interface MouseEvent extends UIEvent {
+ /**
+ * The horizontal coordinate at which the event occurred relative to the
+ * origin of the screen coordinate system.
+ */
+ public int getScreenX();
+
+ /**
+ * The vertical coordinate at which the event occurred relative to the
+ * origin of the screen coordinate system.
+ */
+ public int getScreenY();
+
+ /**
+ * The horizontal coordinate at which the event occurred relative to the
+ * DOM implementation's client area.
+ */
+ public int getClientX();
+
+ /**
+ * The vertical coordinate at which the event occurred relative to the
+ * DOM implementation's client area.
+ */
+ public int getClientY();
+
+ /**
+ * <code>true</code> if the control (Ctrl) key modifier is activated.
+ */
+ public boolean getCtrlKey();
+
+ /**
+ * <code>true</code> if the shift (Shift) key modifier is activated.
+ */
+ public boolean getShiftKey();
+
+ /**
+ * <code>true</code> if the alt (alternative) key modifier is activated.
+ * <p ><b>Note:</b> The Option key modifier on Macintosh systems must be
+ * represented using this key modifier.
+ */
+ public boolean getAltKey();
+
+ /**
+ * <code>true</code> if the meta (Meta) key modifier is activated.
+ * <p ><b>Note:</b> The Command key modifier on Macintosh system must be
+ * represented using this meta key.
+ */
+ public boolean getMetaKey();
+
+ /**
+ * During mouse events caused by the depression or release of a mouse
+ * button, <code>button</code> is used to indicate which mouse button
+ * changed state. <code>0</code> indicates the normal button of the
+ * mouse (in general on the left or the one button on Macintosh mice,
+ * used to activate a button or select text). <code>2</code> indicates
+ * the contextual property (in general on the right, used to display a
+ * context menu) button of the mouse if present. <code>1</code>
+ * indicates the extra (in general in the middle and often combined with
+ * the mouse wheel) button. Some mice may provide or simulate more
+ * buttons, and values higher than <code>2</code> can be used to
+ * represent such buttons.
+ */
+ public short getButton();
+
+ /**
+ * Used to identify a secondary <code>EventTarget</code> related to a UI
+ * event, depending on the type of event.
+ */
+ public EventTarget getRelatedTarget();
+
+ /**
+ * The <code>initMouseEvent</code> method is used to initialize the value
+ * of a <code>MouseEvent</code> object and has the same behavior as
+ * <code>UIEvent.initUIEvent()</code>.
+ * @param typeArg Refer to the <code>UIEvent.initUIEvent()</code> method
+ * for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>UIEvent.initUIEvent()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>UIEvent.initUIEvent()</code>
+ * method for a description of this parameter.
+ * @param viewArg Refer to the <code>UIEvent.initUIEvent()</code> method
+ * for a description of this parameter.
+ * @param detailArg Refer to the <code>UIEvent.initUIEvent()</code>
+ * method for a description of this parameter.
+ * @param screenXArg Specifies <code>MouseEvent.screenX</code>.
+ * @param screenYArg Specifies <code>MouseEvent.screenY</code>.
+ * @param clientXArg Specifies <code>MouseEvent.clientX</code>.
+ * @param clientYArg Specifies <code>MouseEvent.clientY</code>.
+ * @param ctrlKeyArg Specifies <code>MouseEvent.ctrlKey</code>.
+ * @param altKeyArg Specifies <code>MouseEvent.altKey</code>.
+ * @param shiftKeyArg Specifies <code>MouseEvent.shiftKey</code>.
+ * @param metaKeyArg Specifies <code>MouseEvent.metaKey</code>.
+ * @param buttonArg Specifies <code>MouseEvent.button</code>.
+ * @param relatedTargetArg Specifies
+ * <code>MouseEvent.relatedTarget</code>. This value may be
+ * <code>null</code>.
+ */
+ public void initMouseEvent(String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ AbstractView viewArg,
+ int detailArg,
+ int screenXArg,
+ int screenYArg,
+ int clientXArg,
+ int clientYArg,
+ boolean ctrlKeyArg,
+ boolean altKeyArg,
+ boolean shiftKeyArg,
+ boolean metaKeyArg,
+ short buttonArg,
+ EventTarget relatedTargetArg);
+
+ /**
+ * This methods queries the state of a modifier using a key identifier.
+ * See also .
+ * @param keyIdentifierArg A modifier key identifier, as defined by the
+ * <code>KeyboardEvent.keyIdentifier</code> attribute. Common modifier
+ * keys are <code>"Alt"</code>, <code>"AltGraph"</code>,
+ * <code>"CapsLock"</code>, <code>"Control"</code>, <code>"Meta"</code>
+ * , <code>"NumLock"</code>, <code>"Scroll"</code>, or
+ * <code>"Shift"</code>.
+ * <p ><b>Note:</b> If an application wishes to distinguish between
+ * right and left modifiers, this information could be deduced using
+ * keyboard events and <code>KeyboardEvent.keyLocation</code>.
+ * @return <code>true</code> if it is modifier key and the modifier is
+ * activated, <code>false</code> otherwise.
+ * @since DOM Level 3
+ */
+ public boolean getModifierState(String keyIdentifierArg);
+
+ /**
+ * The <code>initMouseEventNS</code> method is used to initialize the
+ * value of a <code>MouseEvent</code> object and has the same behavior
+ * as <code>UIEvent.initUIEventNS()</code>.
+ * @param namespaceURI Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param typeArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param viewArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param detailArg Refer to the <code>UIEvent.initUIEventNS()</code>
+ * method for a description of this parameter.
+ * @param screenXArg Refer to the
+ * <code>MouseEvent.initMouseEvent()</code> method for a description
+ * of this parameter.
+ * @param screenYArg Refer to the
+ * <code>MouseEvent.initMouseEvent()</code> method for a description
+ * of this parameter.
+ * @param clientXArg Refer to the
+ * <code>MouseEvent.initMouseEvent()</code> method for a description
+ * of this parameter.
+ * @param clientYArg Refer to the
+ * <code>MouseEvent.initMouseEvent()</code> method for a description
+ * of this parameter.
+ * @param buttonArg Refer to the <code>MouseEvent.initMouseEvent()</code>
+ * method for a description of this parameter.
+ * @param relatedTargetArg Refer to the
+ * <code>MouseEvent.initMouseEvent()</code> method for a description
+ * of this parameter.
+ * @param modifiersList A <a href='http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S'>white space</a> separated list of modifier key identifiers to be activated on this
+ * object. As an example, <code>"Control Alt"</code> will activated
+ * the control and alt modifiers.
+ * @since DOM Level 3
+ */
+ public void initMouseEventNS(String namespaceURI,
+ String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ AbstractView viewArg,
+ int detailArg,
+ int screenXArg,
+ int screenYArg,
+ int clientXArg,
+ int clientYArg,
+ short buttonArg,
+ EventTarget relatedTargetArg,
+ String modifiersList);
+
+}
Propchange: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MouseEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MutationEvent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MutationEvent.java?view=auto&rev=478769
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MutationEvent.java (added)
+++ xmlgraphics/batik/trunk/sources/org/w3c/dom/events/MutationEvent.java Thu Nov 23 20:50:12 2006
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2006 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+import org.w3c.dom.Node;
+
+/**
+ * The <code>MutationEvent</code> interface provides specific contextual
+ * information associated with Mutation events.
+ * <p> To create an instance of the <code>MutationEvent</code> interface, use
+ * the <code>DocumentEvent.createEvent("MutationEvent")</code> method call.
+ * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
+ Document Object Model (DOM) Level 3 Events Specification
+ </a>.
+ * @since DOM Level 2
+ */
+public interface MutationEvent extends Event {
+ // attrChangeType
+ /**
+ * The <code>Attr</code> was modified in place.
+ */
+ public static final short MODIFICATION = 1;
+ /**
+ * The <code>Attr</code> was just added.
+ */
+ public static final short ADDITION = 2;
+ /**
+ * The <code>Attr</code> was just removed.
+ */
+ public static final short REMOVAL = 3;
+
+ /**
+ * <code>relatedNode</code> is used to identify a secondary node related
+ * to a mutation event. For example, if a mutation event is dispatched
+ * to a node indicating that its parent has changed, the
+ * <code>relatedNode</code> is the changed parent. If an event is
+ * instead dispatched to a subtree indicating a node was changed within
+ * it, the <code>relatedNode</code> is the changed node. In the case of
+ * the DOMAttrModified event it indicates the <code>Attr</code> node
+ * which was modified, added, or removed.
+ */
+ public Node getRelatedNode();
+
+ /**
+ * <code>prevValue</code> indicates the previous value of the
+ * <code>Attr</code> node in DOMAttrModified events, and of the
+ * <code>CharacterData</code> node in DOMCharacterDataModified events.
+ */
+ public String getPrevValue();
+
+ /**
+ * <code>newValue</code> indicates the new value of the <code>Attr</code>
+ * node in DOMAttrModified events, and of the <code>CharacterData</code>
+ * node in DOMCharacterDataModified events.
+ */
+ public String getNewValue();
+
+ /**
+ * <code>attrName</code> indicates the name of the changed
+ * <code>Attr</code> node in a DOMAttrModified event.
+ */
+ public String getAttrName();
+
+ /**
+ * <code>attrChange</code> indicates the type of change which triggered
+ * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
+ * , <code>ADDITION</code>, or <code>REMOVAL</code>.
+ */
+ public short getAttrChange();
+
+ /**
+ * The <code>initMutationEvent</code> method is used to initialize the
+ * value of a <code>MutationEvent</code> object and has the same
+ * behavior as <code>Event.initEvent()</code>.
+ * @param typeArg Refer to the <code>Event.initEvent()</code> method for
+ * a description of this parameter.
+ * @param canBubbleArg Refer to the <code>Event.initEvent()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>Event.initEvent()</code>
+ * method for a description of this parameter.
+ * @param relatedNodeArg Specifies <code>MutationEvent.relatedNode</code>
+ * .
+ * @param prevValueArg Specifies <code>MutationEvent.prevValue</code>.
+ * This value may be null.
+ * @param newValueArg Specifies <code>MutationEvent.newValue</code>.
+ * This value may be null.
+ * @param attrNameArg Specifies <code>MutationEvent.attrname</code>.
+ * This value may be null.
+ * @param attrChangeArg Specifies <code>MutationEvent.attrChange</code>.
+ * This value may be null.
+ */
+ public void initMutationEvent(String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ Node relatedNodeArg,
+ String prevValueArg,
+ String newValueArg,
+ String attrNameArg,
+ short attrChangeArg);
+
+ /**
+ * The <code>initMutationEventNS</code> method is used to initialize the
+ * value of a <code>MutationEvent</code> object and has the same
+ * behavior as <code>Event.initEventNS()</code>.
+ * @param namespaceURI Refer to the <code>Event.initEventNS()</code>
+ * method for a description of this parameter.
+ * @param typeArg Refer to the <code>Event.initEventNS()</code> method
+ * for a description of this parameter.
+ * @param canBubbleArg Refer to the <code>Event.initEventNS()</code>
+ * method for a description of this parameter.
+ * @param cancelableArg Refer to the <code>Event.initEventNS()</code>
+ * method for a description of this parameter.
+ * @param relatedNodeArg Refer to the
+ * <code>MutationEvent.initMutationEvent()</code> method for a
+ * description of this parameter.
+ * @param prevValueArg Refer to the
+ * <code>MutationEvent.initMutationEvent()</code> method for a
+ * description of this parameter.
+ * @param newValueArg Refer to the
+ * <code>MutationEvent.initMutationEvent()</code> method for a
+ * description of this parameter.
+ * @param attrNameArg Refer to the
+ * <code>MutationEvent.initMutationEvent()</code> method for a
+ * description of this parameter.
+ * @param attrChangeArg Refer to the
+ * <code>MutationEvent.initMutationEvent()</code> method for a
+ * description of this parameter.
+ * @since DOM Level 3
+ */
+ public void initMutationEventNS(String namespaceURI,
+ String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ Node relatedNodeArg,
+ String prevValueArg,
+ String newValueArg,
+ String attrNameArg,
+ short attrChangeArg);
+
+}