Re: Preventing multiple doAction()-calls

Hi Mathias,

> . . .
> I found the dragging is a bit slow and so I looked into the doAction(). There 
> I recognized that for each manually initialized move of any
> handle the doAction() is called twice. I could understand if a move of the 
> main-handle would cause three calls of doAction() because all three
> handles are triggered by a move of the main-handle but not only twice. And a 
> move of an other handle should only cause one call of doAction()
> because no other handle is triggered. However I need to have only one call 
> per manual drag of a handle.

Direct manipulation of a Real or other data object can
generate two or more updates of the value.

You might try a test at the top of your CellImpl, for the
case where the new value of your Real is equal (or nearly
equal) to its previous value. If it is, then return
immediately without doing any work. You can use one of the
visad.util.Util.isApproximatelyEqual() methods for this test:

  public static boolean isApproximatelyEqual(double a, double b);

Good luck,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: