Class StandardRectanglePainter

java.lang.Object
org.jfree.chart3d.table.StandardRectanglePainter
All Implemented Interfaces:
Serializable, RectanglePainter

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:
  • Constructor Details

    • StandardRectanglePainter

      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.