Exemplo n.º 1
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);
    }
  }
Exemplo n.º 2
0
  /**
   * Sets the set of ScalarMap-s of this instance. The ScalarMap-s of this instance will be added to
   * the set before the SCALAR_MAP_SET property is set. This method fires a PropertyChangeEvent for
   * SCALAR_MAP_SET with <code>null</code> for the old value and the new set of ScalarMap-s for the
   * new Value. Intermediate subclasses that have their own ScalarMap-s should override this method
   * and invoke <code>super.setScalarMaps(ScalarMapSet)</code>.
   *
   * @param maps The set of ScalarMap-s to be added.
   * @throws BadMappingException The RealType of the contour parameter has not been set or its
   *     ScalarMap is alread in the set.
   */
  protected void setScalarMaps(ScalarMapSet maps) throws BadMappingException {

    if (contourMap == null) {
      throw new BadMappingException(
          getClass().getName()
              + ".setScalarMaps(ScalarMapSet): "
              + "Contour parameter not yet set");
    }

    maps.add(contourMap);
    super.setScalarMapSet(maps);
  }