NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Access to Coordinates

Hi Gopal

Suppose you have a class VisADTest. The following
codes could help you what you need.

public class VisADTest implements DisplayListener{

DisplayImpl display;
float lat,lon;

//codes....................


public void displayChanged( DisplayEvent de )
{

  if (de.getId() == DisplayEvent.MOUSE_PRESSED_CENTER) {

       DisplayRenderer dr = display.getDisplayRenderer();
       lat = (float)dr.getDirectAxisValue(RealType.Latitude);
       lon = (float)dr.getDirectAxisValue(RealType.Longitude);

  }
}

// codes.....

}// end of class

Cheers
Ko Ko


Vimal Gopal wrote:

> Bill and others,     I noticed that when I click both mouse buttons at
> the same time I am able to view the coordinates of the location my
> pointer is on at the top left corner of the window.  I was wondering
> whether this information (the coordinates) is available to
> programmer's wanting to utilize this information in their own programs
> or whether it is encapsulated and hidden away.  In other words is
> there a method that returns the coordinates and if so, which method
> does this? Thanks, Vimal Gopal

--
Bureau of Meteorology Conference Email Account  (replies are not
private)



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