Class RMGradientFill

All Implemented Interfaces:
RMArchiver.Archiving, 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 Details

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

    • 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 Rectangle2D 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). 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, Point2D p1, Point2D p2)
      Returns the 2 points, in the shape's coordinate system, which define the gradient.
    • paintShape

      public void paintShape(RMShape aShape, RMPath aPath, Graphics2D g, RMShapePainter sp)
      Render this fill in a Java2D Graphics2D.
      Overrides:
      paintShape in class RMFill
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class RMFill
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXML in class RMFill
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Overrides:
      fromXML in class RMFill
    • initWithArchiver

      public Object initWithArchiver(RMArchiver anArchiver)
      Legacy unarchival.
      Specified by:
      initWithArchiver in interface RMArchiver.Archiving
      Overrides:
      initWithArchiver in class RMFill