Re: Using data depictions to select a region...

Hi Pablo,

> Hi, I am new at this VisAD stuff, the only thing I can tell by now is that
> it looks great.
> I am trying (unsuccessfully) to put some code into de VisAd Spreadsheet so I
> can use a couple depiction points to select a region. Could you please give
> an idea (or example) of how to do that.

First, the cleanest way to customize the SpreadSheet is by
extending the and
classs.  You can override the SpreadSheet.createCell() method
to consruct your extension of FancySSCell, where you can do
all sorts of manipulations with the cell's DisplayImpl.

This way your code remains consistent with future changes
to VisAD, rather than having your own private version of
the code.  You invoke such a custom SpreadSheet by:

  java your.package.YourExtensionOfSpreadSheet

You can implement a DisplayListener that listens for listens
for various DisplayEvent.MOUSE_PRESSED*, then apply the logic
described in:

to transform mouse locations to data locations for selecting

Alternatively, you can link RealTuple objects to the DisplayImpl
via DirectManiplutationRendererJ*D, where the user drags these
in the display to drive data selection.  The program
in visad/examples is a simple example of using draggable points
to drive display scaling.

You might set all this up in the in the constructDisplay()
method of your extension of FancySSCell, overriding its
implementation in BasicSSCell  [Curtis, please correct me
if there's a better place to do this].

This task will require understanding a variety of VisAD issues.
So please experiment, but also let us know if you have questions
or problems.

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

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