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 <[EMAIL PROTECTED]> 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 --

Attachment: JSVGScrollPane.patch
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to