Package org.fife.ui.rtextarea
Class ColorBackgroundPainterStrategy
- java.lang.Object
-
- org.fife.ui.rtextarea.ColorBackgroundPainterStrategy
-
- All Implemented Interfaces:
BackgroundPainterStrategy
public class ColorBackgroundPainterStrategy extends java.lang.Object implements BackgroundPainterStrategy
A strategy for painting the background of anRTextAreaBaseas a solid color. The default background forRTextAreaBases is this strategy using the color white.- Version:
- 0.1
- See Also:
ImageBackgroundPainterStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Colorcolor
-
Constructor Summary
Constructors Constructor Description ColorBackgroundPainterStrategy(java.awt.Color color)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o2)Returns whether the specified object is equivalent to this one.java.awt.ColorgetColor()Returns the color used to paint the background.inthashCode()Returns the hash code to use when placing an object of this type into hash maps.voidpaint(java.awt.Graphics g, java.awt.Rectangle bounds)Paints the background.voidsetColor(java.awt.Color color)Sets the color used to paint the background.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o2)
Returns whether the specified object is equivalent to this one.- Overrides:
equalsin classjava.lang.Object- Parameters:
o2- The object to which to compare.- Returns:
- Whether
o2is anotherColorBackgroundPainterStrategyrepresenting the same color as this one.
-
getColor
public java.awt.Color getColor()
Returns the color used to paint the background.- Returns:
- The color.
- See Also:
setColor(java.awt.Color)
-
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 overrodeequals(Object), to keep FindBugs happy.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code.
-
paint
public void paint(java.awt.Graphics g, java.awt.Rectangle bounds)Paints the background.- Specified by:
paintin interfaceBackgroundPainterStrategy- Parameters:
g- The graphics context.bounds- The bounds of the object whose background we're painting.
-
setColor
public void setColor(java.awt.Color color)
Sets the color used to paint the background.- Parameters:
color- The color to use.- See Also:
getColor()
-
-