Hi Pramod,

   You need to register an onclick mouse listener
during the "capture" phase of DOM event dispatch.
Then if you decide you don't want the document
opened you can call 'preventDefault' on the event
passed into your handler to prevent it from
activating the link (this part might only work in
CVS Batik).

   So from Java:

        EventListener clickListener = new ClickListener();
        EventTarget et = (EventTarget)document.getElementById("foo");
        e.addEventListener("click", clickListener, true);

    class ClickListener implements EventListener {
        public void handleEvent(Event evt) {
                if (blah) evt.preventDefault();
        }


Pramod Kalapa wrote:

Hopefully I am explaining my requirement right (I am
new to Batik)...

I have an SVG document loaded into the JSVGCanvas. I
want
to capture the generated event on clicking with the
mouse before the JSVGCanvas loads the SVG file associated
with the link: i.e., I need to do some processing to
decide prior to the automatic loading behavior of the
JSVGCanvas whether I should load the document or not
or reject the mouse click.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to