You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Hentschel Christian <Ch...@student.hpi.uni-potsdam.de> on 2004/11/01 09:48:40 UTC

GVT Tree and SVG DOM

Hi,

I need to rasterize a single SVG DOM node. I thought transferring the SVG Document into a GVT Tree and render a single GVT Node by using its paint method might be a good idea:

UserAgent myUserAgent = new SVGAbstractTranscoderUserAgent();
GraphicsNode gvtRoot = new GVTBuilder().build(new BridgeContext(myUserAgent), document);

Unfortunately I didn't find a way of mapping back the GVT node to a SVG node - so if I get an arbitrary SVG node of the transferred Document - how may I find the corresponding GVT node out of the GVT Tree? Do both trees necessarily have an identical structure - that is: may I simply traverse the DOM tree until I reached the node  and apply the same path to the GVT Tree in order to get the corresponding GVT node? Is there a more clever way?
Thanks in advance,
christian

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


Re: GVT Tree and SVG DOM

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

> Unfortunately I didn't find a way of mapping back the GVT node to a SVG node - so if I get an arbitrary SVG node of the transferred Document - how may I find the corresponding GVT node out of the GVT Tree? Do both trees necessarily have an identical structure - that is: may I simply traverse the DOM tree until I reached the node  and apply the same path to the GVT Tree in order to get the corresponding GVT node? Is there a more clever way?
> Thanks in advance,
> christian

I think you can use bridgeContext eg:
- bridgeContext.getElement(graphicsNode); // get the SVG node by
supplying GVT Node
- bridgeContext.getGraphicsNode(svgElement); // get the GVT node by
supplying SVG Node

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com



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