Module org.jfree.chart3d
Package org.jfree.chart3d.table

# Class StandardRectanglePainter

java.lang.Object
org.jfree.chart3d.table.StandardRectanglePainter

All Implemented Interfaces:
  `Serializable`, `RectanglePainter`

public class StandardRectanglePainter extends Object implements RectanglePainter, 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
Description
`StandardRectanglePainter(Paint paint)`
Creates a new painter that will fill a rectangle with the specified paint.
`StandardRectanglePainter(Paint paint, Image image, Fit2D imageFit)`
Creates a new painter that will draw an image within the specified rectangle.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this painter for equality with an arbitrary object.
`void`
`fill(Graphics2D g2, Rectangle2D bounds)`
Fills the rectangle with the paint specified in the constructor.
`Image`
`getImage()`
Returns the image.
`Fit2D`
`getImageFit()`
Returns the image fit specification.
`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 Details

### StandardRectanglePainter

public StandardRectanglePainter(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(Paint paint, 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 Details

### getPaint

public Paint getPaint()
Returns the paint that will be used to fill rectangles.

Returns:
  The paint (never `null`).

### getImage

public 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(Graphics2D g2, 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(Object obj)
Tests this painter for equality with an arbitrary object.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object (`null` permitted).
Returns:
  A boolean.