xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: How to apply more than 1 tranform to a SVGDocument
Date Tue, 22 Feb 2005 13:59:19 GMT
Sylvain Caillet wrote:

> Thank you for the sample code. But i still have a problem. I can't cast 
> my element to SVGTransformable interface because i get a
> SVGOMSVGElement which not implements this interface.

    If you want to transform the entire document then the
best way to do this is to transform the Graphics before you
paint the document to it.

    Graphics2D has a number of methods for adjusting it's
AffineTransform (scale, rotate, shear, translate).  These
are all cumulative so you can apply any sequence of them
you want [of course you need to make sure that you understand
what is being transformed to what by these methods as
they are not transitive, A*B != B*A, or more directly
rotate(translate(...),...) != translate(rotate(...),...), but
this is not really an SVG issue it's an AffineTransform issue].

> How could i retrieve a SVGTransformable object from a SVGDocument or 
> from an Element in a SVGDocument ?

    You don't get one for the SVGElement.  You could get one from
a G element which could be the only child of the root SVG (put all
the content inside a g) but really it's sounding to me like you
really want to modify the graphics before you draw to it.

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

View raw message