java.lang.Object
org.jfree.chart3d.table.GradientRectanglePainter
- All Implemented Interfaces:
Serializable
,RectanglePainter
public final class GradientRectanglePainter
extends Object
implements RectanglePainter, Serializable
A
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.
RectanglePainter
that can fill a rectangle with a gradient (the
gradient is generated using anchor points to fit any size rectangle on
demand). Instances of this class are immutable.
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 Summary
ConstructorsConstructorDescriptionGradientRectanglePainter
(Color color1, Anchor2D anchor1, Color color2, Anchor2D anchor2) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this instance for equality with an arbitrary object.void
fill
(Graphics2D g2, Rectangle2D area) Fills the specifiedarea
with a gradient paint created using the colors and anchor points of this painter.Returns the anchor point used to find the starting point for the gradient (as specified via the constructor).Returns the anchor point used to find the ending point for the gradient (as specified via the constructor).Returns the first color for the gradient (as specified via the constructor).Returns the second color for the gradient (as specified via the constructor).int
hashCode()
-
Constructor Details
-
GradientRectanglePainter
Creates a new instance.
NOTE: some useful standard anchor points are defined in theTitleAnchor
class.- Parameters:
color1
- the first color for the gradient (null
not permitted).anchor1
- the anchor point used to determine the starting point for the gradient (null
not permitted).color2
- the second color for the gradient (null
not permitted).anchor2
- the anchor point used to determine the ending point for the gradient (null
not permitted).
-
-
Method Details
-
getColor1
Returns the first color for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.- Returns:
- The first color for the gradient (never
null
).
-
getAnchor1
Returns the anchor point used to find the starting point for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.- Returns:
- The anchor point (never
null
).
-
getColor2
Returns the second color for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.- Returns:
- The second color for the gradient (never
null
).
-
getAnchor2
Returns the anchor point used to find the ending point for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.- Returns:
- The anchor point (never
null
).
-
fill
Fills the specifiedarea
with a gradient paint created using the colors and anchor points of this painter.- Specified by:
fill
in interfaceRectanglePainter
- Parameters:
g2
- the graphics target (null
not permitted).area
- the area to fill (null
not permitted).
-
equals
Tests this instance for equality with an arbitrary object. -
hashCode
-