xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selva <selvakumar_...@yahoo.co.in>
Subject Adding dynamic event handlers using position
Date Thu, 13 Apr 2006 13:23:19 GMT
Hi All,

When user presses the SVGCanvas, mousePressed event is finding the clicked 
element using the following code. Here I haven’t added event handlers for each 
element since it will have more than 200 elements. Instead I am using 
getIntersectionList.

SVGRect rect = svgCanvas.getSVGDocument().getRootElement().createSVGRect();
                     
rect.setX((float)point.getX());
rect.setY((float)point.getY());
rect.setWidth(1);
rect.setHeight(1);
                    
NodeList l = myroot.getIntersectionList(rect, null);

Once I found the elements, I will add the event handlers for the elements in 
the list. But these event handlers will work from the next mouse events. To 
resolve this, is it possible to simulate mousePressed event once again 
manually after added the event listeners?

If this is not a better way, please provide some other way to add the 
listeners for the elements dynamically?

Also is there anyway to select multiple elements in the SVG canvas? If it is 
possible, how mouse listeners will work?

Please give me the better solution to resolve these issues.

Thanks,
Selva



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message