コード例 #1
0
    public DragLine(
        final MultiSpectralDisplay msd,
        final String controlId,
        final ConstantMap[] color,
        float[] YRANGE)
        throws Exception {
      if (msd == null)
        throw new NullPointerException("must provide a non-null MultiSpectralDisplay");
      if (controlId == null) throw new NullPointerException("must provide a non-null control ID");
      if (color == null) throw new NullPointerException("must provide a non-null color");

      this.controlId = controlId;
      this.multiSpectralDisplay = msd;
      this.YRANGE = YRANGE;
      lastSelectedValue = multiSpectralDisplay.getWaveNumber();

      for (int i = 0; i < color.length; i++) {
        mappings[i] = (ConstantMap) color[i].clone();
      }
      mappings[4] = new ConstantMap(-0.5, Display.YAxis);

      Gridded1DSet domain = multiSpectralDisplay.getDomainSet();

      domainType = multiSpectralDisplay.getDomainType();
      rangeType = multiSpectralDisplay.getRangeType();
      tupleType = new RealTupleType(domainType, rangeType);

      selector = new DataReferenceImpl(selectorId);
      line = new DataReferenceImpl(lineId);

      display = multiSpectralDisplay.getDisplay();

      display.addReferences(
          new GrabLineRendererJ3D(domain),
          new DataReference[] {selector},
          new ConstantMap[][] {mappings});
      display.addReference(line, cloneMappedColor(color));

      addReference(selector);
    }
コード例 #2
0
    public RubberBandBox(final MultiSpectralDisplay msd, final ScalarMap x, final ScalarMap y)
        throws VisADException, RemoteException {
      RealType domainType = msd.getDomainType();
      RealType rangeType = msd.getRangeType();

      LocalDisplay display = msd.getDisplay();

      rubberBand = new DataReferenceImpl(hashCode() + RBB);
      rubberBand.setData(
          new RealTuple(
              new RealTupleType(domainType, rangeType), new double[] {Double.NaN, Double.NaN}));

      display.addReferences(
          new RubberBandBoxRendererJ3D(domainType, rangeType, 1, 1),
          new DataReference[] {rubberBand},
          null);

      xmap = x;
      ymap = y;

      this.addReference(rubberBand);
    }