George Armhold wrote:

Is it safe to call setSVGDocument at any time, or must I make sure
that the previous doc loading/building/rendering has completed?  I
just constructed a test case that loads several documents in
succession, and get the following NPE:

It is safe to call 'setSVGDocument' at any time - but as with all Swing components you should only call methods from the Swing thread. We have a pretty good test of this in regard (our test harness) so I'm fairly confident that it works properly. In the case below you should be able to do an EventQueue.invokeAndWait(...).

java.lang.NullPointerException
at org.apache.batik.swing.svg.JSVGComponent.stopThenRun(Unknown Source)
at org.apache.batik.swing.svg.JSVGComponent.setSVGDocument(Unknown Source)
at CanvasTest$1.run(CanvasTest.java:63)
at org.apache.batik.util.RunnableQueue.run(Unknown Source)
at java.lang.Thread.run(Thread.java:534)



I was assuming that the "canceled" methods in the various listener interfaces meant that the canvas correctly handles requests to load new docs before in-progress loads have completed.

Thanks






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



Reply via email to