Class Gradient

All Implemented Interfaces:
Draggable, Shape, Serializable, Cloneable

public class Gradient extends DraggableRectangle
See Also:
  • Constructor Details

    • Gradient

      public Gradient(PlotCanvas canvas)
      Create a gradient rectangle rectangle using the standard blue to red gradient with 0 to 1 value range relative range
      Parameters:
      canvas - the parent plot canvas
  • Method Details

    • draw

      public void draw(Graphics g)
      Draw the gradient
      Parameters:
      g - the Graphics context
    • getGradientHeight

      protected int getGradientHeight()
      Get the height of the gradient
      Returns:
      the height of the gradient
    • getGradientWidth

      protected int getGradientWidth()
    • getColor

      public Color getColor(double value)
      Get the color for the give value. Interpolation is used.
      Parameters:
      value - the vale
      Returns:
      the color