Class 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 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)
      • 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 Text Element 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.