« Return to Thread: Repainting a JSVGCanvas

Re: Repainting a JSVGCanvas

by aaaa aaaa :: Rate this Message:

Reply to Author | View in Thread

Hi,

the problem is that I get occasionally a NullPointerException in the ScrollListener of the JSVGCanvas. The variable "newview" is null in the updateCompleted method .

Rectangle2D newview = getViewBoxRect();

So sometimes the canvas gets white and it has to be repaint. It's immediatly repainted when I resize the frame or when I'm using the scrollbars. But I've inserted

if (newview == null) {
canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() {

@Override
public void run() {
canvas.repaint();
}

});
return;
}

and this does not have any effect. Another solution maybe would be to avoid to get the Exception. But I don't see what I'm doing wrong.


--- Cameron McCormack <cam@...> schrieb am Mi, 28.5.2008:
Von: Cameron McCormack <cam@...>
Betreff: Re: Repainting a JSVGCanvas
An: batik-users@...
Datum: Mittwoch, 28. Mai 2008, 3:09

aaaa aaaa: > Hi,how can I force a JSVGCanvas to "repaint" itself? I do not mean > the repaint method but the kind of repaint when I resize the internal > frame the JSVGCanvas is located in or move the JSVGScrollPane > scrollbar.Thanks in advance.  Can you be a bit more specific about what behaviour you see and what you expect?  When you resize the frame the canvas is in, does it just paint white in the areas you’d expect to see more of your SVG document?  If so, then the solution might be as simple as putting an
 overflow="visible" attribute on your root <svg> element.  --  Cameron McCormack ≝ http://mcc.id.au/  --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@... For additional commands, e-mail: batik-users-help@...


Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.

 « Return to Thread: Repainting a JSVGCanvas