コード例 #1
0
  public void refreshDisplay() throws VisADException, RemoteException {
    if (display == null) return;

    synchronized (displayedThings) {
      for (DataReference ref : displayedThings) {
        display.removeReference(ref);
        display.addReference(ref, colorMaps.get(ref));
      }
    }
  }
コード例 #2
0
  public void reorderDataRefsById(final List<String> dataRefIds) {
    if (dataRefIds == null) throw new NullPointerException("");

    synchronized (displayedThings) {
      try {
        displayedThings.clear();
        for (String refId : dataRefIds) {
          DataReference ref = idToRef.get(refId);
          ConstantMap[] color = colorMaps.get(ref);
          display.removeReference(ref);
          display.addReference(ref, color);
        }
      } catch (Exception e) {
      }
    }
  }
コード例 #3
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);
    }
コード例 #4
0
  public void addRef(final DataReference thing, final Color color)
      throws VisADException, RemoteException {
    if (display == null) return;

    synchronized (displayedThings) {
      ConstantMap[] colorMap = makeColorMap(color);

      displayedThings.add(thing);
      idToRef.put(thing.getName(), thing);
      ConstantMap[] constMaps;
      if (data.hasBandNames()) {
        constMaps = new ConstantMap[colorMap.length + 2];
        System.arraycopy(colorMap, 0, constMaps, 0, colorMap.length);
        constMaps[colorMap.length] = new ConstantMap(1f, Display.PointMode);
        constMaps[colorMap.length + 1] = new ConstantMap(5f, Display.PointSize);
      } else {
        constMaps = colorMap;
      }
      colorMaps.put(thing, constMaps);

      display.addReference(thing, constMaps);
    }
  }