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 Claire SERRANO <se...@gmail.com> on 2009/09/21 11:12:58 UTC

Update problem (partial update on JSVGCanvas)

Hello,
I work on a Java application based upon batik. It contains a JSVGCanvas
displaying the content of a SVGDocument. That document might be modified.
All modifications are performed in Batik's update manager thread. 

I want to remove several elements at the same time so I use the method
"elt.removeChild(id)" for each element to remove. All removals are performed
in update manager thread, but only a part of objects are removed in schema,
and when I do a zoom/pan the second part of objects disappears.. 

I already done modification of several elements in the same way (to change
colors) and I had no problems...


Thanks for your help.

Regards.

Claire. 
-- 
View this message in context: http://www.nabble.com/Update-problem-%28partial-update-on-JSVGCanvas%29-tp25530256p25530256.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: Update problem (partial update on JSVGCanvas)

Posted by Helder Magalhães <he...@gmail.com>.
Hi Claire,


> All removals are performed in update manager thread, I test my application
> under Debug mode.

You seem to be doing things properly, so I'd invite you to share a
simple test case and/or provide more details such as operating system,
Java version, etc.


> Actually I made a
> "svgCanvas().setRenderingTransform(svgCanvas().getRenderingTransform());",
> it works but it is not very clean..

It's not clear to me why would that workaround the problem. As far as
I know this will, at most, force a full canvas redraw, so my current
guess goes to a display driver/Java 2D bug...?


> Thanks.

Hope this helps,
 Helder

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


Re: Update problem (partial update on JSVGCanvas)

Posted by th...@kodak.com.
Hi Serrano,

Claire SERRANO <se...@gmail.com> wrote on 09/28/2009 05:03:34 AM:

> When I remove all elements, all elements are removed of SVG file but not 
in
> SVGCanvas (before pan/zoom).
> The first and the second part are completely unpredictable (not in same
> group etc.)

    I think you need to provide a more complete code example that shows
the problem.  Trust me Batik does not randomly pick elements to remove
from the rendering tree ;).

> All removals are performed in update manager thread, I test my 
application
> under Debug mode.

    How do you get the updateManager's Update thread?

> Actually I made a
> 
"svgCanvas().setRenderingTransform(svgCanvas().getRenderingTransform());",
> it works but it is not very clean..

    This means that the rendering tree (GVT) is getting updated
with the changes but those changes aren't being noticed by the
Canvas.  Without your hack does the canvas update if you 'mouse over'
the canvas?  Also is the canvas set to be dynamic?

    I think your best option at this point is to try and produce
a standalone example that shows your problem.  I think that exercise
will either show you what the problem is, or at the end make it fairly
easy for us to point out the problem.


Re: Update problem (partial update on JSVGCanvas)

Posted by Claire SERRANO <se...@gmail.com>.
Hi Thomas,

When I remove all elements, all elements are removed of SVG file but not in
SVGCanvas (before pan/zoom).
The first and the second part are completely unpredictable (not in same
group etc.)

All removals are performed in update manager thread, I test my application
under Debug mode.

Actually I made a
"svgCanvas().setRenderingTransform(svgCanvas().getRenderingTransform());",
it works but it is not very clean..

Thanks.
-- 
View this message in context: http://www.nabble.com/Update-problem-%28partial-update-on-JSVGCanvas%29-tp25530256p25641696.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: Update problem (partial update on JSVGCanvas)

Posted by th...@kodak.com.
Hi Claire,

Claire SERRANO <se...@gmail.com> wrote on 09/21/2009 05:12:58 AM:

> I want to remove several elements at the same time so I use the method
> "elt.removeChild(id)" for each element to remove. All removals are 
performed
> in update manager thread, but only a part of objects are removed in 
schema,
> and when I do a zoom/pan the second part of objects disappears.. 

    How are the first and second part of the objects related? (example SVG 
please)
If you remove a group that contains both parts then both will be removed.
The fact that something suddenly disappears after a pan/zoom is a strong 
indicator
that you are modifying the document outside of the UpdateManager's thread.

> I already done modification of several elements in the same way (to 
change
> colors) and I had no problems...