Class RMShadowFill

All Implemented Interfaces:
RMArchiver.Archiving, Cloneable

public class RMShadowFill extends RMImageFill
This class adds a shadow to a given shape.
  • Constructor Details

    • RMShadowFill

      public RMShadowFill()
      Creates a new shadow fill.
  • Method Details

    • getRadius

      public int getRadius()
      Returns the radius of the blur.
    • getDX

      public int getDX()
      Returns the X offset of the shadow.
    • getDY

      public int getDY()
      Returns the Y offset of the shadow.
    • deriveFill

      public RMFill deriveFill(int aRadius)
      Returns a shadow fill just like this one, but with a radius equal to the given value.
    • deriveFill

      public RMFill deriveFill(RMColor aColor)
      Returns a shadow fill just like this one, but with a radius equal to the given value.
      Overrides:
      deriveFill in class RMImageFill
    • deriveFill

      public RMFill deriveFill(int dx, int dy)
      Returns a shadow fill just like this one, but with new offsets.
    • getBounds

      public RMRect getBounds(RMShape aShape, RMRect pathBounds)
      Returns the bounds required to render this fill for this shape.
      Overrides:
      getBounds in class RMFill
    • getImageBounds

      public RMRect getImageBounds(RMRect boundsRect)
      Overrides normal image fill behavior to to account for shadow fringes and shadow offset.
      Overrides:
      getImageBounds in class RMImageFill
    • shouldClipToPath

      public boolean shouldClipToPath()
      Overrides normal image fill behavior to suppress clip to path, since shadow is an image of path.
      Overrides:
      shouldClipToPath in class RMImageFill
    • paintShape

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

      public RMImageData getImageData()
      Returns the shadow image data.
      Overrides:
      getImageData in class RMImageFill
    • equals

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

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

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