Hi Victor.

"V. de Weger" <[EMAIL PROTECTED]> wrote on 09/26/2006 06:53:58 PM:

> Because the alternative stylesheet option in the useragent has the same
> effect as changing the css in the DOM, I tried it from that angle, and 
that
> seems to be working fine. When I step through my code (debug in eclipse) 
the
> next code works fine, but when I run it in normal mode I get NPE's in
> fireEventListeners (see stacktrace). Has anybody any clue what's going 
on?

   My guess is that when you step through the code the other threads
get ahead of you and avoid some sort of concurrent operation on the
document.

> My code (in a method of subclassed JSVGCanvas):
> 
>       if (getUpdateManager()!=null) {
>          getUpdateManager().interrupt();
>       }

   I would suggest using the 'stopThenRun(Runnable)'
method of the canvas which will shut down the current
document a bit cleaner...

>       ... remove all the event listeners I created ...

   I would remove the document from the canvas at this point.
by calling 'setSVGDocument(null)'

>       if (this.getDocument()!= null) {
>               ((SVGOMDocument)this.getDocument()).clearViewCSS();
> 
>          ... change the alternate stylesheet in the useragent of the 
canvas ...
> 
>               this.setSVGDocument(this.getDocument());
>       }

----

> After running this code I get multple (>40) sets of this stacktrace (I'm
> using a recent 1.6 trunc version):
> 
> java.lang.NullPointerException
>    at 
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown
> Source)

   If you had line numbers it would help.

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

Reply via email to