You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by tk...@apache.org on 2002/06/12 10:20:34 UTC
cvs commit: xml-batik/sources/org/apache/batik/gvt/event AWTEventDispatcher.java
tkormann 2002/06/12 01:20:34
Modified: sources/org/apache/batik/bridge
AbstractGraphicsNodeBridge.java
BridgeEventSupport.java GVTBuilder.java
GraphicsNodeBridge.java SVGSwitchElementBridge.java
ScriptingEnvironment.java
sources/org/apache/batik/dom/events DOMMouseEvent.java
DocumentEventSupport.java
sources/org/apache/batik/dom/util SAXDocumentFactory.java
sources/org/apache/batik/gvt/event AWTEventDispatcher.java
Added: sources/org/apache/batik/dom/events DOMKeyEvent.java
Log:
commit key events
move display check in GraphicsNodeBridge
Revision Changes Path
1.27 +9 -1 xml-batik/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java
Index: AbstractGraphicsNodeBridge.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- AbstractGraphicsNodeBridge.java 5 Jun 2002 21:14:47 -0000 1.26
+++ AbstractGraphicsNodeBridge.java 12 Jun 2002 08:20:34 -0000 1.27
@@ -133,6 +133,14 @@
}
/**
+ * Returns true if the graphics node has to be displayed, false
+ * otherwise.
+ */
+ public boolean getDisplay(Element e) {
+ return CSSUtilities.convertDisplay(e);
+ }
+
+ /**
* This method is invoked during the build phase if the document
* is dynamic. The responsability of this method is to ensure that
* any dynamic modifications of the element this bridge is
1.39 +67 -4 xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java
Index: BridgeEventSupport.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- BridgeEventSupport.java 22 May 2002 11:18:17 -0000 1.38
+++ BridgeEventSupport.java 12 Jun 2002 08:20:34 -0000 1.39
@@ -19,10 +19,14 @@
import java.util.List;
+import org.apache.batik.dom.events.DOMKeyEvent;
+
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.gvt.TextNode;
import org.apache.batik.gvt.event.EventDispatcher;
+import org.apache.batik.gvt.event.GraphicsNodeKeyEvent;
+import org.apache.batik.gvt.event.GraphicsNodeKeyListener;
import org.apache.batik.gvt.event.GraphicsNodeMouseEvent;
import org.apache.batik.gvt.event.GraphicsNodeMouseListener;
@@ -67,6 +71,7 @@
if (dispatcher != null) {
final Listener listener = new Listener(ctx, ua);
dispatcher.addGraphicsNodeMouseListener(listener);
+ dispatcher.addGraphicsNodeKeyListener(listener);
// add an unload listener on the SVGDocument to remove
// that listener for dispatching events
EventListener l = new GVTUnloadListener(dispatcher, listener);
@@ -90,6 +95,7 @@
public void handleEvent(Event evt) {
dispatcher.removeGraphicsNodeMouseListener(listener);
+ dispatcher.removeGraphicsNodeKeyListener(listener);
evt.getTarget().removeEventListener("SVGUnload", this, false);
}
}
@@ -97,17 +103,75 @@
/**
* A GraphicsNodeMouseListener that dispatch DOM events accordingly.
*/
- protected static class Listener implements GraphicsNodeMouseListener {
+ protected static class Listener
+ implements GraphicsNodeMouseListener, GraphicsNodeKeyListener {
protected BridgeContext context;
protected UserAgent ua;
protected Element lastTargetElement;
+ protected boolean isDown;
public Listener(BridgeContext ctx, UserAgent u) {
context = ctx;
ua = u;
}
+ // Key -------------------------------------------------------------
+
+ /**
+ * Invoked when a key has been pressed.
+ * @param evt the graphics node key event
+ */
+ public void keyPressed(GraphicsNodeKeyEvent evt) {
+ if (!isDown) {
+ isDown = true;
+ dispatchKeyEvent("keydown", evt);
+ }
+ }
+
+ /**
+ * Invoked when a key has been released.
+ * @param evt the graphics node key event
+ */
+ public void keyReleased(GraphicsNodeKeyEvent evt) {
+ dispatchKeyEvent("keyup", evt);
+ isDown = false;
+ }
+
+ /**
+ * Invoked when a key has been typed.
+ * @param evt the graphics node key event
+ */
+ public void keyTyped(GraphicsNodeKeyEvent evt) {
+ dispatchKeyEvent("keypress", evt);
+ }
+
+ protected void dispatchKeyEvent(String eventType,
+ GraphicsNodeKeyEvent evt) {
+ Element targetElement =
+ (Element)context.getFocusManager().getCurrentEventTarget();
+ DocumentEvent d = (DocumentEvent)targetElement.getOwnerDocument();
+ DOMKeyEvent keyEvt = (DOMKeyEvent)d.createEvent("KeyEvents");
+ keyEvt.initKeyEvent(eventType,
+ true,
+ true,
+ evt.isControlDown(),
+ evt.isAltDown(),
+ evt.isShiftDown(),
+ evt.isMetaDown(),
+ evt.getKeyCode(),
+ evt.getKeyChar(),
+ null);
+
+ try {
+ ((EventTarget)targetElement).dispatchEvent(keyEvt);
+ } catch (RuntimeException e) {
+ ua.displayError(e);
+ }
+ }
+
+ // Mouse -----------------------------------------------------------
+
public void mouseClicked(GraphicsNodeMouseEvent evt) {
dispatchMouseEvent("click", evt, true);
}
@@ -135,8 +199,7 @@
clientXY,
evt,
true);
- }
- dispatchMouseEvent("mouseout", evt, true);
+ }
}
public void mouseDragged(GraphicsNodeMouseEvent evt) {
1.22 +4 -4 xml-batik/sources/org/apache/batik/bridge/GVTBuilder.java
Index: GVTBuilder.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/GVTBuilder.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- GVTBuilder.java 22 May 2002 10:06:55 -0000 1.21
+++ GVTBuilder.java 12 Jun 2002 08:20:34 -0000 1.22
@@ -108,12 +108,12 @@
if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
return null;
}
+ // create the associated graphics node
+ GraphicsNodeBridge gnBridge = (GraphicsNodeBridge)bridge;
// check the display property
- if (!CSSUtilities.convertDisplay(e)) {
+ if (!gnBridge.getDisplay(e)) {
return null;
}
- // create the associated graphics node
- GraphicsNodeBridge gnBridge = (GraphicsNodeBridge)bridge;
GraphicsNode gn = gnBridge.createGraphicsNode(ctx, e);
if (gn != null) {
if (gnBridge.isComposite()) {
1.8 +7 -1 xml-batik/sources/org/apache/batik/bridge/GraphicsNodeBridge.java
Index: GraphicsNodeBridge.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/GraphicsNodeBridge.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- GraphicsNodeBridge.java 11 Feb 2002 16:00:07 -0000 1.7
+++ GraphicsNodeBridge.java 12 Jun 2002 08:20:34 -0000 1.8
@@ -51,6 +51,12 @@
boolean isComposite();
/**
+ * Returns true if the graphics node has to be displayed, false
+ * otherwise.
+ */
+ boolean getDisplay(Element e);
+
+ /**
* <!> FIX ME: Move to Bridge
*
* Returns the Bridge instance to be used for a single DOM
1.12 +9 -1 xml-batik/sources/org/apache/batik/bridge/SVGSwitchElementBridge.java
Index: SVGSwitchElementBridge.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGSwitchElementBridge.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SVGSwitchElementBridge.java 11 Feb 2002 16:00:08 -0000 1.11
+++ SVGSwitchElementBridge.java 12 Jun 2002 08:20:34 -0000 1.12
@@ -82,6 +82,14 @@
}
/**
+ * Returns true if the graphics node has to be displayed, false
+ * otherwise.
+ */
+ public boolean getDisplay(Element e) {
+ return CSSUtilities.convertDisplay(e);
+ }
+
+ /**
* Returns false as the <switch> element is not a container.
*/
public boolean isComposite() {
1.30 +33 -1 xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java
Index: ScriptingEnvironment.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- ScriptingEnvironment.java 6 Jun 2002 08:52:30 -0000 1.29
+++ ScriptingEnvironment.java 12 Jun 2002 08:20:34 -0000 1.30
@@ -195,6 +195,26 @@
new ScriptingEventListener("onmousemove");
/**
+ * The keypress event listener.
+ */
+ protected EventListener keypressListener =
+ new ScriptingEventListener("onkeypress");
+
+ /**
+ * The keydown event listener.
+ */
+ protected EventListener keydownListener =
+ new ScriptingEventListener("onkeydown");
+
+ /**
+ * The keyup event listener.
+ */
+ protected EventListener keyupListener =
+ new ScriptingEventListener("onkeyup");
+
+
+
+ /**
* Creates a new ScriptingEnvironment.
* @param ctx the bridge context
*/
@@ -357,6 +377,15 @@
if (elt.hasAttributeNS(null, "onmousemove")) {
target.addEventListener("mousemove", mousemoveListener, false);
}
+ if (elt.hasAttributeNS(null, "onkeypress")) {
+ target.addEventListener("keypress", keypressListener, false);
+ }
+ if (elt.hasAttributeNS(null, "onkeydown")) {
+ target.addEventListener("keydown", keydownListener, false);
+ }
+ if (elt.hasAttributeNS(null, "onkeyup")) {
+ target.addEventListener("keyup", keyupListener, false);
+ }
}
// Adds the listeners to the children
@@ -419,6 +448,9 @@
target.removeEventListener("mouseover", mouseoverListener, false);
target.removeEventListener("mouseout", mouseoutListener, false);
target.removeEventListener("mousemove", mousemoveListener, false);
+ target.removeEventListener("keypress", keypressListener, false);
+ target.removeEventListener("keydown", keydownListener, false);
+ target.removeEventListener("keyup", keyupListener, false);
}
// Removes the listeners from the children
1.2 +1 -1 xml-batik/sources/org/apache/batik/dom/events/DOMMouseEvent.java
Index: DOMMouseEvent.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/events/DOMMouseEvent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMMouseEvent.java 10 Oct 2000 18:39:04 -0000 1.1
+++ DOMMouseEvent.java 12 Jun 2002 08:20:34 -0000 1.2
@@ -177,7 +177,7 @@
short buttonArg,
EventTarget relatedTargetArg) {
initUIEvent(typeArg, canBubbleArg, cancelableArg,
- viewArg, (int) detailArg);
+ viewArg, (int) detailArg);
this.screenX = screenXArg;
this.screenY = screenYArg;
this.clientX = clientXArg;
1.2 +20 -1 xml-batik/sources/org/apache/batik/dom/events/DocumentEventSupport.java
Index: DocumentEventSupport.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/events/DocumentEventSupport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DocumentEventSupport.java 5 Jul 2001 16:59:04 -0000 1.1
+++ DocumentEventSupport.java 12 Jun 2002 08:20:34 -0000 1.2
@@ -41,6 +41,11 @@
public static final String UI_EVENT_TYPE = "UIEvents";
/**
+ * The KeyEvent type.
+ */
+ public static final String KEY_EVENT_TYPE = "KeyEvents";
+
+ /**
* The event factories table.
*/
protected HashTable eventFactories = new HashTable();
@@ -51,6 +56,8 @@
new MutationEventFactory());
eventFactories.put(MOUSE_EVENT_TYPE.toLowerCase(),
new MouseEventFactory());
+ eventFactories.put(KEY_EVENT_TYPE.toLowerCase(),
+ new KeyEventFactory());
eventFactories.put(UI_EVENT_TYPE.toLowerCase(),
new UIEventFactory());
}
@@ -146,6 +153,18 @@
*/
public Event createEvent() {
return new DOMMouseEvent();
+ }
+ }
+
+ /**
+ * To create a key event.
+ */
+ protected static class KeyEventFactory implements EventFactory {
+ /**
+ * Creates a new Event object.
+ */
+ public Event createEvent() {
+ return new DOMKeyEvent();
}
}
1.1 xml-batik/sources/org/apache/batik/dom/events/DOMKeyEvent.java
Index: DOMKeyEvent.java
===================================================================
/*
* Copyright (c) 1999 World Wide Web Consortium,
* (Massachusetts Institute of Technology, Institut National de Recherche
* en Informatique et en Automatique, Keio University).
* All Rights Reserved. http://www.w3.org/Consortium/Legal/
*/
package org.apache.batik.dom.events;
import org.w3c.dom.views.AbstractView;
/**
* The <code>KeyEvent</code> interface provides specific contextual
* information associated with Key events.
*
* @since DOM Level 2 (Working Draft)
*/
public class DOMKeyEvent extends DOMUIEvent {
// VirtualKeyCode
public static final int CHAR_UNDEFINED = 0x0FFFF;
public static final int DOM_VK_0 = 0x30;
public static final int DOM_VK_1 = 0x31;
public static final int DOM_VK_2 = 0x32;
public static final int DOM_VK_3 = 0x33;
public static final int DOM_VK_4 = 0x34;
public static final int DOM_VK_5 = 0x35;
public static final int DOM_VK_6 = 0x36;
public static final int DOM_VK_7 = 0x37;
public static final int DOM_VK_8 = 0x38;
public static final int DOM_VK_9 = 0x39;
public static final int DOM_VK_A = 0x41;
public static final int DOM_VK_ACCEPT = 0x1E;
public static final int DOM_VK_ADD = 0x6B;
public static final int DOM_VK_AGAIN = 0xFFC9;
public static final int DOM_VK_ALL_CANDIDATES = 0x0100;
public static final int DOM_VK_ALPHANUMERIC = 0x00F0;
public static final int DOM_VK_ALT = 0x12;
public static final int DOM_VK_ALT_GRAPH = 0xFF7E;
public static final int DOM_VK_AMPERSAND = 0x96;
public static final int DOM_VK_ASTERISK = 0x97;
public static final int DOM_VK_AT = 0x0200;
public static final int DOM_VK_B = 0x42;
public static final int DOM_VK_BACK_QUOTE = 0xC0;
public static final int DOM_VK_BACK_SLASH = 0x5C;
public static final int DOM_VK_BACK_SPACE = 0x08;
public static final int DOM_VK_BRACELEFT = 0xA1;
public static final int DOM_VK_BRACERIGHT = 0xA2;
public static final int DOM_VK_C = 0x43;
public static final int DOM_VK_CANCEL = 0x03;
public static final int DOM_VK_CAPS_LOCK = 0x14;
public static final int DOM_VK_CIRCUMFLEX = 0x0202;
public static final int DOM_VK_CLEAR = 0x0C;
public static final int DOM_VK_CLOSE_BRACKET = 0x5D;
public static final int DOM_VK_CODE_INPUT = 0x0102;
public static final int DOM_VK_COLON = 0x0201;
public static final int DOM_VK_COMMA = 0x2C;
public static final int DOM_VK_COMPOSE = 0xFF20;
public static final int DOM_VK_CONTROL = 0x11;
public static final int DOM_VK_CONVERT = 0x1C;
public static final int DOM_VK_COPY = 0xFFCD;
public static final int DOM_VK_CUT = 0xFFD1;
public static final int DOM_VK_D = 0x44;
public static final int DOM_VK_DEAD_ABOVEDOT = 0x86;
public static final int DOM_VK_DEAD_ABOVERING = 0x88;
public static final int DOM_VK_DEAD_ACUTE = 0x81;
public static final int DOM_VK_DEAD_BREVE = 0x85;
public static final int DOM_VK_DEAD_CARON = 0x8A;
public static final int DOM_VK_DEAD_CEDILLA = 0x8B;
public static final int DOM_VK_DEAD_CIRCUMFLEX = 0x82;
public static final int DOM_VK_DEAD_DIAERESIS = 0x87;
public static final int DOM_VK_DEAD_DOUBLEACUTE = 0x89;
public static final int DOM_VK_DEAD_GRAVE = 0x80;
public static final int DOM_VK_DEAD_IOTA = 0x8D;
public static final int DOM_VK_DEAD_MACRON = 0x84;
public static final int DOM_VK_DEAD_OGONEK = 0x8C;
public static final int DOM_VK_DEAD_SEMIVOICED_SOUND = 0x8F;
public static final int DOM_VK_DEAD_TILDE = 0x83;
public static final int DOM_VK_DEAD_VOICED_SOUND = 0x8E;
public static final int DOM_VK_DECIMAL = 0x6E;
public static final int DOM_VK_DELETE = 0x7F;
public static final int DOM_VK_DIVIDE = 0x6F;
public static final int DOM_VK_DOLLAR = 0x0203;
public static final int DOM_VK_DOWN = 0x28;
public static final int DOM_VK_E = 0x45;
public static final int DOM_VK_END = 0x23;
public static final int DOM_VK_ENTER = 0x0D;
public static final int DOM_VK_EQUALS = 0x3D;
public static final int DOM_VK_ESCAPE = 0x1B;
public static final int DOM_VK_EURO_SIGN = 0x0204;
public static final int DOM_VK_EXCLAMATION_MARK = 0x0205;
public static final int DOM_VK_F = 0x46;
public static final int DOM_VK_F1 = 0x70;
public static final int DOM_VK_F10 = 0x79;
public static final int DOM_VK_F11 = 0x7A;
public static final int DOM_VK_F12 = 0x7B;
public static final int DOM_VK_F13 = 0xF000;
public static final int DOM_VK_F14 = 0xF001;
public static final int DOM_VK_F15 = 0xF002;
public static final int DOM_VK_F16 = 0xF003;
public static final int DOM_VK_F17 = 0xF004;
public static final int DOM_VK_F18 = 0xF005;
public static final int DOM_VK_F19 = 0xF006;
public static final int DOM_VK_F2 = 0x71;
public static final int DOM_VK_F20 = 0xF007;
public static final int DOM_VK_F21 = 0xF008;
public static final int DOM_VK_F22 = 0xF009;
public static final int DOM_VK_F23 = 0xF00A;
public static final int DOM_VK_F24 = 0xF00B;
public static final int DOM_VK_F3 = 0x72;
public static final int DOM_VK_F4 = 0x73;
public static final int DOM_VK_F5 = 0x74;
public static final int DOM_VK_F6 = 0x75;
public static final int DOM_VK_F7 = 0x76;
public static final int DOM_VK_F8 = 0x77;
public static final int DOM_VK_F9 = 0x78;
public static final int DOM_VK_FINAL = 0x18;
public static final int DOM_VK_FIND = 0xFFD0;
public static final int DOM_VK_FULL_WIDTH = 0x00F3;
public static final int DOM_VK_G = 0x47;
public static final int DOM_VK_GREATER = 0xA0;
public static final int DOM_VK_H = 0x48;
public static final int DOM_VK_HALF_WIDTH = 0x00F4;
public static final int DOM_VK_HELP = 0x9C;
public static final int DOM_VK_HIRAGANA = 0x00F2;
public static final int DOM_VK_HOME = 0x24;
public static final int DOM_VK_I = 0x49;
public static final int DOM_VK_INSERT = 0x9B;
public static final int DOM_VK_INVERTED_EXCLAMATION_MARK = 0x0206;
public static final int DOM_VK_J = 0x4A;
public static final int DOM_VK_JAPANESE_HIRAGANA = 0x0104;
public static final int DOM_VK_JAPANESE_KATAKANA = 0x0103;
public static final int DOM_VK_JAPANESE_ROMAN = 0x0105;
public static final int DOM_VK_K = 0x4B;
public static final int DOM_VK_KANA = 0x15;
public static final int DOM_VK_KANJI = 0x19;
public static final int DOM_VK_KATAKANA = 0x00F1;
public static final int DOM_VK_KP_DOWN = 0xE1;
public static final int DOM_VK_KP_LEFT = 0xE2;
public static final int DOM_VK_KP_RIGHT = 0xE3;
public static final int DOM_VK_KP_UP = 0xE0;
public static final int DOM_VK_L = 0x4C;
public static final int DOM_VK_LEFT = 0x25;
public static final int DOM_VK_LEFT_PARENTHESIS = 0x0207;
public static final int DOM_VK_LESS = 0x99;
public static final int DOM_VK_M = 0x4D;
public static final int DOM_VK_META = 0x9D;
public static final int DOM_VK_MINUS = 0x2D;
public static final int DOM_VK_MODECHANGE = 0x1F;
public static final int DOM_VK_MULTIPLY = 0x6A;
public static final int DOM_VK_N = 0x4E;
public static final int DOM_VK_NONCONVERT = 0x1D;
public static final int DOM_VK_NUM_LOCK = 0x90;
public static final int DOM_VK_NUMBER_SIGN = 0x0208;
public static final int DOM_VK_NUMPAD0 = 0x60;
public static final int DOM_VK_NUMPAD1 = 0x61;
public static final int DOM_VK_NUMPAD2 = 0x62;
public static final int DOM_VK_NUMPAD3 = 0x63;
public static final int DOM_VK_NUMPAD4 = 0x64;
public static final int DOM_VK_NUMPAD5 = 0x65;
public static final int DOM_VK_NUMPAD6 = 0x66;
public static final int DOM_VK_NUMPAD7 = 0x67;
public static final int DOM_VK_NUMPAD8 = 0x68;
public static final int DOM_VK_NUMPAD9 = 0x69;
public static final int DOM_VK_O = 0x4F;
public static final int DOM_VK_OPEN_BRACKET = 0x5B;
public static final int DOM_VK_P = 0x50;
public static final int DOM_VK_PAGE_DOWN = 0x22;
public static final int DOM_VK_PAGE_UP = 0x21;
public static final int DOM_VK_PASTE = 0xFFCF;
public static final int DOM_VK_PAUSE = 0x13;
public static final int DOM_VK_PERIOD = 0x2E;
public static final int DOM_VK_PLUS = 0x0209;
public static final int DOM_VK_PREVIOUS_CANDIDATE = 0x0101;
public static final int DOM_VK_PRINTSCREEN = 0x9A;
public static final int DOM_VK_PROPS = 0xFFCA;
public static final int DOM_VK_Q = 0x51;
public static final int DOM_VK_QUOTE = 0xDE;
public static final int DOM_VK_QUOTEDBL = 0x98;
public static final int DOM_VK_R = 0x52;
public static final int DOM_VK_RIGHT = 0x27;
public static final int DOM_VK_RIGHT_PARENTHESIS = 0x020A;
public static final int DOM_VK_ROMAN_CHARACTERS = 0x00F5;
public static final int DOM_VK_S = 0x53;
public static final int DOM_VK_SCROLL_LOCK = 0x91;
public static final int DOM_VK_SEMICOLON = 0x3B;
public static final int DOM_VK_SEPARATER = 0x6C;
public static final int DOM_VK_SHIFT = 0x10;
public static final int DOM_VK_SLASH = 0x2F;
public static final int DOM_VK_SPACE = 0x20;
public static final int DOM_VK_STOP = 0xFFC8;
public static final int DOM_VK_SUBTRACT = 0x6D;
public static final int DOM_VK_T = 0x54;
public static final int DOM_VK_TAB = 0x09;
public static final int DOM_VK_U = 0x55;
public static final int DOM_VK_UNDEFINED = 0x0;
public static final int DOM_VK_UNDERSCORE = 0x020B;
public static final int DOM_VK_UNDO = 0xFFCB;
public static final int DOM_VK_UP = 0x26;
public static final int DOM_VK_V = 0x56;
public static final int DOM_VK_W = 0x57;
public static final int DOM_VK_X = 0x58;
public static final int DOM_VK_Y = 0x59;
public static final int DOM_VK_Z = 0x5A;
protected boolean ctrlKey;
protected boolean altKey;
protected boolean shiftKey;
protected boolean metaKey;
protected int keyCode;
protected int charCode;
/**
* <code>ctrlKey</code> indicates whether the 'ctrl' key was
* depressed * during the firing of the event.
*/
public boolean getCtrlKey() {
return ctrlKey;
}
/**
* <code>shiftKey</code> indicates whether the 'shift' key was
* depressed * during the firing of the event.
*/
public boolean getShiftKey() {
return shiftKey;
}
/**
* <code>altKey</code> indicates whether the 'alt' key was
* depressed during * the firing of the event. On some platforms
* this key may map to an * alternative key name.
*/
public boolean getAltKey() {
return altKey;
}
/**
* <code>metaKey</code> indicates whether the 'meta' key was
* depressed * during the firing of the event. On some platforms
* this key may map to * an alternative key name.
*/
public boolean getMetaKey() {
return metaKey;
}
/**
* The value of <code>keyCode</code> holds the virtual key code
* value of * the key which was depressed if the event is a key
* event. Otherwise, the * value is zero.
*/
public int getKeyCode() {
return keyCode;
}
/**
* <code>charCode</code> holds the value of the Unicode character
* * associated with the depressed key if the event is a key
* event. * Otherwise, the value is zero.
*/
public int getCharCode() {
return charCode;
}
/**
*
* @param typeArg Specifies the event type.
* @param canBubbleArg Specifies whether or not the event can bubble.
* @param cancelableArg Specifies whether or not the event's default action
* can be prevent.
* @param ctrlKeyArg Specifies whether or not control key was depressed
* during the <code>Event</code>.
* @param altKeyArg Specifies whether or not alt key was depressed during
* the <code>Event</code>.
* @param shiftKeyArg Specifies whether or not shift key was depressed
* during the <code>Event</code>.
* @param metaKeyArg Specifies whether or not meta key was depressed during
* the <code>Event</code>.
* @param keyCodeArg Specifies the <code>Event</code>'s <code>keyCode</code>
* @param charCodeArg Specifies the <code>Event</code>'s
* <code>charCode</code>
* @param viewArg Specifies the <code>Event</code>'s
* <code>AbstractView</code>.
*/
public void initKeyEvent(String typeArg,
boolean canBubbleArg,
boolean cancelableArg,
boolean ctrlKeyArg,
boolean altKeyArg,
boolean shiftKeyArg,
boolean metaKeyArg,
int keyCodeArg,
int charCodeArg,
AbstractView viewArg) {
initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0);
ctrlKey = ctrlKeyArg;
altKey = altKeyArg;
shiftKey = shiftKeyArg;
metaKey = metaKeyArg;
keyCode = keyCodeArg;
charCode = charCodeArg;
}
}
1.11 +2 -2 xml-batik/sources/org/apache/batik/dom/util/SAXDocumentFactory.java
Index: SAXDocumentFactory.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/util/SAXDocumentFactory.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SAXDocumentFactory.java 10 May 2002 15:55:19 -0000 1.10
+++ SAXDocumentFactory.java 12 Jun 2002 08:20:34 -0000 1.11
@@ -200,7 +200,7 @@
this : errorHandler);
parser.setFeature("http://xml.org/sax/features/namespaces",
- false);
+ true);
parser.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
parser.setFeature("http://xml.org/sax/features/validation",
1.7 +9 -15 xml-batik/sources/org/apache/batik/gvt/event/AWTEventDispatcher.java
Index: AWTEventDispatcher.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/event/AWTEventDispatcher.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AWTEventDispatcher.java 6 Mar 2002 09:06:39 -0000 1.6
+++ AWTEventDispatcher.java 12 Jun 2002 08:20:34 -0000 1.7
@@ -318,6 +318,7 @@
* @param evt the key event to dispatch
*/
protected void dispatchKeyEvent(KeyEvent evt) {
+ currentKeyEventTarget = lastHit;
if (currentKeyEventTarget != null) {
processKeyEvent
(new GraphicsNodeKeyEvent(currentKeyEventTarget,
@@ -442,44 +443,37 @@
switch (evt.getID()) {
case GraphicsNodeMouseEvent.MOUSE_MOVED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mouseMoved(evt);
+ listeners[i].mouseMoved(evt);
}
break;
case GraphicsNodeMouseEvent.MOUSE_DRAGGED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mouseDragged(evt);
+ listeners[i].mouseDragged(evt);
}
break;
case GraphicsNodeMouseEvent.MOUSE_ENTERED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mouseEntered(evt);
+ listeners[i].mouseEntered(evt);
}
break;
case GraphicsNodeMouseEvent.MOUSE_EXITED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mouseExited(evt);
+ listeners[i].mouseExited(evt);
}
break;
case GraphicsNodeMouseEvent.MOUSE_CLICKED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mouseClicked(evt);
+ listeners[i].mouseClicked(evt);
}
break;
case GraphicsNodeMouseEvent.MOUSE_PRESSED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mousePressed(evt);
+ listeners[i].mousePressed(evt);
}
break;
case GraphicsNodeMouseEvent.MOUSE_RELEASED:
for (int i = 0; i < listeners.length; i++) {
- listeners[i].
- mouseReleased(evt);
+ listeners[i].mouseReleased(evt);
}
break;
default:
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org