20001003: Displaying data samples

>From: phorisb@xxxxxxxxxxxx (Patrick Horisberger)
>Organization: 
>Keywords: 200010031547.e93FlLb19374

Hi Patrick-

>Hi everybody,
>
>1. Displaying data samples: 
>
>Thank you very much for your response. I know, my english knowledge are 
>not the best, but I think that Doug has exactly understood what I meant.
>
>I have got the function ((row, col) --> exp) which describes a twodimensional
>image. Now I'd like to be able to get not only the spatial location of the
>cursor but also the 'exp'-value at the speciefied location. Assumed I
>would have a second function like ((row, col) -->err) showed in a second
>display, would it be possible to get the 'err'-values and display it in
>the upper left corner of the first display?  I think Doug's solution (see
>below) is the right way, but where can I change the interaction methods or
>rather where can I define what is exactly displayed in the left corner ?   

There is a getCursor() method in DisplayRenderer which will give the
xyz values for the cursor.  If you have row,col directly mapped to
YAxis and XYAxis, then you could call ScalarMap.inverseScaleValues()
passing in the x and y values to get back row and column. 

Once you got the (row,col), you could create a new RealTuple and
use the Function.evaluate() method to get out values for exp or err.

Alternatively, you could call DisplayRenderer.getDirectAxisValue()
with the RealTypes for row and col to get the double values.

The big question is when to implement these methods. You could add a
DisplayListener to listen for DisplayEvents (ex: MOUSE_PRESSED_*) to
know when to initiate your action.

>2. Problems with setScaleColor() method.
>
>I have plotted two quantities on the same x-axis. To distinguish
>both functions from each other, the colors of the x-axis
>are controlled by the setScaleColor() method. This works. The problem
occurs only when I'm scaling the x-axis with the setScale method. 
>After adding following line to my code the x-axis become white again.
>
>exp_map.setRange(exp_min - (exp_interval / 2.0f), exp_max + (exp_interval
>/ 2.0f))

Hopefully someone else can look into this for you as I'll be out of
town for the next few days.  This sounds like a bug in ScalarMap.

I'm sorry this is cryptic, but I'm trying to get ready for a trip,
so don't have time to answer fully.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
*************************************************************
Unidata WWW Server               http://www.unidata.ucar.edu/
McIDAS Demonstration Machine  http://mcdemo.unidata.ucar.edu/
*************************************************************


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