Package rma.util

Class BandedColorContour

java.lang.Object
rma.util.ColorContour
rma.util.BandedColorContour
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable, Cloneable

public class BandedColorContour extends ColorContour
This Color Contour gives "bands" instead of a gradient. For example: Set Blue at 0.0f, Red at 25.0f, and Green at 50.0f, and then: * A value less than zero will return the default color * A Value greater than or equal to zero but also less than 25 will return Blue * A value greater than or equal to zero but also less than 50 will return Red * A value greater than or equal to 50 will return Green
See Also:
  • Constructor Details

    • BandedColorContour

      public BandedColorContour()
  • Method Details

    • buildSwtBandedColor

      public static BandedColorContour buildSwtBandedColor()
    • getIndexes

      public NavigableSet<Double> getIndexes()
      fetches the set of double used as indexes for colors
      Returns:
      the set of doubles that are the current color index values
    • setColorAtIndex

      public Color setColorAtIndex(double index, Color color)
      Sets the color which starts at a value
      Parameters:
      index - The value at which the color should start
      color - The color which is being set
      Returns:
      The previous color (if any) that was at the value
    • getColorAtIndex

      public Color getColorAtIndex(double index)
      Get the color for a value. If Red is set at 0, all values above zero will return Red, and any below will return the default value.
      Parameters:
      index - The index that the color should start at
      Returns:
      The color to be set
    • removeColorAtIndex

      public Map.Entry<Double,Color> removeColorAtIndex(double colorIndex)
      Remove a color for a given index
      Parameters:
      colorIndex - The index
      Returns:
      An Entry containing the removed color and the minimum value for the color
    • clearColors

      public void clearColors()
      Remove all colors, leaving just the default color
    • setDefaultColor

      public void setDefaultColor(Color color)
      This is the default value for when there is no value below the requested one. If this is set to Blue, no other colors are set, then all requests will return Blue. If this is set to Green and Red is set at 0, all requests below zero will return Green and all requests greater than or equal to zero will return Red.
      Parameters:
      color - The new default color
    • getRGB0

      protected double[] getRGB0(double val, double minValue, double maxValue)
      Specified by:
      getRGB0 in class ColorContour
    • getRGB0

      protected void getRGB0(double[] rgb, double val, double minValue, double maxValue)
      Specified by:
      getRGB0 in class ColorContour