Hello, I want to add mouseEvents to batik objects but it doesn't work !

Here is a little part of my code : 

                //Fond
                Element rect = doc.createElementNS(svgNS, "rect");
                rect.setAttributeNS(null, "x", "5%");
                rect.setAttributeNS(null, "y", "5%");
                rect.setAttributeNS(null, "width", "90%");
                rect.setAttributeNS(null, "height", "90%");
                rect.setAttributeNS(null, "style", "fill:#F5F5F5");
                rect.setAttributeNS(null, "stroke-width", "0.01034");
                svgRoot.appendChild(rect);

                EventTarget eventTarget = (EventTarget)rect;
                eventTarget.addEventListener("click", new EventListener(){
                        public void handleEvent(org.w3c.dom.events.Event
evt) {
                                org.w3c.dom.events.MouseEvent mEvt =
(org.w3c.dom.events.MouseEvent)evt;     
                                System.out.println("Test clic : " +
mEvt.getButton());
                }, false);

This way of adding an event is ignored and I don't know why, is there
something I do wrong ?


In fact I have a graph and a lot of points, and when the mouse is on a point
I what to show his name, I can do that with this :

canvas.addMouseListener(new java.awt.event.MouseAdapter(){ ... } 

because it works but I don't want to check every point one by one each time
the mouse move.


Have you a solution for me ? 

Thanks.



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

Reply via email to