Hi,
Why does the bridgeContext.getElement(gNode) return nulls always? I need to get hold of the Svg element for a given graphic node. I has look at the source code for BridgeContext.getElement(..) method , it performs lookup against the nodeElementMap member to return the svg element, however, when I inspect nodeElementMap in debugger, it shows up as null. What am i doing wrong.
here's the code snippet that builds the GVT
SVGDocument svgDocument = factory.createSVGDocument(uri);
UserAgentAdapter userAgentAdapter = new UserAgentAdapter();
BridgeContext bridgeContext = new BridgeContext(userAgentAdapter);
GVTBuilder gvtBuilder = new GVTBuilder();
GraphicsNode graphicsNode = gvtBuilder.build(bridgeContext, svgDocument);
.... do something
Element svgElement = bridgeContext.getElement(childGNode);
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
-----------
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]