Thomas DeWeese wrote:
This is why I would put print statements in the event handlers. I suspect something 'surprising' happening in the event handing...
[ ... ]
Any possability that the mouse release is the release from the user pressing the 'load' button?
I instrumented the code as you suggested. The MouseReleased event is only coming from the JSVGComponent; ie I am NOT getting MouseReleased from the "load svg doc" button. Too bad, would have been an easy fix. :-)
However I did notice that the events (Swing & UpdateManagerListener) are coming in rather strangely. I am seeing the following:
mouseReleased "load new doc" button pressed updateStarted (UpdateManagerListener) updateCompleted (UpdateManagerListener) managerStopped (UpdateManagerListener)
Hmm, Do you have a 'mouseRelease done' message at the end of the event handler?
I would have expected the "load new doc" line to be printed LAST. So this would explain the occasional NullPointerException/RunnableQueue not started exceptions. The question is: why is Swing seemingly not blocking on invokeAndWait(), but rather allowing the multiple events (MouseReleased, button press) to be fired before the update is complete? Anyway, if calling invokeAndWait() from Swing/AWT events is not recommended, I will have to change my approach.
You could check the current thread see what threads are being used where.
Ok A word of caution on my previous assurences about 'good behaviour' The canvas will make sure that the any currently running update completes but I do not think it will run the Update Manager queue to empty.
So this means that any currently running "runnable" will finish, but the queue will not be emptied of all such runnables?
100% correct.
This is why I was trying to make the Swing thread block until the DOM was updated- to prevent the user from being able to click the "load new document" button until all elements were added.
My suspicion is that you have succeeded in this and that you are picking up another mouse up somewhere along the line.
I don't think that I've really succeeded if the invokeAndWait needs to be removed. I will have to figure out how to make this work with invokeLater.
It would be best to. You will probably have to 'delay' the load document call until the current document is 'done'.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]