Hi Sven,
> Hello all. [...] It might been some mess up made my your mailing list interface (Nabble), but I've noticed the whole message was sent in a single line...? Please separate sentences (using paragraphs, for example) in order to separate ideas and ease the reply process. ;-) > Now I'm > trying to modify the content of the tree e.g. by adding nodes or grouping > nodes together... (later this should happen on user-iteraction, but for now > I want to do it hard-coded just to see how it works) I'd say using the DOM is the proper way of accomplishing that. > I had some success by > adding Nodes to the root-element of the SVGDocument itself > (JSVGCanvas.getSVGDocument().getRootElement().appendChild(xxx) )but these > changes are not shown in the canvas until the GVTTree is rebuilt [...] I'm not very familiar with the Batik GVT internals but I'd say that setting the document state to dynamic [1] should take care of handling those changes in an efficient way. :-) > [...] which I > would like to leave out... Why would you like to leave the GVTTree rebuild out? Describing your intention [2] might help... If you are following the recommended way to manipulate the document [3], then you probably won't need to bother with the underlying lower level internals. :-) > I guess it would do what I would like to get when > I modify the SVGDocument-Object and then calling the > JSVGCanvas.setSVGDocument(xxx)-Function but I assume this would rebuild the > whole tree which would not be as interactive as I would like it to be... So > is there a way to directly access and modify the tree that is finally > rendered into the canvas? Yup, see above. > So now the questions... 1. Which is the tree-structure that > is accessed by the Renderer and is there any way to modify it directly, so > that the changes are visible without explicitly rebuilding the complete > tree? As stated, you may use the DOM or the GVT trees. > 2. Is there any way to save these changes back to a SVG-file? This > works perfectly when I modify the SVGDocument-Object, but if the rendering > tree is modifyied I guess this will not be as easy, although it would be > really nice if I'm wrong here ^^ Well, if you use the DOM this is straightforward: you only need to serialize it whenever desired (see the SVG generator [4], for example). I'm not sure if that's also true when using the GVT tree... > So I hope somebody can help me here. Best Regards, Sven Hope this helps, Helder [1] http://xmlgraphics.apache.org/batik/faq.html#dom-modifications-do-not-display [2] http://catb.org/~esr/faqs/smart-questions.html#goal [3] http://xmlgraphics.apache.org/batik/using/scripting/java.html [4] http://xmlgraphics.apache.org/batik/using/svg-generator.html --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
