xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baron, Randy {PRG~Basel}" <RANDY.BA...@Roche.COM>
Subject OutOfMemoryError and JSVGCanvas not updating
Date Fri, 10 Jan 2003 10:12:23 GMT
Hi -
  I am getting some text from a database and drawing it on a JSVGCanvas
and then adding some decorations, e.g. highlighting in the form of
partially transparent rectangles over the text.  Originally I tried to
create the whole svg document in memory then set it to be displayed but
this failed, sometimes, because I used
aTextElementNode.getBounds().getWidth() to determine the size of a line
and I suppose the size was undefined because the text hadn't been
rendered yet.  I put all of these render-sensitive calls inside a block
like this:
 
canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
            public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
                      doHighLighting();
                   // ...   doOtherTextDecorations();
                   // ...and handle clicks on text and changes to
highlighting
            }
        });
 
and it seems to have solved that problem, although it seems a bit
strange to have basically put the entire rest of the program inside the
GVTTreeRendererListener.  However, two new problems came up:
1st: The highlight boxes only appear after you move the mouse over the
JSVGCanvas.
2nd: If the enclosing JFrame is resized, the following error occurs.
The OutOfMemory line appears once, the next section is repeated over and
over a couple hundred times.
 
java.lang.OutOfMemoryError
java.lang.IllegalStateException: RunnableQueue not started or has exited
            at org.apache.batik.util.RunnableQueue.invokeLater(Unknown
Source)
            at
org.apache.batik.swing.svg.JSVGComponent$SVGListener.dispatchMouseEntere
d(Unknown Source)
            at
org.apache.batik.swing.gvt.JGVTComponent$Listener.mouseEntered(Unknown
Source)
            at
java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:237)
            at java.awt.Component.processMouseEvent(Component.java:5030)
            at java.awt.Component.processEvent(Component.java:4818)
            at java.awt.Container.processEvent(Container.java:1525)
            at java.awt.Component.dispatchEventImpl(Component.java:3526)
            at java.awt.Container.dispatchEventImpl(Container.java:1582)
            at java.awt.Component.dispatchEvent(Component.java:3367)
            at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359)
            at
java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:3199)
            at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3056)
            at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004)
            at java.awt.Container.dispatchEventImpl(Container.java:1568)
            at java.awt.Window.dispatchEventImpl(Window.java:1581)
            at java.awt.Component.dispatchEvent(Component.java:3367)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
            at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea
d.java:191)
            at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.
java:144)
            at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
            at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
            at
java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
 
  If anyone has any input on either of these problems it would be
appreciated.
-Randy

Mime
View raw message