xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steiner, Dominik" <Dominik.Stei...@gigatronik.com>
Subject AW: Overlay, Interactor and SVGGraphics2D
Date Fri, 12 Aug 2005 11:16:24 GMT
Hi Thomas,

thank you for the fast reply...

How do I get the AffineTransform that maps to my viewport coordinates. I know that in GVT
you could get the CTM easily, how does it work in Java2D?

I ran into another problem while drawing my shape: when I zoomed in and afterwards continued
to draw the shape the mouse events coordinates are from the original screen size and not from
the new zoomed one???

Dominik
-----Urspr√ľngliche Nachricht-----
Von: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com] 
Gesendet: Freitag, 12. August 2005 12:31
An: batik-users@xmlgraphics.apache.org
Betreff: Re: Overlay, Interactor and SVGGraphics2D

Hi Dominik,

Steiner, Dominik wrote:

> 1)        I use Interceptors to get the mouse events
> 
>       Point2D.Float point = new Point2D.Float( 
>           event.getPoint().x,event.getPoint().y);
>       Point2D.Float p = convertPointToViewBox(event.getPoint());

> 5)        And I'm sure it would work, but I noticed that my Overlay draw 
> routine needs the user coordinates to draw the shape correctly, whereas 
> the SVGGenerator
> 
> in order to get the node into the SVGDocument needs the viewport 
> coordinates of my underlying my image.

> 
> What am I doing wrong? Do I have to write my own shape(Graphics) -> 
> shape(SVG) Generator, by converting every single coordinate of the shape 
> the user has drawn?

    I would leave the coordinates in the screen coordinate system
while I added them to the shape in the interactor.  Then before
using the SVGGenerator to construct the SVG element I would
then use AffineTransform.createTransformedShape(Shape) to map
the overlay shape into viewport coords all at once.

> I feel like I'm trying to reinvent the wheel, so any hints would be 
> great.... J
> 
>  
> 
> Dominik Steiner
> 


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



---------------------------------------------------------------------
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