In fact, I did not set the document state to ALWAYS_DYNAMIC.
e is a rectangle.
Thanks a lot.
bader
>From: Thomas DeWeese <[EMAIL PROTECTED]>
>Reply-To:
[email protected]
>To:
[email protected]
>Subject: Re: I want to get the Graphic node associated to a node
>Date: Tue, 12 Apr 2005 05:23:48 -0400
>
>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]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]