xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Matuszczak" <l.matuszc...@atrem.pl>
Subject how to dispose JSVGCanvas?
Date Tue, 15 Feb 2005 12:40:03 GMT
Hello,
I am not sure what is a proper way to close JSVGCanvas, and all its inner 
objects and threads. Do I have to use "stopProcessing" method or is calling of 
"dispose" method sufficient?. I want to free all image caches too. Does method 
flushImageCache() from JSVGComponent fulfil my needs or do I need to call 
flush() from JGVTComponent?
In what order should I call these methods?
I am also curious if it is safe to call above mentioned methods before my 
JSVGCanvas is fully started (ie before gvtBuildCompleted, gvtRenderingCompleted 
methods are called).
I think that is important because i occassionally ran into an exception (in 
1.5.1 release):
java.lang.NullPointerException
 at org.apache.batik.swing.svg.JSVGComponent.stopThenRun(JSVGComponent.java:606)
 at 
org.apache.batik.swing.svg.JSVGComponent.setSVGDocument(JSVGComponent.java:575)
 at org.apache.batik.swing.svg.JSVGComponent.dispose(JSVGComponent.java:364)

I think that the whole JSVGCanvas lifecycle is a bit complicated. I haven't 
found any detailed description of it, so it is not obvious for me which methods 
may be called asynchronously on JSVGCanvas and when they may be called.

I have also a short question about listeners related to JSVGCanvas object.Is it 
true that all methods in listeners registered on JSVGCanvas events (for example 
in GVTTreeRendererListeners) are invoked from AWT event dispatching thread? I 
discovered it recently and I am not sure if it is an intentional behaviour.

Lukasz Matuszczak 



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message