REH Wolfgang wrote:

I just tried to update from batik 1.5 to 1.5.1 but do have troubles. Previously I called Canvas.getUpdateManager.repaint() to force an immediate repaint of the canvas. Now that method is protected and I didn't find a possibility to force the canvas to update it's contents after changing some attributes in the document. If I just remove the repaint-call the canvas gets refreshed only when the mouse is moved, but that's not acceptable for our application. How do I force the canvas to immediately update it's contents after changing of an attribute (e.g.. colour of an element)?

You need to make your modifications to the Document from within the UpdateManager thread. This can be done with:

...batik.util.RunnableQueue rq;
rq = canvas.getUpdateManager.getUpdateRunnableQueue()

rq.invokeLater(java.lang.Runnable)  - or -
rq.invokeAndWait(java.lang.Runnable)[*]

   This change is actually quite essential for proper operation,
If you want to know why this is needed you might want to read faq-25:

http://xml.apache.org/batik/faqs.html#faq-25
      Why do I have to go through the UpdateManager to run my code?
      Can't you just synchronize the DOM?

   Also before you ask why the UpdateManager is null some of the time
you might want to read faq-24 (the one right before it).

http://xml.apache.org/batik/faqs.html#faq-24

[*] You need to be careful if you try and call invokeAndWait
from the Swing Thread because for some DOM methods it
needs swing info and hence tries to call back to the Swing thread
which will deadlock.

Regards
Wolfgang Reh



* Wolfgang Reh


*Scheydgasse 41
1210 Wien

Tel: +43 (1) 27722 - 5281
mailto:[EMAIL PROTECTED]




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



Reply via email to