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 "Jean-Christophe ARNU (JX)" <ar...@paratronic.fr> on 2004/01/12 20:03:29 UTC
Why do my node remains rendered?
Hi,
I use a SVG file, where I put dynamically a g element (as child of the Node
named "place" in the tree). This g element is made of 500 elements (text,
circles, xlink, a). This g element is a "layer". My application has to remove
this layer on a user command (I use a popup menu item for this). In the
removal method, I use place.removeChild(myGElement) in a RunnableQueue.
My problem is that my g element is no longer in the DOM tree but is still
rendered (even if I put other elements in the DOM tree or zoom or pan) : I
PrintWritered into files the DOM tree to make comparitions...
What can I do to force my removed DOM element not to remain rendered onto the
SVGCanvas?
Thank you :)
--
Jean-Christophe Arnu
Paratronic
Re: Why do my node remains rendered?
Posted by "Jean-Christophe ARNU (JX)" <ar...@paratronic.fr>.
Le Tue, 13 Jan 2004 15:36:41 -0500
Thomas DeWeese <Th...@Kodak.com> me disait que :
> Guillaume Pothier wrote:
>
> > I had what seems to be the same problem.
>
> > I *think* it might be related to concurrency issues because:
>
> This seems like a good bet. Jean are you passing off the
> modification of the document to other threads?
>
> You could also put a trace statement in the code that is
> supposed to remove the graphics node from the rendering tree.
> It is in
> batik.bridge.AbstractGraphicsNodeBridge.handleDOMNodeRemovedEvent.
>
> This is normally called from the BridgeContext's
> DOMNodeRemovedEventListener.
Well in fact, the node I wanted to remove was duplicated at creation time!
So I deleted the correct node but the duplicated one still remained...
Sorry to be so fool.
--
Jean-Christophe Arnu
Paratronic
Re: Why do my node remains rendered?
Posted by Thomas DeWeese <Th...@Kodak.com>.
Guillaume Pothier wrote:
> I had what seems to be the same problem.
> I *think* it might be related to concurrency issues because:
This seems like a good bet. Jean are you passing off the
modification of the document to other threads?
You could also put a trace statement in the code that is
supposed to remove the graphics node from the rendering tree.
It is in
batik.bridge.AbstractGraphicsNodeBridge.handleDOMNodeRemovedEvent.
This is normally called from the BridgeContext's
DOMNodeRemovedEventListener.
> - sometimes GVT peers are properly removed from the GVT tree, and
> sometimes not, I did not find a 100% reproducible test case.
> - Debugging step by step produces different results (usually the correct
> ones)
>
> Jean-Christophe ARNU (JX) wrote:
>
>> Hi,
>> I use a SVG file, where I put dynamically a g element (as child of
>> the Node named "place" in the tree). This g element is made of 500
>> elements (text,
>> circles, xlink, a). This g element is a "layer". My application has to
>> remove
>> this layer on a user command (I use a popup menu item for this). In the
>> removal method, I use place.removeChild(myGElement) in a RunnableQueue.
>> My problem is that my g element is no longer in the DOM tree but
>> is still
>> rendered (even if I put other elements in the DOM tree or zoom or pan)
>> : I
>> PrintWritered into files the DOM tree to make comparitions...
>>
>> What can I do to force my removed DOM element not to remain
>> rendered onto the
>> SVGCanvas?
>>
>> Thank you :)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Why do my node remains rendered?
Posted by "Jean-Christophe ARNU (JX)" <ar...@paratronic.fr>.
Le Tue, 13 Jan 2004 12:44:48 -0500
Guillaume Pothier <gp...@free.fr> me disait que :
> PS: with batik 1.5.0
>
I use batik 1.5.0 so :)
--
Jean-Christophe Arnu
Paratronic
Re: Why do my node remains rendered?
Posted by Guillaume Pothier <gp...@free.fr>.
PS: with batik 1.5.0
Guillaume Pothier wrote:
> I had what seems to be the same problem.
> I *think* it might be related to concurrency issues because:
> - sometimes GVT peers are properly removed from the GVT tree, and
> sometimes not, I did not find a 100% reproducible test case.
> - Debugging step by step produces different results (usually the correct
> ones)
>
> Jean-Christophe ARNU (JX) wrote:
>
>> Hi,
>> I use a SVG file, where I put dynamically a g element (as child of
>> the Node named "place" in the tree). This g element is made of 500
>> elements (text,
>> circles, xlink, a). This g element is a "layer". My application has to
>> remove
>> this layer on a user command (I use a popup menu item for this). In the
>> removal method, I use place.removeChild(myGElement) in a RunnableQueue.
>> My problem is that my g element is no longer in the DOM tree but
>> is still
>> rendered (even if I put other elements in the DOM tree or zoom or pan)
>> : I
>> PrintWritered into files the DOM tree to make comparitions...
>>
>> What can I do to force my removed DOM element not to remain
>> rendered onto the
>> SVGCanvas?
>>
>> Thank you :)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Why do my node remains rendered?
Posted by Guillaume Pothier <gp...@free.fr>.
I had what seems to be the same problem.
I *think* it might be related to concurrency issues because:
- sometimes GVT peers are properly removed from the GVT tree, and
sometimes not, I did not find a 100% reproducible test case.
- Debugging step by step produces different results (usually the correct
ones)
Jean-Christophe ARNU (JX) wrote:
> Hi,
> I use a SVG file, where I put dynamically a g element (as child of the Node
> named "place" in the tree). This g element is made of 500 elements (text,
> circles, xlink, a). This g element is a "layer". My application has to remove
> this layer on a user command (I use a popup menu item for this). In the
> removal method, I use place.removeChild(myGElement) in a RunnableQueue.
> My problem is that my g element is no longer in the DOM tree but is still
> rendered (even if I put other elements in the DOM tree or zoom or pan) : I
> PrintWritered into files the DOM tree to make comparitions...
>
> What can I do to force my removed DOM element not to remain rendered onto the
> SVGCanvas?
>
> Thank you :)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Why do my node remains rendered?
Posted by "Jean-Christophe ARNU (JX)" <ar...@paratronic.fr>.
I forgot to say : my document is ALWAYS_DYNAMIC :)
--
Jean-Christophe Arnu
Paratronic
Re: Why do my node remains rendered?
Posted by Thomas DeWeese <Th...@Kodak.com>.
Jean-Christophe ARNU (JX) wrote:
> Le Mon, 12 Jan 2004 16:03:09 -0500
> Thomas DeWeese <Th...@Kodak.com> me disait que :
>
>> How certain are you that the DOM you are manipulating is the one
>>being rendered? In particular set[SVG]Document may copy the given
>>DOM if it is not using the Batik DOM Implementation.
>
> I use the svgPanel.getDocument() method to get the document I need to modify.
> IIRC it should be the docment that is rendered into the canvas doesn't it?
Yes, this is always the document used for display. In this case I
would need more information to help you. In general what you are
doing works (I have dozens of examples that do similar things).
Without more information (ideally a standalone example) I can't really
say why it isn't working for you.
If you want to debug it in the context of your application I can
give you some places you can use to check and print stuff out.
Also I don't know that you ever specified what version of Batik you
were using.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Why do my node remains rendered?
Posted by "Jean-Christophe ARNU (JX)" <ar...@paratronic.fr>.
Le Mon, 12 Jan 2004 16:03:09 -0500
Thomas DeWeese <Th...@Kodak.com> me disait que :
> How certain are you that the DOM you are manipulating is the one
> being rendered? In particular set[SVG]Document may copy the given
> DOM if it is not using the Batik DOM Implementation.
I use the svgPanel.getDocument() method to get the document I need to modify.
IIRC it should be the docment that is rendered into the canvas doesn't it?
--
Jean-Christophe Arnu
Paratronic
Re: Why do my node remains rendered?
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Jean,
Jean-Christophe ARNU (JX) wrote:
> I use a SVG file, where I put dynamically a g element (as child of the Node
> named "place" in the tree). This g element is made of 500 elements (text,
> circles, xlink, a). This g element is a "layer". My application has to remove
> this layer on a user command (I use a popup menu item for this). In the
> removal method, I use place.removeChild(myGElement) in a RunnableQueue.
How certain are you that the DOM you are manipulating is the one
being rendered? In particular set[SVG]Document may copy the given
DOM if it is not using the Batik DOM Implementation.
> My problem is that my g element is no longer in the DOM tree but is still
> rendered (even if I put other elements in the DOM tree or zoom or pan) : I
> PrintWritered into files the DOM tree to make comparitions...
>
> What can I do to force my removed DOM element not to remain rendered onto the
> SVGCanvas?
Well there are all sorts of nasty hacks you can apply but you
shouldn't have to. I suspect you aren't doing what you think you
are doing.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org