Hi Martin, >> [EMAIL PROTECTED] wrote: >> >> That said I'm a little surprised you modify the document at all... >> If you are drawing in an Overlay you can (and probably should) modify >> the Overlay in the Swing thread. What are you changing in the Document >> that requires you to do your changes in the UpdateManager thread?
Martin Constantine <[EMAIL PROTECTED]> wrote on 03/21/2007 05:12:23 AM: > The drawings need to be saved with the document so that users who > subsequently view the document see them. We don't actually use > repaint() for the overlay at all, so in essence this is just a > disguised Interactor. Uhh, well since the _only_ method in the Overlay Interface is 'paint' you don't have an Overlay at all. ;) Anyway, I thought you appended everything at the end of the draw action: Martin Constantine <[EMAIL PROTECTED]> wrote on 03/16/2007 06:24:06 AM: > Updates to the document occur on mousePressed, mouseDragged, and > mouseReleased. The GVT tree is updated on mouseReleased where the > entire stroke is appended to the current stroke group. Drawing the interactive stuff in the overlay is really a much better way to handle things. > Each update is done with a mouse up event, which ultimately executes > the following snippet via the update manager: You say a 'mouse up event' but that would be at the end of all the drawing. So which is it? BTW if you are appending content that includes your animation elements then this may account for the extra overhead as we now need to locate all those elements and parse them and add them to the animation timeline. Where is the 'lag'? Is it while drawing or after the user draws and the items are added to the canvas? > final Element stroke = anim.endStroke(); > > RunnableQueue rq = updateManager.getUpdateRunnableQueue(); > rq.invokeLater(new Runnable() { > > public void run() { > currScribbleGroup.appendChild(stroke); > } > }); > After more poking around, I see that there are also updates to the > document on mousedown and mouse drag events, but these do not occur > on the update manager thread, just the mouse up event. I'm not sure > if this is relevant or not though. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]