org.jfree.report.elementfactory
Class ElementFactory

java.lang.Object
  extended byorg.jfree.report.elementfactory.ElementFactory
Direct Known Subclasses:
DrawableFieldElementFactory, ImageElementFactory, ShapeElementFactory, TextElementFactory

public abstract class ElementFactory
extends java.lang.Object

The class element factory is the base class for all Element Factories. Element factories can be used to create predefined element types. The properties allow null values, if a property is null, it will not be defined. Undefined properties can inherit their values from the element's parent bands.

Author:
Thomas Morgner

Constructor Summary
ElementFactory()
          Default Constructor.
 
Method Summary
protected  void applyElementName(Element e)
          Applies the defined name to the created element.
protected  void applyStyle(ElementStyleSheet style)
          Applies the style definition to the elements stylesheet.
abstract  Element createElement()
          Creates a new instance of the element.
 java.awt.geom.Point2D getAbsolutePosition()
          Returns the element's absolute position.
 java.lang.Boolean getDynamicHeight()
          Defines whether the element's height should be adjusted automaticly.
 java.awt.geom.Dimension2D getMaximumSize()
          Returns the element's maximum size.
 java.awt.geom.Dimension2D getMinimumSize()
          Returns the element's minimum size.
 java.lang.String getName()
          Returns the name of the new element.
 java.awt.geom.Dimension2D getPreferredSize()
          Returns the element's preferred size.
 void setAbsolutePosition(java.awt.geom.Point2D absolutePosition)
          Returns the element's absolute position.
 void setDynamicHeight(java.lang.Boolean dynamicHeight)
          Defines the state of the element's dynamic content height feature.
 void setMaximumSize(java.awt.geom.Dimension2D maximumSize)
          Defines the element's maximum size.
 void setMinimumSize(java.awt.geom.Dimension2D minimumSize)
          Defines the element's minimum size.
 void setName(java.lang.String name)
          Defines the name of the element.
 void setPreferredSize(java.awt.geom.Dimension2D preferredSize)
          Returns the element's preferred size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementFactory

public ElementFactory()
Default Constructor.

Method Detail

getName

public java.lang.String getName()
Returns the name of the new element.

Returns:
the name of the element.

setName

public void setName(java.lang.String name)
Defines the name of the element. If the name is null, the default (anonymous) name will be used.

Parameters:
name - the element name.

getMinimumSize

public java.awt.geom.Dimension2D getMinimumSize()
Returns the element's minimum size. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Returns:
the element's minimum size.

setMinimumSize

public void setMinimumSize(java.awt.geom.Dimension2D minimumSize)
Defines the element's minimum size. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Parameters:
minimumSize - the element's minimum size.

getMaximumSize

public java.awt.geom.Dimension2D getMaximumSize()
Returns the element's maximum size. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Returns:
the element's maximum size.

setMaximumSize

public void setMaximumSize(java.awt.geom.Dimension2D maximumSize)
Defines the element's maximum size. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Parameters:
maximumSize - the element's maximum size.

getPreferredSize

public java.awt.geom.Dimension2D getPreferredSize()
Returns the element's preferred size. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Returns:
the element's preferred size.

setPreferredSize

public void setPreferredSize(java.awt.geom.Dimension2D preferredSize)
Returns the element's preferred size. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Parameters:
preferredSize - the element's preferred size.

getAbsolutePosition

public java.awt.geom.Point2D getAbsolutePosition()
Returns the element's absolute position. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Returns:
the element's absolute position.

setAbsolutePosition

public void setAbsolutePosition(java.awt.geom.Point2D absolutePosition)
Returns the element's absolute position. Whether this property is used during the layouting depends on the layout manager implementation of the container.

Parameters:
absolutePosition - the element's absolute position.

getDynamicHeight

public java.lang.Boolean getDynamicHeight()
Defines whether the element's height should be adjusted automaticly. This feature is expensive and be used with care. Set the value to null, to declare that the dynamic feature is undefined.

Returns:
the state of the dynamic feature or null, if the feature is undefined.

setDynamicHeight

public void setDynamicHeight(java.lang.Boolean dynamicHeight)
Defines the state of the element's dynamic content height feature.

Parameters:
dynamicHeight - the new value of the elements dynamic height feature.

applyElementName

protected void applyElementName(Element e)
Applies the defined name to the created element.

Parameters:
e - the element which was created.

applyStyle

protected void applyStyle(ElementStyleSheet style)
Applies the style definition to the elements stylesheet.

Parameters:
style - the element stylesheet which should receive the style definition.

createElement

public abstract Element createElement()
Creates a new instance of the element.

Returns:
the newly generated instance of the element.