Class RGBDisplayable

Direct Known Subclasses:
FlowDisplayable, Grid2DDisplayable, IsoSurface, TrackDisplayable, VolumeDisplayable

public abstract class RGBDisplayable extends DisplayableData
Provides support for a Displayable that needs a map to either Display.RGB or to Display.RGBA.

Instances of this class have the following bound properties:

Name Type Access Default Description
colorPalette float[][] set/get 0 The color palette for this instance.
rgbRealType visad.RealType set/get null The VisAD type of the colored quantity.
lineWidth float set/get 1.0f The width of rendered lines.
Version:
$Revision: 1.58 $
Author:
Don Murray
  • Field Details

    • COLOR_PALETTE

      public static final String COLOR_PALETTE
      The name of the "color palette" property.
      See Also:
    • RGB_REAL_TYPE

      public static final String RGB_REAL_TYPE
      The name of the "RGB real-type" property.
      See Also:
    • POLYGON_FILL

      public static final int POLYGON_FILL
      The polygon fill style
      See Also:
    • POLYGON_LINE

      public static final int POLYGON_LINE
      The polygon line style
      See Also:
    • POLYGON_POINT

      public static final int POLYGON_POINT
      The polygon point style
      See Also:
  • Constructor Details

    • RGBDisplayable

      public RGBDisplayable(String name, RealType rgbRealType, boolean alphaflag) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the RGB parameter.
      Parameters:
      name - The name for the displayable.
      rgbRealType - The type of the RGB parameter. May be null.
      alphaflag - boolean - will use Display.RBGA if true otherwise only Display.RGB
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • RGBDisplayable

      public RGBDisplayable(String name, RealType rgbRealType, float[][] colorPalette, boolean alphaflag) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the RGB parameter.
      Parameters:
      name - The name for the displayable.
      rgbRealType - The type of the RGB parameter. May be null.
      colorPalette - The initial colorPalette to use. May be null (Vis5D palette used as default).
      alphaflag - boolean - use Display.RBGA if true
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • RGBDisplayable

      protected RGBDisplayable(RGBDisplayable that) throws VisADException, RemoteException
      Constructs from another instance. The following attributes are set from the other instance: color palette, the color RealType.
      Parameters:
      that - The other instance.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
  • Method Details

    • useDisplayUnitForColor

      protected boolean useDisplayUnitForColor()
      Does this object use the displayUnit (or the colorUnit) for its display unit. The default is true. This allows derived classes to have this class use the colorUnit.
      Returns:
      true if the display unit is the same as the color unit
    • setRGBRealType

      public void setRGBRealType(RealType realType) throws RemoteException, VisADException
      Sets the RealType of the RGB parameter.
      Parameters:
      realType - The RealType of the RGB parameter. May not be null.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • getRGBRealType

      public RealType getRGBRealType()
      Returns the RealType of the RGB parameter.
      Returns:
      The RealType of the color parameter. May be null.
    • getSelectRealType

      public RealType getSelectRealType()
      Returns the RealType of the SelectRange parameter.
      Returns:
      The RealType of the select range parameter. May be null.
    • setScalarMaps

      protected void setScalarMaps(ScalarMapSet maps) throws BadMappingException
      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 null 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 super.setScalarMaps(ScalarMapSet).
      Parameters:
      maps - The set of ScalarMap-s to be added.
      Throws:
      BadMappingException - The RealType of the color parameter has not been set or its ScalarMap is alread in the set.
    • setColorPalette

      public void setColorPalette(float[][] colorPalette) throws RemoteException, VisADException
      This method sets the color palette according to the color table in argument; pair this method with setRange(lo,high) to get a fixed association of color table and range of values.
      Overrides:
      setColorPalette in class Displayable
      Parameters:
      colorPalette - the color table or color-alpha table desired
      Throws:
      VisADException - if a core VisAD failure occurs.
      RemoteException - if a Java RMI failure occurs.
    • getColorPalette

      public float[][] getColorPalette()
      Return the current color palette in this Displayable
      Returns:
      a color table float[3][len] or color-alpha table float[4][len]
    • setColor

      public void setColor(Color color) throws RemoteException, VisADException
      Make a color palette representing this color and set it as the color pallete.
      Overrides:
      setColor in class Displayable
      Parameters:
      color - color to use
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setGreyPalette

      public final void setGreyPalette() throws RemoteException, VisADException
      This method sets the color palette to shades of grey.
      Throws:
      VisADException - if a core VisAD failure occurs.
      RemoteException - if a Java RMI failure occurs.
    • setVisADPalette

      public final void setVisADPalette() throws RemoteException, VisADException
      This method with no argument sets the default Vis5D color spectrum.
      Throws:
      VisADException - if a core VisAD failure occurs.
      RemoteException - if a Java RMI failure occurs.
    • setRange

      public void setRange(double low, double hi) throws VisADException, RemoteException
      Set the upper and lower limit of the range values associated with a color table.
      Parameters:
      low - the minimun value
      hi - the maximum value deprecated use setRangeForColor
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • setRangeForColor

      public void setRangeForColor(double low, double hi) throws VisADException, RemoteException
      Set the upper and lower limit of the range values associated with a color table. Matches method name in Contour2DDisplayable
      Overrides:
      setRangeForColor in class Displayable
      Parameters:
      low - The minimum value of the parameter matched to the low end of the color table.
      hi - The maximum value of the parameter matched to the high end of the color table.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • getRangeforColor

      public double[] getRangeforColor()
      Get the color range
      Returns:
      an array of the low and high values for the range deprecated use #getRangeForColor()
    • getRangeForColor

      public double[] getRangeForColor()
      Get the color range
      Returns:
      an array of the low and high values for the range
    • setDisplayUnit

      public void setDisplayUnit(Unit unit) throws VisADException, RemoteException
      Set the units for the displayed range
      Overrides:
      setDisplayUnit in class Displayable
      Parameters:
      unit - Unit for display
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • setColorUnit

      public void setColorUnit(Unit unit) throws VisADException, RemoteException
      Set the units for the displayed range
      Overrides:
      setColorUnit in class Displayable
      Parameters:
      unit - Unit for display
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • hasRange

      public boolean hasRange()
      Returns whether this Displayable has a valid range (i.e., lowRange and highRange are both not NaN's
      Returns:
      true if range has been set
    • setPolygonMode

      public void setPolygonMode(int polygonMode) throws VisADException, RemoteException
      Set the type of polygon display that should be used
      Parameters:
      polygonMode - polygon mode
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • getPolygonMode

      public int getPolygonMode()
      Return the type of polygon mode being used
      Returns:
      polygon mode
    • setCurvedSize

      public void setCurvedSize(int curvedSize) throws VisADException, RemoteException
      Set the curved size for textured displays
      Parameters:
      curvedSize - size to use (> 0)
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • makeCurvedSizeMap

      protected ConstantMap makeCurvedSizeMap(int curvedSize) throws VisADException, RemoteException
      Create the ConstantMap for the texture curve size
      Parameters:
      curvedSize - size for texture curve
      Returns:
      ConstantMap
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • getCurvedSize

      public int getCurvedSize()
      Return the size of a curved texture
      Returns:
      curved size
    • setSelectRealType

      protected void setSelectRealType(RealType realType) throws RemoteException, VisADException
      Sets the RealType of the select parameter.
      Parameters:
      realType - The RealType of the RGB parameter. May not be null.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • hasSelectedRange

      public boolean hasSelectedRange()
      Returns whether this Displayable has a valid range (i.e., lowSelectedRange and highSelectedRange are both not NaN's
      Returns:
      true if range has been set
    • setSelectedRange

      public void setSelectedRange(double low, double hi) throws VisADException, RemoteException
      Set selected range with the range for select
      Overrides:
      setSelectedRange in class Displayable
      Parameters:
      low - low select value
      hi - hi select value
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • setRangeForSelect

      public void setRangeForSelect(double low, double hi) throws VisADException, RemoteException
      Set the upper and lower limit of the range values associated with a color table.
      Parameters:
      low - the minimun value
      hi - the maximum value
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • setUseRGBTypeForSelect

      public void setUseRGBTypeForSelect(boolean yesno)
      Set whether the RGB type is used for the select range.
      Parameters:
      yesno - true to use the RGB type for the
    • getUseRGBTypeForSelect

      public boolean getUseRGBTypeForSelect()
      Get whether the RGB type is used for the select range.
      Returns:
      true if the RGB type for the
    • setAutoScaleColorRange

      public void setAutoScaleColorRange(boolean yesno)
      Set whether the color scale should auto scale
      Parameters:
      yesno - true to autoscale
    • getAutoScaleColorRange

      public boolean getAutoScaleColorRange()
      Set whether the RGB type is used for the select range.
      Returns:
      true if autoscaling is on