Package com.reportmill.graphics
Class RMImageFill
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMFill
com.reportmill.graphics.RMImageFill
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
- Direct Known Subclasses:
RMShadowFill
This class is used to fill a shape's path with an image.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a plain image fill.RMImageFill
(Object aSource) Creates an image fill for the given source.RMImageFill
(Object aSource, byte aFillStyle, float aMargin) Creates an image fill from an image source. -
Method Summary
Modifier and TypeMethodDescriptionawt()
Returns the AWT image for this image fill.deriveFill
(RMColor aColor) Creates a new fill from this image fill, but with a new color.deriveFill
(RMImageData anImageData) Creates a new image fill from this fill, but with a new image.deriveFill
(String aName, Number aValue) Creates a new image fill identical to this image fill, but with new value for given attribute.boolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.byte
Returns the fill style (Stretch, Tile, Fit or FitIfNeeded).getImageBounds
(RMRect aRect) Returns the image bounds for a given rect.getImageBounds
(RMShape aShape) Returns the image bounds for a given shape.Returns the image data associated with this image fill.float
Returns the inset for the image when drawn in a given bounds.Returns an RMShape representation of the image fill's image (for rare vector based images like PDF).Returns the image size of the image for this image fill.int
Returns the page number of the image fill's image that is displayed (for rare multi-page images like PDF).float
getRoll()
Returns the rotation of the image fill image.float
Returns the scale x of the image fill image.float
Returns the scale y of the image fill image.getType()
Returns the type of the image for this image fill (gif, jpg, png, etc.).float
getX()
Returns the X location (or offset) of the image fill image.float
getY()
Returns the Y location (or offset) of the image fill image.initWithArchiver
(RMArchiver anArchiver) Legacy unarchival.void
paintShape
(RMShape aShape, RMPath aPath, Graphics2D g, RMShapePainter sp) Render this fill in a Java2D Graphics2D.void
setFillStyle
(byte aValue) Returns the fill style (Stretch, Tile, Fit or FitIfNeeded).void
setImageData
(RMImageData anImageData) Sets the image data associated with this image fill.void
setImageMargins
(float aValue) Sets the inset for the image when drawn in a given bounds.void
setPageNumber
(int aNum) Sets the page number of the image fill's image that is displayed (for rare multi-page images like PDF).boolean
Returns whether fill should clip to path when painting.toXML
(RXArchiver anArchiver) XML archival.Methods inherited from class com.reportmill.graphics.RMFill
getBounds, getChild, getChildCount, getColor, setColor
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
-
Field Details
-
STYLE_STRETCH
public static final byte STYLE_STRETCH- See Also:
-
STYLE_TILE
public static final byte STYLE_TILE- See Also:
-
STYLE_FIT
public static final byte STYLE_FIT- See Also:
-
STYLE_FIT_IFNEEDED
public static final byte STYLE_FIT_IFNEEDED- See Also:
-
ATTRIBUTE_FILL_STYLE
- See Also:
-
ATTRIBUTE_X
- See Also:
-
ATTRIBUTE_Y
- See Also:
-
ATTRIBUTE_ROLL
- See Also:
-
ATTRIBUTE_SCALE_X
- See Also:
-
ATTRIBUTE_SCALE_Y
- See Also:
-
-
Constructor Details
-
RMImageFill
public RMImageFill()Creates a plain image fill. -
RMImageFill
Creates an image fill for the given source. -
RMImageFill
Creates an image fill from an image source.
-
-
Method Details
-
getImageData
Returns the image data associated with this image fill. -
setImageData
Sets the image data associated with this image fill. -
getFillStyle
public byte getFillStyle()Returns the fill style (Stretch, Tile, Fit or FitIfNeeded). -
setFillStyle
public void setFillStyle(byte aValue) Returns the fill style (Stretch, Tile, Fit or FitIfNeeded). -
getX
public float getX()Returns the X location (or offset) of the image fill image. -
getY
public float getY()Returns the Y location (or offset) of the image fill image. -
getRoll
public float getRoll()Returns the rotation of the image fill image. -
getScaleX
public float getScaleX()Returns the scale x of the image fill image. -
getScaleY
public float getScaleY()Returns the scale y of the image fill image. -
getImageMargins
public float getImageMargins()Returns the inset for the image when drawn in a given bounds. -
setImageMargins
public void setImageMargins(float aValue) Sets the inset for the image when drawn in a given bounds. -
deriveFill
Creates a new fill from this image fill, but with a new color.- Overrides:
deriveFill
in classRMFill
-
deriveFill
Creates a new image fill from this fill, but with a new image. -
deriveFill
Creates a new image fill identical to this image fill, but with new value for given attribute. -
getType
Returns the type of the image for this image fill (gif, jpg, png, etc.). -
getImageSize2D
Returns the image size of the image for this image fill. -
getImageBounds
Returns the image bounds for a given rect. -
getImageBounds
Returns the image bounds for a given shape. -
getPageNumber
public int getPageNumber()Returns the page number of the image fill's image that is displayed (for rare multi-page images like PDF). -
setPageNumber
public void setPageNumber(int aNum) Sets the page number of the image fill's image that is displayed (for rare multi-page images like PDF). -
shouldClipToPath
public boolean shouldClipToPath()Returns whether fill should clip to path when painting. -
getImageShape
Returns an RMShape representation of the image fill's image (for rare vector based images like PDF). -
paintShape
Render this fill in a Java2D Graphics2D.- Overrides:
paintShape
in classRMFill
-
equals
Standard equals implementation. -
initWithArchiver
Legacy unarchival.- Specified by:
initWithArchiver
in interfaceRMArchiver.Archiving
- Overrides:
initWithArchiver
in classRMFill
-
toXML
XML archival. -
fromXML
XML unarchival. -
awt
Returns the AWT image for this image fill.
-