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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to