Beispiel #1
0
 /**
  * Initialize the lat/lon scalar maps
  *
  * @throws RemoteException On badness
  * @throws VisADException On badness
  */
 public void initLatLonMap() throws VisADException, RemoteException {
   if (latMap != null) {
     return;
   }
   if (getDisplayMaster() == null) {
     return;
   }
   boolean callScale = (latMap == null);
   DisplayImpl display = (DisplayImpl) getDisplayMaster().getDisplay();
   // find spatial maps for Latitude and Longitude
   latMap = null;
   lonMap = null;
   Vector scalar_map_vector = display.getMapVector();
   Enumeration en = scalar_map_vector.elements();
   while (en.hasMoreElements()) {
     ScalarMap map = (ScalarMap) en.nextElement();
     DisplayRealType real = map.getDisplayScalar();
     DisplayTupleType tuple = real.getTuple();
     if ((tuple != null)
         && (tuple.equals(Display.DisplaySpatialCartesianTuple)
             || ((tuple.getCoordinateSystem() != null)
                 && tuple
                     .getCoordinateSystem()
                     .getReference()
                     .equals(Display.DisplaySpatialCartesianTuple)))) { // Spatial
       if (RealType.Latitude.equals(map.getScalar())) {
         latMap = map;
       } else if (RealType.Longitude.equals(map.getScalar())) {
         lonMap = map;
       }
     }
   }
   if (callScale) {
     setScale(baseScale);
   }
 }
Beispiel #2
0
  /**
   * Initialize the color maps
   *
   * @throws RemoteException On badness
   * @throws VisADException On badness
   */
  private void initColorMaps() throws VisADException, RemoteException {
    setupTypes();
    if (doColors) {
      ScalarMap rmap = new ScalarMap(front_red, Display.Red);
      rmap.setRange(0.0, 1.0);
      ScalarMap gmap = new ScalarMap(front_green, Display.Green);
      gmap.setRange(0.0, 1.0);
      ScalarMap bmap = new ScalarMap(front_blue, Display.Blue);
      bmap.setRange(0.0, 1.0);

      ScalarMapSet maps = getScalarMapSet(); // new ScalarMapSet();
      maps.add(rmap);
      maps.add(bmap);
      maps.add(gmap);
      setScalarMapSet(maps);
    }
  }