You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Hervé Girod <he...@club-internet.fr> on 2004/09/23 00:07:42 UTC

Problem in GVTTreeWalker ?

Hello !

I'm using the GVTTreeWalker class to iterate through a GVT Tree. When I used it previously for iterating beginning from the GVT root of the tree, I had no problem.

But when I tried to begin to iterate from another node, an exception is raised in the setCurrentGraphicsNode method of the class. The reason is the following code :

if (node.getRoot() ! gvtRoot) {
throw new IllegalArgumentException("The node "+node+" is not part of the document "+gvtRoot);
}

I think the exception will always be raised if the beginning node is not the root node of the GVT Tree (because node.getRoot() returns the tree root Node). So it is impossible to begin with another node than the root.

Am I right ?

Re: Problem in GVTTreeWalker ?

Posted by Hervé Girod <he...@club-internet.fr>.
Ah ah !! You are fast !!

Thank you.

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: <ba...@xml.apache.org>
Sent: Friday, September 24, 2004 1:30 PM
Subject: Re: Problem in GVTTreeWalker ?


Hervé Girod wrote:

> I'm using the GVTTreeWalker class to iterate through a GVT Tree. When I
> used it previously for iterating beginning from the GVT root of the
> tree, I had no problem.
>
> [...]
>
> I think the exception will always be raised if the beginning node is not
> the root node of the GVT Tree (because node.getRoot() returns the tree
> root Node). So it is impossible to begin with another node than the root.
>
> Am I right ?

    Not any more.  I checked in a slightly modified version of
GVTTreeWalker that let's you start with any element in the tree.
The walk should be restricted to that subtree.




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


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


Re: Problem in GVTTreeWalker ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hervé Girod wrote:

> I'm using the GVTTreeWalker class to iterate through a GVT Tree. When I 
> used it previously for iterating beginning from the GVT root of the 
> tree, I had no problem.
>  
> [...]
>  
> I think the exception will always be raised if the beginning node is not 
> the root node of the GVT Tree (because node.getRoot() returns the tree 
> root Node). So it is impossible to begin with another node than the root.
>  
> Am I right ?

    Not any more.  I checked in a slightly modified version of
GVTTreeWalker that let's you start with any element in the tree.
The walk should be restricted to that subtree.




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