Class ColorBackgroundPainterStrategy

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.Color color  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o2)
      Returns whether the specified object is equivalent to this one.
      java.awt.Color getColor()
      Returns the color used to paint the background.
      int hashCode()
      Returns the hash code to use when placing an object of this type into hash maps.
      void paint​(java.awt.Graphics g, java.awt.Rectangle bounds)
      Paints the background.
      void setColor​(java.awt.Color color)
      Sets the color used to paint the background.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • color

        private java.awt.Color color
    • Constructor Detail

      • ColorBackgroundPainterStrategy

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

      • equals

        public boolean equals​(java.lang.Object o2)
        Returns whether the specified object is equivalent to this one.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o2 - The object to which to compare.
        Returns:
        Whether o2 is another ColorBackgroundPainterStrategy representing 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 overrode equals(Object), to keep FindBugs happy.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code.
      • paint

        public void paint​(java.awt.Graphics g,
                          java.awt.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​(java.awt.Color color)
        Sets the color used to paint the background.
        Parameters:
        color - The color to use.
        See Also:
        getColor()