You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Andreas Neumann <ne...@karto.baug.ethz.ch> on 2006/03/14 20:34:45 UTC

NullPointerException when setting viewBox dynamically

Hi Thomas or Cameron,

I have a problem with the following file where I dynamically change the 
viewBox of the document.documentElement:

The file is at http://www.carto.net/neumann/temp/test.svg - one script 
file is linked.

After I set the viewBox I get the following error message:

java.lang.NullPointerException
    at java.awt.geom.AffineTransform.<init>(AffineTransform.java:395)
    at 
org.apache.batik.bridge.SVGSVGElementBridge.handleDOMAttrModifiedEvent(Unknown 
Source)
    at 
org.apache.batik.bridge.BridgeContext$DOMAttrModifiedEventListener.handleEvent(Unknown 
Source)
    at 
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
    at 
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
    at org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown 
Source)
    at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
    at 
org.apache.batik.dom.AbstractElement.fireDOMAttrModifiedEvent(Unknown 
Source)
    at 
org.apache.batik.dom.AbstractElement$NamedNodeHashMap.setNamedItem(Unknown 
Source)
    at 
org.apache.batik.dom.AbstractElement$NamedNodeHashMap.setNamedItemNS(Unknown 
Source)
    at org.apache.batik.dom.AbstractElement.setAttributeNS(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at 
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
    at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191)
    at org.mozilla.javascript.gen.c263.call(mapApp.js:61)
    at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191)
    at org.mozilla.javascript.gen.c271.call(Inline <script> 
http://www.carto.net/neumann/temp/test.svg:5:6)
    at 
org.mozilla.javascript.optimizer.OptRuntime.callSimple(OptRuntime.java:275)
    at org.mozilla.javascript.gen.c273.call(Event attribute 
http://www.carto.net/neumann/temp/test.svg:3 onload:1)
    at org.mozilla.javascript.gen.c273.exec(Event attribute 
http://www.carto.net/neumann/temp/test.svg:3 onload)
    at org.mozilla.javascript.Context.evaluateReader(Context.java:820)
    at org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown 
Source)
    at 
org.apache.batik.bridge.BaseScriptingEnvironment$1.handleEvent(Unknown 
Source)
    at 
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
    at 
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
    at org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown 
Source)
    at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
    at 
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown 
Source)
    at 
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknown 
Source)
    at 
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)
    at 
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)
    at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)

Is this a bug in Batik or did I do something wrong in my code?

Thanks for any clarification and all the best,
Andreas

-- 
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093  Zurich, Switzerland

Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


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


Re: NullPointerException when setting viewBox dynamically

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
Hi Cameron,

yes, I can confirm that it works now.

Thank you very much for the very quick fix!

Andreas

Cameron McCormack wrote:

>Hi Andreas.
>
>Andreas Neumann:
>  
>
>>I have a problem with the following file where I dynamically change the 
>>viewBox of the document.documentElement:
>>    
>>
>...
>  
>
>>Is this a bug in Batik or did I do something wrong in my code?
>>    
>>
>
>Yes this is a bug.  Fixed in SVN now.
>
>  
>


-- 
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093  Zurich, Switzerland

Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


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


Re: NullPointerException when setting viewBox dynamically

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Andreas.

Andreas Neumann:
> I have a problem with the following file where I dynamically change the 
> viewBox of the document.documentElement:
...
> Is this a bug in Batik or did I do something wrong in my code?

Yes this is a bug.  Fixed in SVN now.

-- 
 Cameron McCormack			ICQ: 26955922
 cam (at) mcc.id.au			MSN: cam (at) mcc.id.au
 http://mcc.id.au/			JBR: heycam (at) jabber.org

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