Hi Emzic,
emzic <[EMAIL PROTECTED]> wrote on 07/15/2008 11:44:46 AM:
> whenever an AWT-Event occurs on the BufferedImage i will need to
translate
> it into a DOMMouseEvent and dispatch that to the original SVGDocument,
from
> which the BufferedImage was rasterized and still exists in memory.
>
> so what i did was use the DOMMouseEvent.initMouseEventNS(...) function
to
> create a DOMMouseEvent and then dispatch that on the root-node of the
> svgdocument.
You should use SVGDocument.createEvent("MouseEvents") instead
(I don't think this is actually the problem here but it will
help future proof your code).
> the problem is, that the eventhandlers are just not triggered. but i
could
> yet not find out where exactly they get lost.
Also you need to make sure you dispatch the event to the EventTarget
under the mouse event:
((EventTarget)targetElement).dispatchEvent(mouseEvt);
You can find the element under the mouse via the code I recently
posted to help hardc0d3r. Our code to dispatch the DOM events lives
in batik.bridge.BridgeEventSupport (but it relies on the graphics node
already being found).