Class TextFieldElementFactory

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