コード例 #1
0
  /**
   * Set colors for the control defined by the given colorMapIndex (0, 1, or 2).
   *
   * @param colorPalette The 3xN color palette array
   * @param colorMapIndex Which of the color maps are we setting the color of.
   * @throws RemoteException Java RMI error
   * @throws VisADException problem creating VisAD object
   */
  private void setColorsInControls(float[][] colorPalette, int colorMapIndex)
      throws RemoteException, VisADException {
    if (colorPalette == null) {
      return;
    }

    if (colorMaps[colorMapIndex] == null) {
      return;
    }

    BaseColorControl bcc = (BaseColorControl) colorMaps[colorMapIndex].getControl();

    if (bcc != null) {
      float[][] table = new float[colorMaps.length][colorPalette[0].length];
      table[colorMapIndex] = colorPalette[colorMapIndex];
      bcc.setTable(table);
    }
  }
コード例 #2
0
 /**
  * Constructs from a name for the Displayable and the type of the RGB parameter.
  *
  * @param name The name for the displayable.
  * @param doAlpha true to map to RGBA
  * @throws VisADException VisAD failure.
  * @throws RemoteException Java RMI failure.
  */
 public ImageRGBDisplayable(String name, boolean doAlpha) throws VisADException, RemoteException {
   this(name, BaseColorControl.initTableGreyWedge(new float[(doAlpha) ? 4 : 3][255]), doAlpha);
 }