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.
Hi Jacky, >I am trying to extend the spreadsheet class so that the user can select a >location to zoom into, for instance a map of Europe is shown and if user >selects South England it will zoom into that particular location. My question >is two fold, firstly what method actually sets the range. I have checked >GMCWidget and other widgets such as ContourWidget but not found what I want. >Maybe I have overlooked I am not sure. If by "zoom in" you mean simulate a Shift+left mouse drag action, then you'll need to grab the ProjectionControl from the display and change the projection matrix. See examples/Test57 for a program that programmatically alters the projection matrix. If you mean "zoom in" by changing the scale (so that your data "grows" and fills up more of the white-outlined box), you'd accomplish that by calling setRange on the spatial ScalarMaps. See examples/Test26 for a program that programmatically alters the scale. >Secondly I would like to know if there is a way to make sure what is outside >the range is invisible. I have imported the Europe map and have used the >widget that automatically pops up in SpreadSheet to changed the range for >Xaxis and Yaxis so that it seems to be zooming into a particular location. >However if I do this I get the a map which covers not just the range but >outside it too. I have read the VisAD tutorial in section 2.5 and it asks me >to select ScalarMap with SelectRange as DisplayRealType then it should solve >my problem. But I don?t know how to make use of this in SpreadSheet. You can do a SelectRange in the SpreadSheet by choosing "Edit mappings..." from the Cell menu and mapping one of the RealTypes to "Select Range" (in the bottom right-hand corner of the DisplayRealTypes). A new widget will appear in the widget panel that allows you to alter the visible range of the data. -Curtis
visad
archives: