Package com.reportmill.graphics
Class RMGradientFill
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMFill
com.reportmill.graphics.RMGradientFill
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
This class represents a fill that draws a gradient of colors from the basic fill color to the end color.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an unitialized graident fill.RMGradientFill
(RMColor aColor1, RMColor aColor2, float aRotation) Creates a gradient fill from the given start color to the given end color with the given roll. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.Returns the gradients end color.Returns the gradients end color (obsolete).void
getGradientAxis
(RMShape aShape, RMPath aPath, Point2D p1, Point2D p2) Returns the 2 points, in the shape's coordinate system, which define the gradient.getGradientBounds
(Shape aShape) Returns the gradient bounds for a given shape which is the bounds required to encompass the entire shape in the coordinates of the gradient rotation (effectively the bounds of the shape rotated by opposite gradient rotation).float
getRoll()
Returns the gradients rotation.initWithArchiver
(RMArchiver anArchiver) Legacy unarchival.void
paintShape
(RMShape aShape, RMPath aPath, Graphics2D g, RMShapePainter sp) Render this fill in a Java2D Graphics2D.toXML
(RXArchiver anArchiver) XML archival.Methods inherited from class com.reportmill.graphics.RMFill
deriveFill, getBounds, getChild, getChildCount, getColor, setColor
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
-
Constructor Details
-
RMGradientFill
public RMGradientFill()Creates an unitialized graident fill. -
RMGradientFill
Creates a gradient fill from the given start color to the given end color with the given roll.
-
-
Method Details
-
getColor2
Returns the gradients end color. -
getEndColor
Returns the gradients end color (obsolete). -
getRoll
public float getRoll()Returns the gradients rotation. -
getGradientBounds
Returns the gradient bounds for a given shape which is the bounds required to encompass the entire shape in the coordinates of the gradient rotation (effectively the bounds of the shape rotated by opposite gradient rotation). The gradient should be defined in these bounds so that rendered shapes completely utilizes the color range. -
getGradientAxis
Returns the 2 points, in the shape's coordinate system, which define the gradient. -
paintShape
Render this fill in a Java2D Graphics2D.- Overrides:
paintShape
in classRMFill
-
equals
Standard equals implementation. -
toXML
XML archival. -
fromXML
XML unarchival. -
initWithArchiver
Legacy unarchival.- Specified by:
initWithArchiver
in interfaceRMArchiver.Archiving
- Overrides:
initWithArchiver
in classRMFill
-