Package com.reportmill.graphics
Class RMShadowFill
- java.lang.Object
-
- com.reportmill.base.RMObject
-
- com.reportmill.graphics.RMFill
-
- com.reportmill.graphics.RMImageFill
-
- com.reportmill.graphics.RMShadowFill
-
- All Implemented Interfaces:
RMArchiver.Archiving,java.lang.Cloneable
public class RMShadowFill extends RMImageFill
This class adds a shadow to a given shape.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRMShadowFill.GaussianKernelExtends Kernel with constructor which takes Kernel size and automatically generates a gaussian matrix.
-
Field Summary
-
Fields inherited from class com.reportmill.graphics.RMImageFill
ATTRIBUTE_FILL_STYLE, ATTRIBUTE_ROLL, ATTRIBUTE_SCALE_X, ATTRIBUTE_SCALE_Y, ATTRIBUTE_X, ATTRIBUTE_Y, STYLE_FIT, STYLE_FIT_IFNEEDED, STYLE_STRETCH, STYLE_TILE
-
-
Constructor Summary
Constructors Constructor Description RMShadowFill()Creates a new shadow fill.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RMFillderiveFill(int aRadius)Returns a shadow fill just like this one, but with a radius equal to the given value.RMFillderiveFill(int dx, int dy)Returns a shadow fill just like this one, but with new offsets.RMFillderiveFill(RMColor aColor)Returns a shadow fill just like this one, but with a radius equal to the given value.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.RMRectgetBounds(RMShape aShape, RMRect pathBounds)Returns the bounds required to render this fill for this shape.intgetDX()Returns the X offset of the shadow.intgetDY()Returns the Y offset of the shadow.RMRectgetImageBounds(RMRect boundsRect)Overrides normal image fill behavior to to account for shadow fringes and shadow offset.RMImageDatagetImageData()Returns the shadow image data.intgetRadius()Returns the radius of the blur.voidpaintShape(RMShape aShape, RMPath aPath, java.awt.Graphics2D g, RMShapePainter sp)Render this fill in a Java2D Graphics2D.booleanshouldClipToPath()Overrides normal image fill behavior to suppress clip to path, since shadow is an image of path.RXElementtoXML(RXArchiver anArchiver)XML archival.-
Methods inherited from class com.reportmill.graphics.RMImageFill
awt, deriveFill, deriveFill, getFillStyle, getImageBounds, getImageMargins, getImageShape, getImageSize2D, getPageNumber, getRoll, getScaleX, getScaleY, getType, getX, getY, initWithArchiver, setFillStyle, setImageData, setImageMargins, setPageNumber
-
Methods inherited from class com.reportmill.graphics.RMFill
getChild, getChildCount, getColor, setColor
-
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
-
-
-
-
Method Detail
-
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:
deriveFillin classRMImageFill
-
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.
-
getImageBounds
public RMRect getImageBounds(RMRect boundsRect)
Overrides normal image fill behavior to to account for shadow fringes and shadow offset.- Overrides:
getImageBoundsin classRMImageFill
-
shouldClipToPath
public boolean shouldClipToPath()
Overrides normal image fill behavior to suppress clip to path, since shadow is an image of path.- Overrides:
shouldClipToPathin classRMImageFill
-
paintShape
public void paintShape(RMShape aShape, RMPath aPath, java.awt.Graphics2D g, RMShapePainter sp)
Render this fill in a Java2D Graphics2D.- Overrides:
paintShapein classRMImageFill
-
getImageData
public RMImageData getImageData()
Returns the shadow image data.- Overrides:
getImageDatain classRMImageFill
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equalsin classRMImageFill
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Overrides:
toXMLin classRMImageFill
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Overrides:
fromXMLin classRMImageFill
-
-