Hi Bader,

bader houmad wrote:

I have a problem. I want to get the Graphic node associated to a Node:

org.w3c.dom.Element e = (org.w3c.dom.Element) myCanvas.getSVGDocument().getDocumentElement().getFirstChild();
Rectangle2D rect =
myCanvas.getBridgeContext().getGraphicsNode(e).getBounds();


but here the graphics node returned is null. (nullpointer exception)
e is not null and the bridge context is valid.

Do you know what 'e' actually is? It is quite common for the first child of the document element to be a TextNode (white space between elements) or any of 'defs', 'style', 'title', 'desc', 'script', ....

   None of which have a GraphicsNode since they don't draw anything.

   Also was the document loaded with the document state set to
ALWAYS_DYNAMIC or ALWAYS_INTERACTIVE?  If it wasn't then the
BridgeContext doesn't bother to build the element/GraphicsNode
mapping.

   HTH

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to