Class ColorPalette

java.lang.Object
org.jfree.chart.ui.ColorPalette
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
GreyPalette, RainbowPalette

public abstract class ColorPalette
extends Object
implements Cloneable, Serializable
Defines palette used in Contour Plots.
Author:
David M. O'Donnell.
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    ColorPalette()
    Default contructor.
  • Method Summary

    Modifier and Type Method Description
    Object clone()
    Returns a clone of the palette.
    boolean equals​(Object o)
    Tests an object for equality with this instance.
    Paint getColor​(double value)
    Returns the color associated with a value.
    Color getColor​(int izV)
    Returns a color.
    Color getColorLinear​(double value)
    Returns Color by mapping a given value to a linear palette.
    Color getColorLog​(double value)
    Returns Color by mapping a given value to a common log palette.
    double getMaxZ()
    Returns the maximum Z value.
    double getMinZ()
    Returns the minimum Z value.
    Paint getPaint​(double value)
    Returns Paint by mapping a given value to a either a linear or common log palette as controlled by the value logscale.
    String getPaletteName()
    Returns the palette name.
    double[] getTickValues()
    Returns the tick values.
    int hashCode()
    Returns a hash code.
    abstract void initialize()
    Called to initialize the palette's color indexes
    void invertPalette()
    Inverts Palette
    boolean isInverse()
    Returns the inverse flag.
    boolean isLogscale()
    Returns the log-scale flag.
    boolean isStepped()
    Returns the 'is-stepped' flag.
    void setInverse​(boolean inverse)
    Sets the inverse flag.
    void setLogscale​(boolean logscale)
    Sets the 'log-scale' flag.
    void setMaxZ​(double newMaxZ)
    Sets the maximum Z value.
    void setMinZ​(double newMinZ)
    Sets the minimum Z value.
    void setPaletteName​(String paletteName)
    Sets the palette name.
    void setStepped​(boolean stepped)
    Sets the stepped flag.
    void setTickValues​(double[] newTickValues)
    Sets the tick values.
    void setTickValues​(List ticks)
    Store ticks.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ColorPalette

      public ColorPalette()
      Default contructor.
  • Method Details

    • getColor

      public Paint getColor​(double value)
      Returns the color associated with a value.
      Parameters:
      value - the value.
      Returns:
      the color.
    • getColor

      public Color getColor​(int izV)
      Returns a color.
      Parameters:
      izV - ??.
      Returns:
      the color.
    • getColorLinear

      public Color getColorLinear​(double value)
      Returns Color by mapping a given value to a linear palette.
      Parameters:
      value - the value.
      Returns:
      The color.
    • getColorLog

      public Color getColorLog​(double value)
      Returns Color by mapping a given value to a common log palette.
      Parameters:
      value - the value.
      Returns:
      The color.
    • getMaxZ

      public double getMaxZ()
      Returns the maximum Z value.
      Returns:
      the value.
    • getMinZ

      public double getMinZ()
      Returns the minimum Z value.
      Returns:
      the value.
    • getPaint

      public Paint getPaint​(double value)
      Returns Paint by mapping a given value to a either a linear or common log palette as controlled by the value logscale.
      Parameters:
      value - the value.
      Returns:
      The paint.
    • getPaletteName

      public String getPaletteName()
      Returns the palette name.
      Returns:
      the palette name.
    • getTickValues

      public double[] getTickValues()
      Returns the tick values.
      Returns:
      the tick values.
    • initialize

      public abstract void initialize()
      Called to initialize the palette's color indexes
    • invertPalette

      public void invertPalette()
      Inverts Palette
    • isInverse

      public boolean isInverse()
      Returns the inverse flag.
      Returns:
      the flag.
    • isLogscale

      public boolean isLogscale()
      Returns the log-scale flag.
      Returns:
      the flag.
    • isStepped

      public boolean isStepped()
      Returns the 'is-stepped' flag.
      Returns:
      the flag.
    • setInverse

      public void setInverse​(boolean inverse)
      Sets the inverse flag.
      Parameters:
      inverse - the new value.
    • setLogscale

      public void setLogscale​(boolean logscale)
      Sets the 'log-scale' flag.
      Parameters:
      logscale - the new value.
    • setMaxZ

      public void setMaxZ​(double newMaxZ)
      Sets the maximum Z value.
      Parameters:
      newMaxZ - the new value.
    • setMinZ

      public void setMinZ​(double newMinZ)
      Sets the minimum Z value.
      Parameters:
      newMinZ - the new value.
    • setPaletteName

      public void setPaletteName​(String paletteName)
      Sets the palette name.
      Parameters:
      paletteName - the name.
    • setStepped

      public void setStepped​(boolean stepped)
      Sets the stepped flag.
      Parameters:
      stepped - the flag.
    • setTickValues

      public void setTickValues​(double[] newTickValues)
      Sets the tick values.
      Parameters:
      newTickValues - the tick values.
    • setTickValues

      public void setTickValues​(List ticks)
      Store ticks. Required when doing stepped axis
      Parameters:
      ticks - the ticks.
    • equals

      public boolean equals​(Object o)
      Tests an object for equality with this instance.
      Overrides:
      equals in class Object
      Parameters:
      o - the object to test.
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Returns a hash code.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of the palette.
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - never.