Hi Nazar,

"Nazar Stasiv (Lohika, Inc)" <[EMAIL PROTECTED]> wrote on 08/21/2006 
10:38:39 AM:

> what I'm trying to do is to zoom SVG diagram in size.  Is that the right 

> way ?

   I would suggest looking at the code in 
batik.transcoder.SVGAbstractTranscoder, in particular around the
call 'setViewingTransform'.  This is in some sense the 'correct'
way to handle this.

   I suspect your way will work for many cases, but I think
certain SVG DOM calls will return wrong/misleading values
(things like getCTM/getScreenCTM).

>     public static SVGDocument parseSvg(String uri) {
>         UserAgentAdapter userAgent = new UserAgentAdapter();
>         DocumentLoader loader = new DocumentLoader(userAgent);
>         SVGDocument doc = (SVGDocument) loader.loadDocument(uri);
>         BridgeContext ctx = new BridgeContext(userAgent, loader);
>         ctx.setDynamicState(BridgeContext.DYNAMIC);
>         GVTBuilder builder = new GVTBuilder();
>         GraphicsNode gvtRoot = builder.build(ctx, doc);
>         AffineTransform at = AffineTransform.getScaleInstance(0.5, 
> 0.5); 
>         gvtRoot.setTransform(at);
>         return doc;
>     }
> 
> 
> 
> ---------------------------------------------------------------------
> 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