com.orsoncharts.table

## Class StandardRectanglePainter

- java.lang.Object
- - com.orsoncharts.table.StandardRectanglePainter

- All Implemented Interfaces:
    RectanglePainter, java.io.Serializable

      public class StandardRectanglePainter
      extends java.lang.Object
      implements RectanglePainter, java.io.Serializable

  A `RectanglePainter` that fills the rectangle with a color or image. Instances of this class are immutable.
  Note that it is possible to use gradient paint with this painter, but it is usually better to use `GradientRectanglePainter` since it provides options to transform the gradient to fit the chart background size.
  NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardRectanglePainter(java.awt.Paint paint)` Creates a new painter that will fill a rectangle with the specified paint.
    `StandardRectanglePainter(java.awt.Paint paint, java.awt.Image image, Fit2D imageFit)` Creates a new painter that will draw an image within the specified rectangle.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Tests this painter for equality with an arbitrary object.
    `void` | `fill(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)` Fills the rectangle with the paint specified in the constructor.
    `java.awt.Image` | `getImage()` Returns the image.
    `Fit2D` | `getImageFit()` Returns the image fit specification.
    `java.awt.Paint` | `getPaint()` Returns the paint that will be used to fill rectangles.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StandardRectanglePainter

          public StandardRectanglePainter(java.awt.Paint paint)

      Creates a new painter that will fill a rectangle with the specified paint.
      Parameters:
        `paint` - the fill paint (`null` not permitted).

    - #### StandardRectanglePainter

          public StandardRectanglePainter(java.awt.Paint paint,
                                          java.awt.Image image,
                                          Fit2D imageFit)

      Creates a new painter that will draw an image within the specified rectangle.
      Parameters:
        `paint` - the background paint (`null` not permitted).
        `image` - the image (`null` permitted).
        `imageFit` - the fit (`null` permitted).

  - ### Method Detail

    - #### getPaint

          public java.awt.Paint getPaint()

      Returns the paint that will be used to fill rectangles.
      Returns:
        The paint (never `null`).

    - #### getImage

          public java.awt.Image getImage()

      Returns the image.
      Returns:
        The image (possibly `null`).

    - #### getImageFit

          public Fit2D getImageFit()

      Returns the image fit specification.
      Returns:
        The image fit specification.

    - #### fill

          public void fill(java.awt.Graphics2D g2,
                           java.awt.geom.Rectangle2D bounds)

      Fills the rectangle with the paint specified in the constructor.
      Specified by:
        `fill` in interface `RectanglePainter`
      Parameters:
        `g2` - the graphics target (`null` not permitted).
        `bounds` - the rectangle (`null` not permitted).

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this painter for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object (`null` permitted).
      Returns:
        A boolean.