org.pentaho.reporting.engine.classic.core.elementfactory
Class TextFieldElementFactory

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory
      extended by org.pentaho.reporting.engine.classic.core.elementfactory.TextElementFactory
          extended by org.pentaho.reporting.engine.classic.core.elementfactory.TextFieldElementFactory
Direct Known Subclasses:
DateFieldElementFactory, NumberFieldElementFactory, ResourceFieldElementFactory

public class TextFieldElementFactory
extends TextElementFactory

A factory to define text fields. Text fields read their content from the dataRow and try to print it as plain text (using toString() if required).

Author:
Thomas Morgner

Constructor Summary
TextFieldElementFactory()
          DefaultConstructor.
 
Method Summary
 Element createElement()
          Creates the text field element.
static Element createStringElement(String name, Rectangle2D bounds, Color paint, ElementAlignment alignment, ElementAlignment valign, FontDefinition font, String nullString, String field)
          Deprecated. Use a more fine-grained approach to define this element by using the element-factory directly.
static Element createStringElement(String name, Rectangle2D bounds, Color paint, ElementAlignment alignment, FontDefinition font, String nullString, String field)
          Deprecated. Use a more fine-grained approach to define this element by using the element-factory directly.
 String getFieldname()
          Returns the field name from where to read the content of the element.
 String getFormula()
          Returns the formula that should be used to compute the value of the field.
 String getNullString()
          Returns the null string for the text element.
 void setFieldname(String fieldname)
          Defines the field name from where to read the content of the element.
 void setFormula(String formula)
          Assigns a formula to the element to compute the value for this element.
 void setNullString(String nullString)
          Defines the null string for the text element.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.elementfactory.TextElementFactory
getBold, getEmbedFont, getEncoding, getFontName, getFontSize, getItalic, getLineHeight, getMaximumLetterSpacing, getMinimumLetterSpacing, getOptimumLetterSpacing, getReservedLiteral, getStrikethrough, getTrimTextContent, getUnderline, getVerticalTextAlignment, getWhitespaceCollapse, getWrap, getWrapText, setBold, setEmbedFont, setEncoding, setFontName, setFontSize, setItalic, setLineHeight, setMaximumLetterSpacing, setMinimumLetterSpacing, setOptimumLetterSpacing, setReservedLiteral, setStrikethrough, setTrimTextContent, setUnderline, setVerticalTextAlignment, setWhitespaceCollapse, setWrap, setWrapText
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory
getAbsolutePosition, getAvoidPagebreaks, getBackgroundColor, getBorderBottomColor, getBorderBottomLeftRadius, getBorderBottomLeftRadiusHeight, getBorderBottomLeftRadiusWidth, getBorderBottomRightRadius, getBorderBottomRightRadiusHeight, getBorderBottomRightRadiusWidth, getBorderBottomStyle, getBorderBottomWidth, getBorderBreakColor, getBorderBreakStyle, getBorderBreakWidth, getBorderColor, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRadius, getBorderRadiusHeight, getBorderRadiusWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderStyle, getBorderTopColor, getBorderTopLeftRadius, getBorderTopLeftRadiusHeight, getBorderTopLeftRadiusWidth, getBorderTopRightRadius, getBorderTopRightRadiusHeight, getBorderTopRightRadiusWidth, getBorderTopStyle, getBorderTopWidth, getBorderWidth, getColor, getDynamicHeight, getFontSmooth, getHeight, getHorizontalAlignment, getHRefTarget, getHRefTitle, getHRefWindow, getLayoutCachable, getMaximumHeight, getMaximumSize, getMaximumWidth, getMinimumHeight, getMinimumSize, getMinimumWidth, getName, getOrphans, getOverflowX, getOverflowY, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredSize, getUseMinChunkWidth, getVerticalAlignment, getVisible, getWidows, getWidth, getX, getY, setAbsolutePosition, setAvoidPagebreaks, setBackgroundColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadiusHeight, setBorderBottomLeftRadiusWidth, setBorderBottomRightRadius, setBorderBottomRightRadiusHeight, setBorderBottomRightRadiusWidth, setBorderBottomStyle, setBorderBottomWidth, setBorderBreakColor, setBorderBreakStyle, setBorderBreakWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRadius, setBorderRadiusHeight, setBorderRadiusWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadiusHeight, setBorderTopLeftRadiusWidth, setBorderTopRightRadius, setBorderTopRightRadiusHeight, setBorderTopRightRadiusWidth, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setColor, setDynamicHeight, setFontSmooth, setHeight, setHorizontalAlignment, setHRefTarget, setHRefTitle, setHRefWindow, setLayoutCachable, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setName, setOrphans, setOverflowX, setOverflowY, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPreferredSize, setUseMinChunkWidth, setVerticalAlignment, setVisible, setWidows, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFieldElementFactory

public TextFieldElementFactory()
DefaultConstructor.

Method Detail

getFieldname

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

Returns:
the field name.

setFieldname

public void setFieldname(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.

getFormula

public String getFormula()
Returns the formula that should be used to compute the value of the field. The formula must be valid according to the OpenFormula specifications.

Returns:
the formula as string.

setFormula

public void setFormula(String formula)
Assigns a formula to the element to compute the value for this element. If a formula is defined, it will override the 'field' property.

Parameters:
formula - the formula as a string.

getNullString

public String getNullString()
Returns the null string for the text element. The null string is used when no content is found for that element.

Returns:
the null string.

setNullString

public void setNullString(String nullString)
Defines the null string for the text element. The null string is used when no content is found for that element. The nullstring itself can be null.

Parameters:
nullString - the null string.

createElement

public Element createElement()
Creates the text field element.

Specified by:
createElement in class ElementFactory
Returns:
the generated text field element
See Also:
ElementFactory.createElement()

createStringElement

public static Element createStringElement(String name,
                                          Rectangle2D bounds,
                                          Color paint,
                                          ElementAlignment alignment,
                                          FontDefinition font,
                                          String nullString,
                                          String field)
Deprecated. Use a more fine-grained approach to define this element by using the element-factory directly.

Creates a new TextElement without any additional filtering.

Parameters:
name - the name of the new element
bounds - the bounds of the new element
paint - the text color of this text element
alignment - the horizontal text alignment.
font - the font for this element
nullString - the text used when the value of this element is null
field - the field in the datamodel to retrieve values from
Returns:
a report element for displaying String objects.
Throws:
NullPointerException - if bounds, name or function are null
IllegalArgumentException - if the given alignment is invalid

createStringElement

public static Element createStringElement(String name,
                                          Rectangle2D bounds,
                                          Color paint,
                                          ElementAlignment alignment,
                                          ElementAlignment valign,
                                          FontDefinition font,
                                          String nullString,
                                          String field)
Deprecated. Use a more fine-grained approach to define this element by using the element-factory directly.

Creates a new TextElement without any additional filtering.

Parameters:
name - the name of the new element
bounds - the bounds of the new element
paint - the text color of this text element
alignment - the horizontal text alignment.
valign - the vertical alignment.
font - the font for this element
nullString - the text used when the value of this element is null
field - the field in the datamodel to retrieve values from
Returns:
a report element for displaying String objects.
Throws:
NullPointerException - if bounds, name or function are null
IllegalArgumentException - if the given alignment is invalid