xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: NullPointerException with setToolTip in CanvasUserAgent
Date Fri, 09 Sep 2005 10:23:33 GMT
Hi Steiner,

Steiner, Dominik wrote:

> The line in the JSVGCanvas which throws the exception is following
> 
>                   SVGDocument doc = (SVGDocument)elt.getOwnerDocument();

    Actually this means that 'elt' is null.  In this context 'elt'
is the parent of a 'title' or 'desc' element.  So are you dynamically
modifying the title/desc on mouseover or something?  It's easy enough to
check if the 'parent' is null in 'handleElement', but I'm trying to
figure out how it get's here in the first place.

    I should note that in this context I think this code is a bit
fishy, we are poking around the DOM tree outside of the UpdateManager
thread which really isn't a good thing.  Probably the call to
handleElement shouldn't be forwarded to the AWT Event thread.  Most of
the work should be done in the UpdateManager thread and only the
final tool-tip manipulation should be done in the AWT thread...

> So that means that my element has no ownerdocument… as it is launched 
> from the EventDispatchThread I’m not sure how to avoid this exception by 
> checking that my element is not null??


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


Mime
View raw message