RE: VisAD threading problems [potential sol'n]

  • To: "Bill Hibbard" <billh@xxxxxxxxxxxxx>
  • Subject: RE: VisAD threading problems [potential sol'n]
  • From: "Ian Graham" <ian@xxxxxxxxxx>
  • Date: Mon, 23 Jun 2003 17:27:32 -0600
Hello Bill,

I have a quick fix that seems to resolve my problems.  It needs a closer
look from someone who knows VisAD better, because I don't really understand
the reason for the conditions that are checked in the code I've removed.
Basically I've just commented out code that was explicitly rerendering, and
replaced it with a simple repaint() call.

The fix doesn't seem to interfere with any of the mouse controls,
auto-aspect or animation.  It dramatically improves responsiveness when
zooming, it gets rid of the multiple rendering I get when I'm using
auto-aspect, it fixes the display corruption that occurs when using VisAD
canvases in a JTabbedPane, and so far my I haven't seen a recurrence of
incomplete display update when I close my dialog that replots with a new
data reference.

I hope this is the answer!

I would, however, consider tidying up a bit more:  it's really alarming to
see a Swing component that implements Runnable, given that Swing is
single-threaded, so at the very least I would instead create an inner class
to implement the rendering thread(even anonymously would be fine if you name
clearly enough the variable you assign it to).

I'm still startled by the dramatic improvement to the feel of my app, for
which plot changes used to be flickery even when they did finish correctly.