Class FieldElement

    • Method Detail

      • copy

        public java.lang.Object copy()
                              throws ReportException
        Creates a serializable copy of this Element. The returned Object is not an instance of Element. This method is used from i-net Designer for Copy and Paste.
        Overrides:
        copy in class Element
        Returns:
        A serializable Object.
        Throws:
        ReportException - If accessing properties of this Element causes any errors.
        See Also:
        Section.pasteElement(java.lang.Object)
      • getFirstLineIndent

        public int getFirstLineIndent()
        Returns the value of the property 'first line indent'. This is the distance that the first line of the paragraph is indented from the left margin of the paragraph (in twips).
        Specified by:
        getFirstLineIndent in interface ParagraphProperties
        Returns:
        The value of the property 'first line indent'.
      • setFirstLineIndent

        public void setFirstLineIndent​(int newValue)
        Sets the value of the property 'first line indent'. This is the distance that the first line of the paragraph is indented from the left margin of the paragraph (in twips).
        Specified by:
        setFirstLineIndent in interface ParagraphProperties
        Parameters:
        newValue - The new value of the property 'first line indent'. May be negative (which would cause the first line to be left of the left margin).
      • getLeftIndent

        public int getLeftIndent()
        Returns the value of the property 'left indent'. This is the distance that the the paragraph is indented from the left margin of the element (in twips).
        Specified by:
        getLeftIndent in interface ParagraphProperties
        Returns:
        The value of the property 'left indent'.
      • setLeftIndent

        public void setLeftIndent​(int newLeftIndent)
        Sets the value of the property 'left indent'. This is the distance that the the paragraph is indented from the left margin of the element (in twips).
        Specified by:
        setLeftIndent in interface ParagraphProperties
        Parameters:
        newLeftIndent - The new value of the property 'left indent'.
      • getRightIndent

        public int getRightIndent()
        Returns the value of the property 'rightIndent'. This is the distance that the the paragraph is indented from the right margin of the element (in twips).
        Specified by:
        getRightIndent in interface ParagraphProperties
        Returns:
        The current value of the property 'rightIndent'. 
      • setRightIndent

        public void setRightIndent​(int newRightIndent)
        Sets the value of the property 'rightIndent'. This is the distance that the the paragraph is indented from the right margin of the element (in twips).
        Specified by:
        setRightIndent in interface ParagraphProperties
        Parameters:
        newRightIndent - The new value of the property 'rightIndent'.
      • setLineSpacingRelative

        public void setLineSpacingRelative​(double lineSpacingRelative)
        Sets the factor by which the default line spacing is to be multiplied for this paragraph. The default line spacing is determined by font and font size, and is then multiplied by this number. Setting LINE_SPACING_ABSOLUTE will cause the value to be reset to its default, which is "1".
        Specified by:
        setLineSpacingRelative in interface ParagraphProperties
        Parameters:
        lineSpacingRelative - Factor by which the default line spacing is to be multiplied for this paragraph, or LINE_SPACING_ABSOLUTE if the default value is to be set (equivalent to "1")
        See Also:
        ParagraphProperties.LINE_SPACING_ABSOLUTE, ParagraphProperties.getLineSpacingRelative()
      • getLineSpacingRelative

        public double getLineSpacingRelative()
        Returns the factor by which the default line spacing is to be multiplied for this paragraph. The default line spacing is determined by font and font size, and is then multiplied by this number. If an absolute value has been set, this will return LINE_SPACING_ABSOLUTE instead.
        Specified by:
        getLineSpacingRelative in interface ParagraphProperties
        Returns:
        Factor by which the default line spacing is to be multiplied for this paragraph, or LINE_SPACING_ABSOLUTE if an absolute line spacing distance has been set.
        See Also:
        ParagraphProperties.LINE_SPACING_ABSOLUTE, ParagraphProperties.getLineSpacingRelative()
      • getBaseUrl

        public java.lang.String getBaseUrl()
        Returns the currently set base URL for relative URLs. Null may be returned, which means that the report server location is taken as the base URL.
        Specified by:
        getBaseUrl in interface TextInterpretationProperties
        Returns:
        the currently set base URL for relative URLs, or null if there is none.
        See Also:
        Document.StreamDescriptionProperty
      • getBaseUrlFormula

        public FormulaField getBaseUrlFormula()
        Returns the property formula set for the base URL property. Can be null which means that no property formula was set for the property.
        Specified by:
        getBaseUrlFormula in interface TextInterpretationProperties
        Returns:
        returns the current base URL property formula as a formula field.
        See Also:
        Document.StreamDescriptionProperty
      • setBaseUrl

        public void setBaseUrl​(java.lang.String base)
        Sets the base URL for relative URLs. If a hyperlink URL is relative, it is viewed as relative to this base URL. Setting null causes the default behavior (URLs are viewed as relative to the report server location).
        Specified by:
        setBaseUrl in interface TextInterpretationProperties
        Parameters:
        base - Base URL to use for relative URLs
        See Also:
        Document.StreamDescriptionProperty
      • setBaseUrlFormula

        public void setBaseUrlFormula​(FormulaField newFormula)
        Sets a property formula for the base URL property. Can be null which causes there to be no property formula set.
        Specified by:
        setBaseUrlFormula in interface TextInterpretationProperties
        Parameters:
        newFormula - formula field for the property formula for the base URL property, or null
        See Also:
        Document.StreamDescriptionProperty
      • paramString

        public java.lang.String paramString()
        Create a string representation of this class for debugging.
        Overrides:
        paramString in class Element
        Returns:
        the string representation of this object
        Since:
        7.0
      • resetReferences

        public void resetReferences()
        FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY
        Specified by:
        resetReferences in interface com.inet.report.ReferenceHolder
        Overrides:
        resetReferences in class ReportComponent
      • setGlyphOrientationFormula

        public void setGlyphOrientationFormula​(FormulaField formula)
        Sets the formula whose return value determines the glyph orientation. This is the rotation of every individual character in each line. This formula should return one of the formula constants GlyphDefault, GlyphLeft, GlyphRight, or GlyphDown.
        Specified by:
        setGlyphOrientationFormula in interface TextProperties
        Parameters:
        formula - the formula whose return value determines the glyph orientation
      • getGlyphOrientationFormula

        public FormulaField getGlyphOrientationFormula()
        Returns the formula whose return value determines the glyph orientation. This is the rotation of every individual character in each line. This formula should return one of the formula constants GlyphDefault, GlyphLeft, GlyphRight, or GlyphDown.
        Specified by:
        getGlyphOrientationFormula in interface TextProperties
        Returns:
        the formula whose return value determines the glyph orientation
      • setTextRotation

        public void setTextRotation​(int rotation)
        Sets the value of the property 'text rotation'. This property defines a final rotation of the entire element after the text is laid out. For example, to have a text element have vertical text running from top to bottom and each line run from right to left, you'd set a glyph orientation of GLYPH_LEFT and a text rotation of ROTATE_270.
        Specified by:
        setTextRotation in interface TextProperties
        Parameters:
        rotation - The new value of the property 'text rotation'. Rotation is done counter-clockwise.
        Since:
        5.4
        See Also:
        TextProperties.ROTATE_0, TextProperties.ROTATE_90, TextProperties.ROTATE_180, TextProperties.ROTATE_270
      • setTextRotationFormula

        public void setTextRotationFormula​(FormulaField formula)
        Sets the formula whose return value determines the property 'text rotation'. This property defines a final rotation of the entire element after the text is laid out. This formula should return one of the formula constants Rotate0, Rotate90, Rotate180, or Rotate270.
        Specified by:
        setTextRotationFormula in interface TextProperties
        Parameters:
        formula - formula whose return value determines the property 'text rotation'.
        See Also:
        TextProperties.getTextRotation(), TextProperties.setTextRotation(int)
      • setCanGrow

        public void setCanGrow​(boolean canGrow)
        Number and Currency Field Elements can be set can grow, however they then always have a maximum limit of 1 line, i.e. they grow until at least one line is visible. All other FieldElements are normal in regards to their "can grow" behavior.
        Specified by:
        setCanGrow in interface GeneralProperties
        Overrides:
        setCanGrow in class Element
        Parameters:
        canGrow - whether or not this element should be able to "grow" vertically if its content exceeds its available space.
        Since:
        7.0
        See Also:
        Element.setCanGrow(boolean)
      • setCanGrowCount

        public void setCanGrowCount​(int limit)
        Number and Currency Field Elements can only be set to a can grow maximum limit of 1. All other FieldElements can be set normally.
        Specified by:
        setCanGrowCount in interface GeneralProperties
        Overrides:
        setCanGrowCount in class Element
        Parameters:
        limit - maximum "can grow" limit
        Throws:
        java.lang.IllegalArgumentException - if this Element is a Number or Currency FieldElement and newFormula is not 1
        Since:
        7.0
        See Also:
        Element.setCanGrow(boolean)
      • getFirstLineIndentFormula

        public FormulaField getFirstLineIndentFormula()
        Returns the formula whose return value determines the property 'first line indent'. This is the distance that the first line of the paragraph is indented from the left margin of the paragraph (in twips).
        Specified by:
        getFirstLineIndentFormula in interface ParagraphProperties
        Returns:
        The formula whose return value determines the property 'first line indent'.
      • getLeftIndentFormula

        public FormulaField getLeftIndentFormula()
        Returns the formula whose return value determines the property 'left indent'. This is the distance that the the paragraph is indented from the left margin of the element (in twips).
        Specified by:
        getLeftIndentFormula in interface ParagraphProperties
        Returns:
        The formula whose return value determines the property 'left indent'.
      • getLineSpacingRelativeFormula

        public FormulaField getLineSpacingRelativeFormula()
        Returns the formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraph. The default line spacing is determined by font and font size, and is then multiplied by this formula's value.
        Specified by:
        getLineSpacingRelativeFormula in interface ParagraphProperties
        Returns:
        formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraph
        See Also:
        ParagraphProperties.getLineSpacingRelative()
      • getRightIndentFormula

        public FormulaField getRightIndentFormula()
        Returns the formula whose return value determines the property 'right indent'. This is the distance that the the paragraph is indented from the right margin of the element (in twips).
        Specified by:
        getRightIndentFormula in interface ParagraphProperties
        Returns:
        The formula whose return value determines the property 'right indent'.
      • setFirstLineIndentFormula

        public void setFirstLineIndentFormula​(FormulaField formula)
        Sets the formula whose return value determines the property 'first line indent'. This is the distance that the first line of the paragraph is indented from the left margin of the paragraph (in twips).
        Specified by:
        setFirstLineIndentFormula in interface ParagraphProperties
        Parameters:
        formula - The formula whose return value determines the property 'first line indent'.
      • setLeftIndentFormula

        public void setLeftIndentFormula​(FormulaField formula)
        Sets the formula whose return value determines the property 'left indent'. This is the distance that the the paragraph is indented from the left margin of the element (in twips).
        Specified by:
        setLeftIndentFormula in interface ParagraphProperties
        Parameters:
        formula - The formula whose return value determines the property 'left indent'.
      • setLineSpacingRelativeFormula

        public void setLineSpacingRelativeFormula​(FormulaField formula)
        Sets the formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraph. The default line spacing is determined by font and font size, and is then multiplied by this formula's value.
        Specified by:
        setLineSpacingRelativeFormula in interface ParagraphProperties
        Parameters:
        formula - formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraph
        See Also:
        ParagraphProperties.setLineSpacingRelative(double)
      • setRightIndentFormula

        public void setRightIndentFormula​(FormulaField formula)
        Sets the formula whose return value determines the property 'right indent'. This is the distance that the the paragraph is indented from the right margin of the element (in twips).
        Specified by:
        setRightIndentFormula in interface ParagraphProperties
        Parameters:
        formula - The formula whose return value determines the property 'right indent'.
      • parseElement

        public NodeParser parseElement​(com.inet.report.parser.XMLTag group,
                                       java.lang.String tag,
                                       org.xml.sax.Attributes atts,
                                       java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                                throws FatalParserException
        FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XML

        Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.

        Specified by:
        parseElement in interface NodeParser
        Overrides:
        parseElement in class AbstractValueElement
        Parameters:
        group - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.
        tag - The XMLTag to be parsed
        atts - The set of attributes in the current XMLTag
        parserMap - The map of current Parser.
        Returns:
        The NodeParser sub-element if one needed to be created, or null if none was created.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • parseEndElement

        public void parseEndElement​(com.inet.report.parser.XMLTag group,
                                    java.lang.String tag,
                                    java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                             throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Receive notification of the end of an XML tag.

        Specified by:
        parseEndElement in interface NodeParser
        Overrides:
        parseEndElement in class ReportComponent
        Parameters:
        group - XMLTag of the current node to be parsed, or null if there is no such current group.
        tag - The XMLTag to be parsed
        parserMap - The map of current Parser.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • parseText

        public void parseText​(java.lang.String text,
                              java.util.Map<java.lang.String,​java.lang.Object> parserMap)
        FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XML

        This method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)

        Specified by:
        parseText in interface NodeParser
        Overrides:
        parseText in class Element
        Parameters:
        text - text encountered and to be stored
        parserMap - The map of current Parser.
      • getSubComponents

        public java.util.List<? extends ReportComponent> getSubComponents()
        Returns all ReportComponents that are descendants of this one. E.G. this will return all Element of a Section. But it's as well useful for CrossTabs or Text elements which have additional elements.
        Specified by:
        getSubComponents in class ReportComponent
        Returns:
        a list with all sub components which can be empty as well; will be null if the component has no descendants