1 16 17 package com.test.script; 18 19 import org.w3c.dom.Element ; 20 21 import org.w3c.dom.events.Event ; 22 import org.w3c.dom.events.EventListener ; 23 import org.w3c.dom.events.EventTarget ; 24 25 import org.w3c.dom.svg.EventListenerInitializer; 26 import org.w3c.dom.svg.SVGDocument; 27 28 34 public class EventListenerInitializerImpl implements EventListenerInitializer { 35 36 42 public void initializeEventListeners(SVGDocument doc) { 43 System.err.println(">>>>>>>>>>>>>>>>>>> SVGDocument : " + doc); 44 ((EventTarget )doc.getElementById("testContent")). 45 addEventListener("mousedown", new EventListener () { 46 public void handleEvent(Event evt) { 47 ((Element )evt.getTarget()).setAttributeNS(null, "fill", "orange"); 48 } 49 }, false); 50 } 51 } 52 53 | Popular Tags |