Hi Erich,
Erich Schubert <[email protected]> wrote on 07/29/2009 08:38:09 AM:
> However when the user selects a detail element, I want to switch to
> showing the detail document instead of the main document. Note that I
> still want to keep the main document AND apply pending/future updates
> that come in while I'm showing the other document.
> Because at some point I want to show the main document again.
>
> When I call "setDocument", any waiting events in the updateManager seem
> to get discarded. (My invokeLater tasks get created but are never run)
> So I can't call setDocument in invokeLater or immediately.
All of the updatemanager stuff is tied to the canvas so when the
document isn't associated with the canvas any more that all shuts down
and disconnects from the document.
> I tried using UpdateManagerListener.updateCompleted(), but that doesn't
> seem to work either. I figure there might be new updates already in the
> queue when updateCompleted() gets invoked or something like that.
> I still lose some updates.
Right we don't wait for the updatemanager queue to finish before
shutting it down (as it might well never be empty).
> I figure I could work with two SVG components and just keep one in the
> background or so... what other options do I have for updating the SVG
> document asynchronously without losing updates whenever I call
> setDocument()?
This is the solution I would recommend. This will also have
better performance when switching back since the canvas won't
have to rebuild the entire graphics tree.