Class BoundsPaintScale

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.awt.Color[] GREEN_RED
      3-color scale from green to red.
      static java.awt.Color[] GREEN_RED_DARK
      5-color scale from green to red with dark edges.
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundsPaintScale​(double[] bounds, java.awt.Color[] boundColors)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getLowerBound()
      java.awt.Color getPaint​(double value)
      double getUpperBound()
      static java.awt.Color[] hue​(int n)
      Creates an array of n colors with varying hue.
      static java.awt.Color[] reverse​(java.awt.Color[] colors)
      Reverses the color array.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • GREEN_RED

        public static final java.awt.Color[] GREEN_RED
        3-color scale from green to red.
      • GREEN_RED_DARK

        public static final java.awt.Color[] GREEN_RED_DARK
        5-color scale from green to red with dark edges.
    • Constructor Detail

      • BoundsPaintScale

        public BoundsPaintScale​(double[] bounds,
                                java.awt.Color[] boundColors)
                         throws java.lang.IllegalArgumentException
        Constructor.
        Parameters:
        bounds - double[]; value bounds
        boundColors - Color[]; colors at bounds
        Throws:
        java.lang.IllegalArgumentException - if less than 2 bounds, unequal number of bounds and colors, or duplicate bounds
    • Method Detail

      • reverse

        public static java.awt.Color[] reverse​(java.awt.Color[] colors)
        Reverses the color array.
        Parameters:
        colors - Color[]; array of colors
        Returns:
        Color[]; reversed color array
      • hue

        public static java.awt.Color[] hue​(int n)
        Creates an array of n colors with varying hue.
        Parameters:
        n - int; number of colors.
        Returns:
        Color[]; array of n colors with varying hue
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object