Class ColorBackgroundPainterStrategy

java.lang.Object
org.fife.ui.rtextarea.ColorBackgroundPainterStrategy
All Implemented Interfaces:
BackgroundPainterStrategy

public class ColorBackgroundPainterStrategy extends Object implements BackgroundPainterStrategy
A strategy for painting the background of an RTextAreaBase as a solid color. The default background for RTextAreaBases is this strategy using the color white.
Version:
0.1
See Also:
  • Field Details

    • color

      private Color color
  • Constructor Details

    • ColorBackgroundPainterStrategy

      public ColorBackgroundPainterStrategy(Color color)
      Constructor.
      Parameters:
      color - The color to use when painting the background.
  • Method Details

    • equals

      public boolean equals(Object o2)
      Returns whether the specified object is equivalent to this one.
      Overrides:
      equals in class Object
      Parameters:
      o2 - The object to which to compare.
      Returns:
      Whether o2 is another ColorBackgroundPainterStrategy representing the same color as this one.
    • getColor

      public Color getColor()
      Returns the color used to paint the background.
      Returns:
      The color.
      See Also:
    • hashCode

      public int hashCode()
      Returns the hash code to use when placing an object of this type into hash maps. This method is implemented since we overrode equals(Object), to keep FindBugs happy.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
    • paint

      public void paint(Graphics g, Rectangle bounds)
      Paints the background.
      Specified by:
      paint in interface BackgroundPainterStrategy
      Parameters:
      g - The graphics context.
      bounds - The bounds of the object whose background we're painting.
    • setColor

      public void setColor(Color color)
      Sets the color used to paint the background.
      Parameters:
      color - The color to use.
      See Also: