Hello all,

Previously I had a trouble with the mouseaction events on a JSVGCanvas, that Thomas DeWeese was so kind to solve for us (covered in the thread "mousedrag and mousedown not detected").

My actual problem is i add a RECT element to my JSVGCanvas, doing this:
document = e.getSVGDocument();
documentElement = (SVGOMSVGElement)document.getDocumentElement();
Element imgGroup = documentElement.getElementById("imgGroup");
....
Element rect = document.createElementNS(svgNS, "rect");
....
imgGroup.appendChild(rect);

Then register the action listeners, and when i do a mousemove, it gets registered ok, but a CLICK, DOWN or UP, throws the following error:
java.lang.ClassCastException
        at com.onemileup.client.draw.BaseDrawing$OnDownAction.handleEvent(Unknown Source)
        at org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
        at org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown Source)
        at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
        at org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown Source)
        at org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown Source)
        at org.apache.batik.bridge.BridgeEventSupport$Listener.mousePressed(Unknown Source)
        at org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(Unknown Source)
        at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(Unknown Source)
        at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source)
        at org.apache.batik.gvt.event.AWTEventDispatcher.mousePressed(Unknown Source)
        at org.apache.batik.swing.svg.JSVGComponent$23.run(Unknown Source)
        at org.apache.batik.util.RunnableQueue.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

I complied Batik 1.5 with only the patch files mentioned in
http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03536.html
  • Subject: cvs commit: xml-batik/sources/org/apache/batik/script/rhino EventTargetWrapper.java
  • From: [EMAIL PROTECTED]
  • Date: 13 Jul 2003 22:30:57 -0000
  • To: [EMAIL PROTECTED]
I have not added any patches or other modifications to the Batik code.

Thanks in advance,

Andres Toussaint

Reply via email to