From batik-users-return-2598-apmail-xml-batik-users-archive=xml.apache.org@xml.apache.org Fri Jan 10 10:16:03 2003 Return-Path: Delivered-To: apmail-xml-batik-users-archive@xml.apache.org Received: (qmail 95534 invoked by uid 500); 10 Jan 2003 10:16:02 -0000 Mailing-List: contact batik-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: "Batik Users" Delivered-To: mailing list batik-users@xml.apache.org Received: (qmail 95523 invoked from network); 10 Jan 2003 10:16:01 -0000 Date: Fri, 10 Jan 2003 11:12:23 +0100 From: "Baron, Randy {PRG~Basel}" Subject: OutOfMemoryError and JSVGCanvas not updating To: batik-users@xml.apache.org Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft Exchange V6.0.6334.0 Content-type: multipart/alternative; boundary="Boundary_(ID_CGWqqolH3v/IoMZW1itP5w)" Thread-Topic: OutOfMemoryError and JSVGCanvas not updating Thread-Index: AcK4kMT+hLHM9449ScKscOdOPG9H0Q== content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: X-OriginalArrivalTime: 10 Jan 2003 10:12:24.0269 (UTC) FILETIME=[C52D7FD0:01C2B890] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --Boundary_(ID_CGWqqolH3v/IoMZW1itP5w) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable 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: =20 canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() { public void gvtRenderingCompleted(GVTTreeRendererEvent e) { doHighLighting(); // ... doOtherTextDecorations(); // ...and handle clicks on text and changes to highlighting } }); =20 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. =20 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) =20 If anyone has any input on either of these problems it would be appreciated. -Randy --Boundary_(ID_CGWqqolH3v/IoMZW1itP5w) Content-type: text/html; charset=us-ascii Content-transfer-encoding: quoted-printable

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() {

       &nbs= p;    public void gvtRenderingCompleted(GVTTreeRendererEvent e) = {

       &nbs= p;            = ;  doHighLighting();

        = ;           = // …   doOtherTextDecorations();

       &nbs= p;           // …and handle clicks on text and changes to = highlighting

           &nbs= p;}

        = });

 

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.dispatchMouseEntered= (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)<= /font>

        = ;    at = java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread= .java:191)

        = ;    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.j= ava: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)<= /span>

 

  If anyone has any = input on either of these problems it would be = appreciated.

-Randy

=00= --Boundary_(ID_CGWqqolH3v/IoMZW1itP5w)--