Interface ColorSource<K extends Comparable<K>>

All Known Implementing Classes:
StandardColorSource

public interface ColorSource<K extends Comparable<K>>
A color source for use by the PiePlot3D class. This is the interface through which the plot will obtain colors for each data item (segment) in the chart. A default implementation (StandardColorSource) is provided.
  • Method Summary

    Modifier and Type
    Method
    Description
    getColor(K key)
    Returns the color for one data item in the chart.
    void
    setColor(K key, Color color)
    Sets the color associated with the specified key.
    void
    style(Color... colors)
    Restyles the source using the specified colors.
  • Method Details

    • getColor

      Returns the color for one data item in the chart. We return a Color rather than a paint, because some manipulations that require a Color instance are done for the shading during the 3D rendering.
      Parameters:
      key - the key (null not permitted).
      Returns:
      The color.
    • setColor

      void setColor(K key, Color color)
      Sets the color associated with the specified key. If the supplied color is null, this will have the effect of clearing any previous setting and reverting to the default color.
      Parameters:
      key - the key (null not permitted).
      color - the color (null permitted).
    • style

      void style(Color... colors)
      Restyles the source using the specified colors. Refer to the implementing class to confirm the precise behaviour (typically all existing color settings are cleared and the specified colors are installed as the new defaults).
      Parameters:
      colors - the colors.
      Since:
      1.2