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

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.LabelElementFactory

public class LabelElementFactory
extends TextElementFactory

A factory to define LabelElements. LabelElements are considered immutable and should not be modified once they are created. The label expects plain text.

Author:
Thomas Morgner

Constructor Summary
LabelElementFactory()
          DefaultConstructor.
 
Method Summary
 Element createElement()
          Creates the label element.
static Element createLabelElement(String name, Rectangle2D bounds, Color paint, ElementAlignment alignment, ElementAlignment valign, FontDefinition font, String labeltext)
          Deprecated. Use a more fine-grained approach to define this element by using the element-factory directly.
static Element createLabelElement(String name, Rectangle2D bounds, Color paint, ElementAlignment alignment, FontDefinition font, String labeltext)
          Deprecated. Use a more fine-grained approach to define this element by using the element-factory directly.
 String getExcelFormula()
           
 String getText()
          Returns the label text.
 void setExcelFormula(String excelFormula)
           
 void setText(String text)
          Defines the text of the label.
 
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

LabelElementFactory

public LabelElementFactory()
DefaultConstructor.

Method Detail

getText

public String getText()
Returns the label text.

Returns:
the text of the label.

setText

public void setText(String text)
Defines the text of the label.

Parameters:
text - the plain text of the label.

getExcelFormula

public String getExcelFormula()

setExcelFormula

public void setExcelFormula(String excelFormula)

createElement

public Element createElement()
Creates the label element.

Specified by:
createElement in class ElementFactory
Returns:
the generated label.
Throws:
IllegalStateException - if the text is not defined.
See Also:
ElementFactory.createElement()

createLabelElement

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

Creates a new TextElement containing a label.

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
labeltext - the text to display
Returns:
a report element for displaying a label (static text).
Throws:
NullPointerException - if bounds, name, format or field are null
IllegalArgumentException - if the given alignment is invalid

createLabelElement

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

Creates a new TextElement containing a label.

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 alignment.
valign - the vertical alignment.
font - the font for this element.
labeltext - the text to display.
Returns:
a report element for displaying a label (static text).
Throws:
NullPointerException - if bounds, name, format or field are null.
IllegalArgumentException - if the given alignment is invalid.