Hi Nazar,

"Nazar Stasiv (Lohika, Inc)" <[EMAIL PROTECTED]> wrote on 08/22/2006 
06:49:43 AM:

> [EMAIL PROTECTED] wrote:
> >
> >
> >    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 see transcode method which does setViewingTransform. And I've got two 
> questions
> 1. transcode method is applied to every GraphicsNode in GVTTree or 
> applying it to root node is enough?

   Applying it to the root is enough.

> 2. setViewingTransform is the method of type CanvasGraphicsNode and I 
> get a ClassCastException when casting GraphicsNode

   Normally the CanvasGraphicNode is the first child of the 
RootGraphicsNode.
See code from SVGAbstractTranscoder (two lines above setViewingTransform):

    CanvasGraphicsNode cgn = getCanvasGraphicsNode(gvtRoot); 

   And the method that calls (9 lines after setViewingTransform):

    protected CanvasGraphicsNode getCanvasGraphicsNode(GraphicsNode gn) {
        if (!(gn instanceof CompositeGraphicsNode))
            return null;
        CompositeGraphicsNode cgn = (CompositeGraphicsNode)gn;
        List children = cgn.getChildren();
        if (children.size() == 0) 
            return null;
        gn = (GraphicsNode)children.get(0);
        if (!(gn instanceof CanvasGraphicsNode))
            return null;
        return (CanvasGraphicsNode)gn;
    }

> Nothing happens for the code below, the condition is false
>         if (gvtRoot instanceof CanvasGraphicsNode){
>             ((CanvasGraphicsNode)gvtRoot).setViewingTransform(Px);
>         }
> 
> 
> Nazar
> 
> ---------------------------------------------------------------------
> 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