Jamie wrote:

Specifically then Thomas, would the call be:

documentX = SVGElement.getScreenCTM(DOMEvent.getClientX());
documentY = SVGElement.getScreenCTM(DOMEvent.getClientY());

No, you can take a look at: samples/tests/spec/scripting/currentScaleTranslate.svg

   It does all the right things in JavaScript (look at 'mouseOver')
you will have to translate back to Java but it's pretty straight
forward.


----- Original Message -----
From: "Thomas DeWeese" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>
Sent: Thursday, December 18, 2003 11:33 AM
Subject: Re: Batik Question



Omar Abdala wrote:


I have a question about using Java Batik. I have a JSVGCanvas within

which


I'm displaying SVG files. I want to add a listener to it that will

listen


for mouse clicks on the Canvas and calculate the point that was clicked

in


terms of the SVG files' coordinates. Is there some standard way of doing
this or is it an easy calculation?

The easiest thing to do is add a DOM 'click' event listener on the root SVG element. Then you can use SVGElement.getScreenCTM to get the transform from any SVG element's coordinate system to the screen coordinate system (the coordinate system for DOMEvent.getClientX/Y).





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





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




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



Reply via email to