| java.lang.Object org.jfree.report.DefaultImageReference
DefaultImageReference | public class DefaultImageReference implements Serializable,URLImageContainer,LocalImageContainer(Code) | | An DefaultImageReference encapsulates the source of an image together with a java.awt.Image . The source
is used to create a higher resolution version if needed. The source file/URL may also be inlined into the output
target, to create better results.
This implementation provides a reasonable default implementation to encapsualte local AWT-images into reports.
The given image might specify a fixed scale factor for the given image. The scaling will be applied before any layout
computations will be performed.
author: Thomas Morgner |
Method Summary | |
public Object | clone() Clones this Element. | public boolean | equals(Object obj) Checks for equality.
Parameters: obj - the object to test. | public Object | getIdentity() Returns the identity information. | public Image | getImage() Returns the original image if available. | public int | getImageHeight() Returns the (unscaled) image height. | public int | getImageWidth() Returns the (unscaled) image width. | public String | getName() Returns the name of this image reference. | public float | getScaleX() Returns a predefined scaling factor. | public float | getScaleY() Returns a predefined scaling factor. | public URL | getSourceURL() Returns the source URL for the image. | public String | getSourceURLString() Returns the a string version of the source URL. | public int | hashCode() Compute a hashcode for this imageReference. | public boolean | isIdentifiable() Checks, whether this image has a assigned identity. | public boolean | isLoadable() Checks, whether this image reference is loadable. | public void | setScale(float sx, float sy) Defines a predefined scaling factor. | public String | toString() Returns a String representing this object. |
DefaultImageReference | public DefaultImageReference(URL url) throws IOException(Code) | | Creates a new ImageReference with an origin of 0,0 and the desired width. The image data is read from the given
URL.
Parameters: url - the source url. The url must be readable during the report generation. throws: IOException - if the url could not be read. throws: NullPointerException - if the given URL is null. |
DefaultImageReference | public DefaultImageReference(Image img) throws IOException(Code) | | Creates a new ImageReference without an assigned URL for the Image. This image reference will not be loadable and
cannot be used to embedd the original rawdata of the image into the generated content.
Parameters: img - the image for this reference. throws: NullPointerException - if the image is null. throws: java.io.IOException - if an IOError occured while loading the image. |
DefaultImageReference | public DefaultImageReference(int w, int h)(Code) | | Creates a new image reference without assigning either an Image or an URL. This DefaultImageReference will act as
place holder to reserve space during the layouting, no content will be generated.
Parameters: w - the width of the unscaled image. Parameters: h - the height of the unscaled image. |
DefaultImageReference | public DefaultImageReference(DefaultImageReference parent)(Code) | | Copies the contents of the given DefaultImageReference.
Parameters: parent - the parent. |
equals | public boolean equals(Object obj)(Code) | | Checks for equality.
Parameters: obj - the object to test. true if the specified object is equal to this one. |
getIdentity | public Object getIdentity()(Code) | | Returns the identity information. This instance returns the URL of the image, if any.
the image identifier. |
getImage | public Image getImage()(Code) | | Returns the original image if available.
The current image instance, or null, if no image has been assigned. |
getImageHeight | public int getImageHeight()(Code) | | Returns the (unscaled) image height.
the image height. |
getImageWidth | public int getImageWidth()(Code) | | Returns the (unscaled) image width.
the image width. |
getName | public String getName()(Code) | | Returns the name of this image reference. If an URL has been set, this will return the URL of the image, else null
is returned.
the name. |
getScaleX | public float getScaleX()(Code) | | Returns a predefined scaling factor. That scaling will be applied before any layout specific scaling is done.
the scale factor. |
getScaleY | public float getScaleY()(Code) | | Returns a predefined scaling factor. That scaling will be applied before any layout specific scaling is done.
the scale factor. |
getSourceURL | public URL getSourceURL()(Code) | | Returns the source URL for the image.
The URL from where the image has been loaded, or null, if the source URL is not known. |
getSourceURLString | public String getSourceURLString()(Code) | | Returns the a string version of the source URL. If no URL has been assigned, this method will return null.
a String representing the assigned URL. |
hashCode | public int hashCode()(Code) | | Compute a hashcode for this imageReference.
the hashcode |
isIdentifiable | public boolean isIdentifiable()(Code) | | Checks, whether this image has a assigned identity. Two identities should be equal, if the image contents are
equal.
true, if that image contains contains identity information, false otherwise. |
isLoadable | public boolean isLoadable()(Code) | | Checks, whether this image reference is loadable. A default image reference is loadable, if a valid URL has been
set.
true, if it is loadable, false otherwise. |
setScale | public void setScale(float sx, float sy)(Code) | | Defines a predefined scaling factor. That scaling will be applied before any layout specific scaling is done.
If your image has a higher resolution than 72dpi, this factor should be a value lower than 1 (the image will be
scaled down).
Parameters: sx - the scale factor. Parameters: sy - the scale factor. |
toString | public String toString()(Code) | | Returns a String representing this object. Useful for debugging.
The string. |
|
|