org.jfree.report.elementfactory
Class ImageURLFieldElementFactory

java.lang.Object
  extended byorg.jfree.report.elementfactory.ElementFactory
      extended byorg.jfree.report.elementfactory.ImageElementFactory
          extended byorg.jfree.report.elementfactory.ImageURLFieldElementFactory

public class ImageURLFieldElementFactory
extends ImageElementFactory

A factory to define ImageURLFieldElements. These elements expect an java.net.URL or an String as content and will display the image content of that URL in the report.

Author:
Thomas Morgner

Constructor Summary
ImageURLFieldElementFactory()
          DefaultConstructor.
 
Method Summary
 Element createElement()
          Creates the image URL field element based on the defined properties.
static ImageElement createImageURLElement(java.lang.String name, java.awt.geom.Rectangle2D bounds, java.lang.String field)
          Creates a new ImageElement, which is fed from an URL stored in the datasource.
static ImageElement createImageURLElement(java.lang.String name, java.awt.geom.Rectangle2D bounds, java.lang.String field, boolean scale)
          Creates a new ImageElement, which is fed from an URL stored in the datasource.
static ImageElement createImageURLElement(java.lang.String name, java.awt.geom.Rectangle2D bounds, java.lang.String field, boolean scale, boolean keepAspectRatio)
          Creates a new ImageElement, which is fed from an URL stored in the datasource.
 java.lang.String getFieldname()
          Returns the field name from where to read the content of the element.
 void setFieldname(java.lang.String fieldname)
          Defines the field name from where to read the content of the element.
 
Methods inherited from class org.jfree.report.elementfactory.ImageElementFactory
applyStyle, getKeepAspectRatio, getScale, setKeepAspectRatio, setScale
 
Methods inherited from class org.jfree.report.elementfactory.ElementFactory
applyElementName, getAbsolutePosition, getDynamicHeight, getMaximumSize, getMinimumSize, getName, getPreferredSize, setAbsolutePosition, setDynamicHeight, setMaximumSize, setMinimumSize, setName, setPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageURLFieldElementFactory

public ImageURLFieldElementFactory()
DefaultConstructor.

Method Detail

getFieldname

public java.lang.String getFieldname()
Returns the field name from where to read the content of the element.

Returns:
the field name.

setFieldname

public void setFieldname(java.lang.String fieldname)
Defines the field name from where to read the content of the element. The field name is the name of a datarow column.

Parameters:
fieldname - the field name.

createElement

public Element createElement()
Creates the image URL field element based on the defined properties.

Specified by:
createElement in class ElementFactory
Returns:
the created element.
See Also:
ElementFactory.createElement()

createImageURLElement

public static ImageElement createImageURLElement(java.lang.String name,
                                                 java.awt.geom.Rectangle2D bounds,
                                                 java.lang.String field)
Creates a new ImageElement, which is fed from an URL stored in the datasource.

Parameters:
name - the name of the new element
bounds - the bounds of the new element
field - the name of the column/function/expression that returns the URL for the image.
Returns:
a report element for displaying an image based on a URL.
Throws:
java.lang.NullPointerException - if bounds, name or source are null
java.lang.IllegalArgumentException - if the given alignment is invalid

createImageURLElement

public static ImageElement createImageURLElement(java.lang.String name,
                                                 java.awt.geom.Rectangle2D bounds,
                                                 java.lang.String field,
                                                 boolean scale)
Creates a new ImageElement, which is fed from an URL stored in the datasource.

Parameters:
name - the name of the new element.
bounds - the bounds of the new element.
field - the name of the column/function/expression that returns the URL for the image.
scale - scale the image?
Returns:
a report element for displaying an image based on a URL.
Throws:
java.lang.NullPointerException - if bounds, name or source are null
java.lang.IllegalArgumentException - if the given alignment is invalid

createImageURLElement

public static ImageElement createImageURLElement(java.lang.String name,
                                                 java.awt.geom.Rectangle2D bounds,
                                                 java.lang.String field,
                                                 boolean scale,
                                                 boolean keepAspectRatio)
Creates a new ImageElement, which is fed from an URL stored in the datasource.

Parameters:
name - the name of the new element
bounds - the bounds of the new element
field - the name of the column/function/expression that returns the URL for the image.
scale - true if the content should be scaled to fit.
keepAspectRatio - preserve the aspect ratio.
Returns:
a report element for displaying an image based on a URL.
Throws:
java.lang.NullPointerException - if bounds, name or source are null
java.lang.IllegalArgumentException - if the given alignment is invalid