xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger Critchlow" <...@elf.org>
Subject Re: null pointer reference in batik JSVGScrollPane
Date Tue, 02 May 2006 06:01:46 GMT
Applying the obvious fix to this leads to another null reference. 
Applying the obvious fix there leads to the attached patch and no more
exceptions.

-- rec --

On 4/30/06, Roger Critchlow <rec@elf.org> wrote:
> I'm running JSVGCanvas inside JSVGScrollPane, started like this:
>
>                 scrollPane = new JSVGScrollPane(new JSVGCanvas(null, true, false));
>                 svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
>
> Recently I began noticing these errors on the console, usually when
> I'm dragging some SVG component around on the Canvas, not scrolling:
>
> Fatal exception caught in Swing Interface: java.lang.NullPointerException
> java.lang.NullPointerException
>         at org.apache.batik.swing.JSVGScrollPane.getViewBoxRect(JSVGScrollPane.java:604)
>         at org.apache.batik.swing.JSVGScrollPane$ScrollListener.updateCompleted(JSVGScrollPane.java:408)
>         at org.apache.batik.swing.svg.AbstractJSVGComponent$9.run(AbstractJSVGComponent.java:1900)
>         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
>         at java.awt.EventQueue.dispatchEvent(Unknown Source)
>         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
>         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
>         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>         at java.awt.EventDispatchThread.run(Unknown Source)
>
> That line number corresponds to the last return statement here:
>
>         GraphicsNode gn = canvas.getGraphicsNode();
>         if (gn == null) return null;
>
>         return (Rectangle2D)gn.getBounds().clone();
>
> This is a fairly recently updated SVN checkout of batik.
>
> -- rec --
>

Mime
View raw message