예제 #1
0
파일: Test05.java 프로젝트: tomw2/visad
  void setupServerData(LocalDisplay[] dpys) throws RemoteException, VisADException {
    RealType[] types = {RealType.Latitude, RealType.Longitude};
    RealTupleType earth_location = new RealTupleType(types);
    RealType vis_radiance = RealType.getRealType("vis_radiance");
    RealType ir_radiance = RealType.getRealType("ir_radiance");
    RealType[] types2 = {vis_radiance, ir_radiance};
    RealTupleType radiance = new RealTupleType(types2);
    FunctionType image_tuple = new FunctionType(earth_location, radiance);

    int size = 64;
    FlatField imaget1 = FlatField.makeField(image_tuple, size, false);

    dpys[0].addMap(new ScalarMap(RealType.Latitude, Display.YAxis));
    dpys[0].addMap(new ScalarMap(RealType.Longitude, Display.XAxis));
    dpys[0].addMap(new ScalarMap(ir_radiance, Display.Green));
    dpys[0].addMap(new ScalarMap(vis_radiance, Display.RGB));
    dpys[0].addMap(new ScalarMap(ir_radiance, Display.ZAxis));
    dpys[0].addMap(new ConstantMap(0.5, Display.Blue));
    dpys[0].addMap(new ConstantMap(0.5, Display.Red));
    ScalarMap map1contour;
    map1contour = new ScalarMap(vis_radiance, Display.IsoContour);
    dpys[0].addMap(map1contour);
    if (uneven) {
      ContourControl control = (ContourControl) map1contour.getControl();
      float[] levs = {10.0f, 12.0f, 14.0f, 16.0f, 24.0f, 32.0f, 40.0f};
      control.setLevels(levs, 15.0f, true);
      control.enableLabels(true);
    }

    DataReferenceImpl ref_imaget1 = new DataReferenceImpl("ref_imaget1");
    ref_imaget1.setData(imaget1);
    dpys[0].addReference(ref_imaget1, null);
  }
예제 #2
0
파일: IsoSurface.java 프로젝트: Unidata/IDV
  /**
   * Sets the "contour" value, the value of the isosurface. This method fires a PropertyChangeEvent
   * for SURFACE_VALUE.
   *
   * @param value The value of the isosurface.
   * @throws VisADException VisAD failure.
   * @throws RemoteException Java RMI failure.
   * @see #SURFACE_VALUE
   */
  public final void setSurfaceValue(float value) throws RemoteException, VisADException {

    if (value != surfaceValue) {
      Float oldValue = new Float(surfaceValue);

      if (contourControl != null) {
        contourControl.setSurfaceValue(value, true /*setLevels*/);
      }

      surfaceValue = value;

      firePropertyChange(SURFACE_VALUE, oldValue, new Float(surfaceValue));
    }
  }
예제 #3
0
  /**
   * Sets a VisAD ContourControl.
   *
   * @param control The VisAD ContourControl to be set by this object.
   * @param minimum The minimum value. Shall be a finite value.
   * @param maximum The maximum value. Shall be a finite value.
   * @throws VisADException Invalid range extrema or VisAD failure.
   * @throws RemoteException Java RMI failure.
   */
  public synchronized void setControl(ContourControl control, float minimum, float maximum)
      throws VisADException, RemoteException {

    if (Float.isInfinite(minimum)
        || Float.isNaN(minimum)
        || Float.isInfinite(maximum)
        || Float.isNaN(maximum)) {
      throw new VisADException(
          getClass().getName()
              + ".setControl(ContourControl,float,float): "
              + "Invalid range extrema (max or min is infinite or NaN)");
    }

    // control.setContourInterval(interval, minimum, maximum, getBase());
    control.setLevels(
        visad.Contour2D.intervalToLevels(interval, minimum, maximum, getBase(), new boolean[1]),
        getBase(),
        dash);
  }