Class RMGradientFill

  • All Implemented Interfaces:
    RMArchiver.Archiving, java.lang.Cloneable

    public class RMGradientFill
    extends RMFill
    This class represents a fill that draws a gradient of colors from the basic fill color to the end color.
    • Constructor Detail

      • RMGradientFill

        public RMGradientFill()
        Creates an unitialized graident fill.
      • RMGradientFill

        public 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 Detail

      • getColor2

        public RMColor getColor2()
        Returns the gradients end color.
      • getEndColor

        public RMColor getEndColor()
        Returns the gradients end color (obsolete).
      • getRoll

        public float getRoll()
        Returns the gradients rotation.
      • getGradientBounds

        public java.awt.geom.Rectangle2D getGradientBounds​(java.awt.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). The gradient should be defined in these bounds so that rendered shapes completely utilizes the color range.
      • getGradientAxis

        public void getGradientAxis​(RMShape aShape,
                                    RMPath aPath,
                                    java.awt.geom.Point2D p1,
                                    java.awt.geom.Point2D p2)
        Returns the 2 points, in the shape's coordinate system, which define the gradient.
      • equals

        public boolean equals​(java.lang.Object anObj)
        Standard equals implementation.
        Overrides:
        equals in class RMFill