xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bishop, Michael W. CONTR J9C880" <Michael.Bis...@je.jfcom.mil>
Subject Two issues: File locks on embedded images. Stack trace on resume processing.
Date Thu, 13 Sep 2007 18:38:05 GMT
OK, I'm trying to "clean" up after I'm done with an SVG document on the
JSVGCanvas:

jsvgCanvas.stopProcessing();

// Done to avoid errors.
Thread.sleep(200);

jsvgCanvas.setDocument(null);
jsvgCanvas.flushImageCache();

At this point, any embedded image files that were being shown on the
JSVGCanvas will not delete.  The SVG document itself will delete, but
not the images!  How do I get rid of the lock on the image files?

On a related note, when I'm ready to show a new document:

jsvgCanvas.resumeProcessing();
jsvgCanvas.setDocument(...);

...sometimes results in this stack trace:

java.lang.NullPointerException
        at
org.apache.batik.swing.svg.AbstractJSVGComponent.setGraphicsNode(Abstrac
tJSVGComponent.java:824)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.gvtBuildCom
pleted(AbstractJSVGComponent.java:1479)
        at
org.apache.batik.swing.svg.GVTTreeBuilder$2.dispatch(GVTTreeBuilder.java
:162)
        at
org.apache.batik.util.EventDispatcher.dispatchEvent(EventDispatcher.java
:102)
        at
org.apache.batik.util.EventDispatcher.fireEvent(EventDispatcher.java:86)
        at
org.apache.batik.util.EventDispatcher$1.run(EventDispatcher.java:45)
        at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea
d.java:242)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.
java:163)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at
java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Any way around that?

This is still the 1/08/2007 SVN build of Batik.

Michael Bishop

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


Mime
View raw message