org.jfree.report.elementfactory
Class ShapeFieldElementFactory

java.lang.Object
  extended byorg.jfree.report.elementfactory.ElementFactory
      extended byorg.jfree.report.elementfactory.ShapeElementFactory
          extended byorg.jfree.report.elementfactory.ShapeFieldElementFactory

public class ShapeFieldElementFactory
extends ShapeElementFactory

A factory to define Shape field elements.

Author:
Thomas Morgner

Constructor Summary
ShapeFieldElementFactory()
          DefaultConstructor.
 
Method Summary
 Element createElement()
          Creates the shape field element.
static ShapeElement createShapeElement(java.lang.String name, java.awt.geom.Rectangle2D bounds, java.awt.Color paint, java.awt.Stroke stroke, java.lang.String fieldname, boolean shouldDraw, boolean shouldFill, boolean shouldScale, boolean keepAspectRatio)
          Creates a new ShapeElement.
 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.ShapeElementFactory
applyStyle, getColor, getKeepAspectRatio, getScale, getShouldDraw, getShouldFill, getStroke, setColor, setKeepAspectRatio, setScale, setShouldDraw, setShouldFill, setStroke
 
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

ShapeFieldElementFactory

public ShapeFieldElementFactory()
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 shape field element.

Specified by:
createElement in class ElementFactory
Returns:
the generated shape field element
Throws:
java.lang.IllegalStateException - if the fieldname is not defined.
See Also:
ElementFactory.createElement()

createShapeElement

public static ShapeElement createShapeElement(java.lang.String name,
                                              java.awt.geom.Rectangle2D bounds,
                                              java.awt.Color paint,
                                              java.awt.Stroke stroke,
                                              java.lang.String fieldname,
                                              boolean shouldDraw,
                                              boolean shouldFill,
                                              boolean shouldScale,
                                              boolean keepAspectRatio)
Creates a new ShapeElement.

Parameters:
name - the name of the new element.
bounds - the bounds.
paint - the line color of this element.
stroke - the stroke of this shape. For pdf use, restrict to BasicStrokes.
fieldname - the fieldname from where to get the shape.
shouldDraw - draw the shape?
shouldFill - fill the shape?
shouldScale - scale the shape?
keepAspectRatio - preserve the aspect ratio?
Returns:
a report element for drawing a line.
Throws:
java.lang.NullPointerException - if bounds, name or shape are null
java.lang.IllegalArgumentException - if the given alignment is invalid