Class ColorScaleBar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class ColorScaleBar extends JComponent
See Also:
  • Constructor Details

    • ColorScaleBar

      public ColorScaleBar(ScientificColorMap map)
    • ColorScaleBar

      public ColorScaleBar(Color[] scale)
      Backward-compatible constructor if needed elsewhere.
  • Method Details

    • setColorMap

      public void setColorMap(ScientificColorMap map)
    • setScale

      public void setScale(Color[] scale)
      Backward-compatible setter if needed.
    • setLabels

      public void setLabels(String min, String max)
    • setTickLabels

      public void setTickLabels(String... tickLabels)
      Set labels at evenly spaced positions along the color bar.
    • setBarHeight

      public void setBarHeight(int height)
      Set the painted gradient height. The component's preferred and minimum heights are updated so layout managers cannot collapse the gradient.
      Parameters:
      height - gradient height in pixels; values below 2 are clamped
    • getBarHeight

      public int getBarHeight()
      Returns:
      the requested gradient height in pixels
    • setBorder

      public void setBorder(Border border)
      Overrides:
      setBorder in class JComponent
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent