Even if it were called in the Swing thread you can have a small class
that just tracks the 'state' of the Canvas.  Heck the modification of the
document to be written can be delayed indefinitely.  So when I went to
set the new document I would do something like:

final Document oldDoc = canvas.getSVGDocument();
final UpdateManager um = canavs.getUpdateManager();
um.addUpdateManagerListener(new UpdateManagerAdapter() {
   public void managerStopped(UpdateManagerEvent e) {
      um.removeUpdateManagerListener(this);
      prepDocument(oldDoc);
      writeDocument(oldDoc);
   }
};
canvas.setSVGDocument(newDoc);

This Listener will 'hang out' until the UpdateManager stops then it will
prep the old doc for write, then write it, no blocking or anything
messy.

Hmm, there is a problem with this. The BridgeContext isn't disposed of until after all the managerStopped Listeners have been called. I don't think this is correct behavior, but until it's fixed you will actually have to hang your listener off the document load or gvt build listener to make sure the old document is no longer 'active'.




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



Reply via email to