ananth balasubramanyam wrote:

I have an SVG DOM with no corressponding GVT tree and i am trying to
access the transform attribute of all the SVG text nodes in the DOM

As a general rule if you want to use any of the SVG DOM you will need to build the graphics tree. If you just want to use DOM Core (i.e. the stuff any old XML/DOM impl will give you) then you don't need the graphics tree.

   For getCTM you need to build the graphics tree.
   If _all_ you wanted to do was parse the DOM and manipulate it
with 'setAttribute' etc then you do not need to build the graphics
tree, but if you want to make calls like 'getBBox', 'getCTM', etc
(which apparently you do) then you must build the graphics tree.

   The Graphics tree (GVT) is built from the DOM tree.  The DOM
tree uses the graphics tree for essentially all of the SVG DOM calls
(which not surprisingly tend to be graphics related).  There are
a number of examples on how to build the graphics tree lying around
you might want to look at the 'slideshow' application as it is
fairly simple and does this.  There is a bunch of setup in the
constructor and then the RenderThread builds the rendering tree:

                    Document svgDoc = loader.loadDocument
                        (files[i].toURL().toString());
                    gvtRoot = builder.build(ctx, svgDoc);

You would want to tell the BridgeContext to always be dynamic.


NodeList textElements = 
doc.getElementsByTagNameNS("http://www.w3.org/2000/svg","text";);
for (int i=0 ; i < textElements.getLength() ; ++i) {
   SVGOMTextElement textElement = (SVGOMTextElement) textElements.item(i);
   .....
   here is the problem. I have been trying for long to access the
   text element's attributes, but keep getting a null. Am i  supposed to
   have a GVT to access the getCTM() and other methods in SVGOMTextElement
   class. I am sorry i might sound like a fool, but i need to understand
   the relation between the SVGDOM and the GVT. could somebody please
   explain this a little bit. When do i need a GVT and when can i just
   have an SVG DOM and access every node and its properties.
   All that i am tring to do is parse the SVG DOM and may be manipulate
   it for eg: change the x and y values or add a new attribute.
   .......
}

thanks in advance. please help
Ananth

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