ReportMill 7.0 API

com.reportmill.graphics
Class RMImageFill

java.lang.Object
  extended bycom.reportmill.foundation.RMObject
      extended bycom.reportmill.graphics.RMFill
          extended bycom.reportmill.graphics.RMImageFill
All Implemented Interfaces:
java.lang.Cloneable, com.reportmill.foundation.RMArchiver.Archiving
Direct Known Subclasses:
RMGradientFill

public class RMImageFill
extends RMFill

This class is used to fill a shape's path with an image.


Field Summary
static byte STYLE_FIT
           
static byte STYLE_FIT_IFNEEDED
           
static byte STYLE_STRETCH
           
static byte STYLE_TILE
           
 
Constructor Summary
RMImageFill()
          Creates a plain image fill.
RMImageFill(java.lang.Object aSource)
          Creates an image fill from an image source.
 
Method Summary
 java.awt.Image awt()
           
 RMFill deriveFill(RMColor aColor)
          Creates a new fill from this image fill, but with a new color.
 RMImageFill deriveFill(com.reportmill.graphics.RMImageData anImageData)
          Creates a new image fill from this fill, but with a new image.
 boolean equals(java.lang.Object obj)
          Standard equals implementation.
 java.lang.Object fromXML(com.ribs.RXArchiver anArchiver, com.ribs.RXElement anElement)
          XML unarchival.
 byte getFillStyle()
          Returns the fill style (Stretch, Tile, Fit or FitIfNeeded).
 RMRect getImageBounds(RMRect bounds)
          Returns the image bounds for a given rect.
 RMRect getImageBounds(RMShape aShape)
          Returns the image bounds for a given shape.
 com.reportmill.graphics.RMImageData getImageData()
          Returns the image data associated with this image fill.
 float getImageMargins()
          Returns the inset for the image when drawn in a given bounds.
 RMShape getImageShape()
          Returns an RMShape representation of the image fill's image (for rare vector based images like PDF).
 RMSize getImageSize()
          Returns the image size of the image for this image fill.
 int getPageNumber()
          Returns the page number of the image fill's image that is displayed (for rare multi-page images like PDF).
 java.lang.String getType()
          Returns the type of the image for this image fill (gif, jpg, png, etc.).
 java.lang.Object initWithArchiver(com.reportmill.foundation.RMArchiver anArchiver)
          Legacy unarchival.
 void paintPath(RMPath aPath, java.awt.Graphics2D g, float anOpacity, java.awt.Image anImage)
          Paints the image fill within the given path and graphics object with a given transparency.
 void setFillStyle(byte aValue)
          Returns the fill style (Stretch, Tile, Fit or FitIfNeeded).
 void setImageData(com.reportmill.graphics.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).
 com.ribs.RXElement toXML(com.ribs.RXArchiver anArchiver)
          XML archival.
 
Methods inherited from class com.reportmill.graphics.RMFill
getColor, plain, setColor
 
Methods inherited from class com.reportmill.foundation.RMObject
archiverClassName, clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_STRETCH

public static final byte STYLE_STRETCH
See Also:
Constant Field Values

STYLE_TILE

public static final byte STYLE_TILE
See Also:
Constant Field Values

STYLE_FIT

public static final byte STYLE_FIT
See Also:
Constant Field Values

STYLE_FIT_IFNEEDED

public static final byte STYLE_FIT_IFNEEDED
See Also:
Constant Field Values
Constructor Detail

RMImageFill

public RMImageFill()
Creates a plain image fill.


RMImageFill

public RMImageFill(java.lang.Object aSource)
Creates an image fill from an image source.

Method Detail

getImageData

public com.reportmill.graphics.RMImageData getImageData()
Returns the image data associated with this image fill.


setImageData

public void setImageData(com.reportmill.graphics.RMImageData anImageData)
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).


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

public RMFill deriveFill(RMColor aColor)
Creates a new fill from this image fill, but with a new color.

Overrides:
deriveFill in class RMFill

deriveFill

public RMImageFill deriveFill(com.reportmill.graphics.RMImageData anImageData)
Creates a new image fill from this fill, but with a new image.


getType

public java.lang.String getType()
Returns the type of the image for this image fill (gif, jpg, png, etc.).


getImageSize

public RMSize getImageSize()
Returns the image size of the image for this image fill.


getImageBounds

public RMRect getImageBounds(RMShape aShape)
Returns the image bounds for a given shape.


getImageBounds

public RMRect getImageBounds(RMRect bounds)
Returns the image bounds for a given rect.


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).


getImageShape

public RMShape getImageShape()
Returns an RMShape representation of the image fill's image (for rare vector based images like PDF).


paintPath

public void paintPath(RMPath aPath,
                      java.awt.Graphics2D g,
                      float anOpacity,
                      java.awt.Image anImage)
Paints the image fill within the given path and graphics object with a given transparency.


equals

public boolean equals(java.lang.Object obj)
Standard equals implementation.

Overrides:
equals in class RMFill

toXML

public com.ribs.RXElement toXML(com.ribs.RXArchiver anArchiver)
XML archival.

Overrides:
toXML in class RMFill

fromXML

public java.lang.Object fromXML(com.ribs.RXArchiver anArchiver,
                                com.ribs.RXElement anElement)
XML unarchival.

Overrides:
fromXML in class RMFill

initWithArchiver

public java.lang.Object initWithArchiver(com.reportmill.foundation.RMArchiver anArchiver)
Legacy unarchival.

Specified by:
initWithArchiver in interface com.reportmill.foundation.RMArchiver.Archiving
Overrides:
initWithArchiver in class RMFill

awt

public java.awt.Image awt()

ReportMill 7.0 API