I'm still struggling with threads in Batik.  A previously discussed
recommendation was to "leave the canvas alone until
gvtTreeRenderingComplete is fired".  However what does one do when the
requests for updating the canvas/DOM are firing from the Swing thread?
You can't block in the Swing thread, because the Batik events are
apparently fired from there as well, so I'll never see
gvtTreeRenderingComplete.  Here's the scenario:

1. Swing event triggers canvas.setSVGDocument(firstDoc).

2. manipulate firstDoc's DOM (in UpdateManger's thread) in response to
   Swing mouse clicks, etc.

3. Swing event calls canvas.getSVGDocument() to get the modified
   firstDoc back, and then canvas.setSVGDocument(secondDoc).

4. manipulate firstDoc's DOM in Swing thread.

I then get a NullPointerException, presumably because I am modifying
the firstDoc DOM outside of the UpdateManager thread. The kind of
situation that is triggering this behavior is when the user clicks the
"load next SVG document" button too quickly in succession.

Perhaps I am going about things the wrong way, because very often when
using the canvas I end up trying all sorts of threading chicanery to
simulate blocking for Batik's non-blocking methods.

Thanks



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



Reply via email to