Re: Removing maps from display

Hi Gunnar,

> I've created a user interface wrapping the display and some of its Maps
> such as Color, Alpha, Contour etc. The user should be able to turn these
> maps on and off as he pleases. I could however, not find a method for
> removing a map from the display. The only way I could find was to call
> DisplayImpl.clearMaps() and re-add the others afterwards. The clearMaps()
> method could only be called when the datareference vector is empty.
> What I had to do is then, remove all references from the display, clear all
> maps, add all but the one map, add all references back again. This seems to
> be rather inefficient. Is there another way of doing this a bit more
> smoothly?

I'm afraid that's what you have to do. However, you can
write a method, perhaps with signature:

  public static void addMap(DisplayImpl display, ScalarMap map)l

that hides all this logic from applications.

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

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