Hello sir,
sorry there was a typographical error in my mail, the function is supposed to be like this:
setWidth( Integer x )
{
root.setAttribute("viewBox", "0,0," + x.toString() + ",250");
root.setAttribute("width", x.toString());
}
 
I set the height by some constant value. Btw, here is the trace of the error:
 

java.lang.NullPointerException

at java.awt.geom.AffineTransform.<init>(Unknown Source)

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.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.AbstractAttr.setNodeValue(Unknown Source)

at org.apache.batik.dom.AbstractAttr.setValue(Unknown Source)

at org.apache.batik.dom.AbstractElement.setAttribute(Unknown Source)

at com.tillphotonics.gpe.document.ProtocolScoreViewDocument.setViewBox(ProtocolScoreViewDocument.java:237)

at com.tillphotonics.gpe.ProtocolScoreView$zoomOut.handleEvent(ProtocolScoreView.java:133)

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.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown Source)

at org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown Source)

at org.apache.batik.bridge.BridgeEventSupport$Listener.mouseClicked(Unknown Source)

at org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(Unknown Source)

at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(Unknown Source)

at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source)

at org.apache.batik.gvt.event.AWTEventDispatcher.mouseClicked(Unknown Source)

at org.apache.batik.swing.svg.JSVGComponent$17.run(Unknown Source)

at org.apache.batik.util.RunnableQueue.run(Unknown Source)

at java.lang.Thread.run(Unknown Source


Thanks a lot.
 
Philip Zuniga
 
On 5/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
Hi Philip,

"philip zuniga" <[EMAIL PROTECTED] > wrote on 05/26/2006 12:05:10 AM:

> I have a function in my java code that adjusts the viewbox attribute of
my SVG
> document. This function changes the 3rd parameter of the viewbox
attribute and
> the width of the SVG file:
>
> setWidth( Integer x )
> {
> root.setAttribute("viewBox", "0,0," + x.toString() + ",0");

   This doesn't look particularly good to me, the 'height' of
your viewBox is being set to zero, which might cause some problems....

> I noticed that when I increase the x, the viewbox and the width
increases
> accordingly. But when I decrease my x attribute I get a null pointer
> assignment error, do you know why I get such an error?

   Not with any confidence (the above might be part of it),
but if you provide the stack trace I might be able to.


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


Reply via email to