Class Contour2DDisplayable

All Implemented Interfaces:
GridDisplayable

public class Contour2DDisplayable extends ContourLines implements GridDisplayable
A class to support showing 2D gridded data as colored contours on a plane in a NavigatedDisplay.
Version:
$Revision: 1.40 $
Author:
IDV Development Team
  • Field Details

  • Constructor Details

    • Contour2DDisplayable

      public Contour2DDisplayable(String name) throws VisADException, RemoteException
      Constructs an instance with the supplied name and null initial RealType.
      Parameters:
      name - a String identifier
      Throws:
      VisADException - from construction of super class
      RemoteException - from construction of super class
    • Contour2DDisplayable

      public Contour2DDisplayable(String name, boolean alphaFlag) throws VisADException, RemoteException
      Constructs an instance with the supplied name and null initial RealType and given alphaFlag
      Parameters:
      name - a String identifier
      alphaFlag - true if should use RGBA
      Throws:
      VisADException - from construction of super class
      RemoteException - from construction of super class
    • Contour2DDisplayable

      public Contour2DDisplayable(String name, boolean alphaFlag, boolean colorFill) throws VisADException, RemoteException
      Constructs an instance with the supplied name and null initial RealType and given alphaFlag and colorFill
      Parameters:
      name - a String identifier
      alphaFlag - true if should use RGBA
      colorFill - true if contours should be color filled
      Throws:
      VisADException - from construction of super class
      RemoteException - from construction of super class
    • Contour2DDisplayable

      public Contour2DDisplayable(String name, RealType c2dRealType, float[][] colorPalette, float[] rangeLimits) throws VisADException, RemoteException
      Constructs from a name for the Displayable and the type of the parameter.
      Parameters:
      name - The name for the displayable.
      c2dRealType - The type of the parameter. May be null.
      colorPalette - The initial colorPalette to use. May be null (Vis5D palette used as default).
      rangeLimits - limits of the color range
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure. deprecated rangeLimits not needed
    • Contour2DDisplayable

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

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

      protected Contour2DDisplayable(Contour2DDisplayable that) throws VisADException, RemoteException
      Constructs from a Contour2DDisplayable.
      Parameters:
      that - a Contour2DDisplayable.
      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.
      Returns:
      false if contour lines are colored by another field otherwise true
    • setC2DRealType

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

      public void setColorPalette() throws RemoteException, VisADException
      This method with no argument sets the default Vis5D color spectrum.
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • setColor

      public void setColor(Color color) throws RemoteException, VisADException
      Override setColor to actually set a color palette since this class has both
      Overrides:
      setColor in class LineDrawing
      Parameters:
      color - Color to use
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • 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 setRangeForColor below to get a fixed association of color table and range of values.
      Overrides:
      setColorPalette in class Displayable
      Parameters:
      colorPalette - The initial colorPalette to use. May be null (Vis5D palette used as default).
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setRangeForColor

      public void setRangeForColor(double low, double high) throws VisADException, RemoteException
      To make a connection between a particular color and a particular data value or a range of data values ... "This mapping is determined by the low and high values passed to ScalarMap.setRange(), and by the 'float[][] table' array passed to BaseColorControl.setTable(). The table values (length = table[0].length) are distributed evenly over the (low, high) range. If an application does not call setRange(), then the range is determined by the range of values in displayed data objects." (BH)
      Overrides:
      setRangeForColor in class Displayable
      Parameters:
      low - The minimum value of the parameter matched to the low end of the color table.
      high - 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
    • getColorPalette

      public float[][] getColorPalette()
      Return the current color palette (color table).
      Returns:
      float[][] a VisAD color table
    • setGrid2D

      public void setGrid2D(FieldImpl field) throws RemoteException, VisADException
      Set the data into the Displayable
      Parameters:
      field - a VisAD FieldImpl with a 2D nature.
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object deprecated Should use loadData now
    • loadData

      public void loadData(FieldImpl field) throws VisADException, RemoteException
      Set the appropriate ScalarMaps based on the data and then load the data into the DataReference.
      Specified by:
      loadData in interface GridDisplayable
      Parameters:
      field - a 2D VisAD Field representing the data
      Throws:
      RemoteException - Java RMI error
      VisADException - problem creating VisAD object
    • setRGBRealType

      protected 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.
    • setColorFill

      public void setColorFill(boolean yesorno) throws VisADException, RemoteException
      Set whether the contours should be displayed as color-filled contours. Need to override because if color filled is turned on, we need to make sure that the RGB type is the same as the Contour type.
      Overrides:
      setColorFill in class ContourLines
      Parameters:
      yesorno - true for color fill
      Throws:
      VisADException - unable to set this
      RemoteException - unable to set this on remote display
    • getRGBRealType

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

      public void setContourLevels(float interval, float base, float min, float max) throws VisADException, RemoteException
      Set appropriate contour levels with super class's methods (BOTH REQUIRED IN THIS ORDER) setRange(min, max); invalid input: '&' setContourLevels (interval, base, min, max);
      Parameters:
      interval - delta value between contours
      base - one contour must be of this value
      min - no contour below this value
      max - no contour above this value
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setContourLevels

      public void setContourLevels(float interval, float base, float min, float max, boolean dash) throws VisADException, RemoteException
      Set appropriate contour levels with super class's methods (BOTH REQUIRED IN THIS ORDER) setRange(min, max); setContourLevels (interval, base, min, max);
      Parameters:
      interval - delta value between contours
      base - one contour must be of this value
      min - no contour below this value
      max - no contour above this value
      dash - dash contours below base
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • 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 the range for color has been set (i.e. not NaN)
    • setDisplayUnit

      public void setDisplayUnit(Unit unit) throws VisADException, RemoteException
      Set the units for the displayed range
      Overrides:
      setDisplayUnit in class ContourLines
      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
    • cloneForDisplay

      public Displayable cloneForDisplay() throws RemoteException, VisADException
      Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.
      Overrides:
      cloneForDisplay in class DisplayableData
      Returns:
      A semi-deep clone of this instance.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • setColoredByAnother

      public void setColoredByAnother(boolean yesno)
      Set whether this GridDisplayable should have the data colored by another parameter.
      Specified by:
      setColoredByAnother in interface GridDisplayable
      Parameters:
      yesno - true if colored by another