Class JRFillElement

    • Field Detail

      • EXCEPTION_MESSAGE_KEY_INVALID_BOOKMARK_LEVEL

        public static final java.lang.String EXCEPTION_MESSAGE_KEY_INVALID_BOOKMARK_LEVEL
        See Also:
        Constant Field Values
      • dynamicTransferProperties

        protected java.util.List<java.lang.String> dynamicTransferProperties
      • providerStyle

        protected JRStyle providerStyle
      • styleProviders

        protected java.util.List<StyleProvider> styleProviders
      • printWhenGroupChanges

        protected JRGroup printWhenGroupChanges
      • currentEvaluation

        protected byte currentEvaluation
      • delayedEvaluationsMap

        protected java.util.Map<JREvaluationTime,​net.sf.jasperreports.engine.fill.JRFillElement.DelayedEvaluations> delayedEvaluationsMap
      • initStyle

        protected JRStyle initStyle
      • exprStyle

        protected JRStyle exprStyle
      • currentStyle

        protected JRStyle currentStyle
      • staticTransferProperties

        protected JRPropertiesMap staticTransferProperties
      • hasDynamicPopulateTemplateStyle

        protected boolean hasDynamicPopulateTemplateStyle
      • defaultPopulateTemplateStyle

        protected java.lang.Boolean defaultPopulateTemplateStyle
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Description copied from interface: JRElement
        Returns the string value that uniquely identifies the element.
        Specified by:
        getKey in interface JRCommonElement
        Specified by:
        getKey in interface JRElement
      • setPositionType

        public void setPositionType​(PositionTypeEnum positionType)
        Description copied from interface: JRElement
        Sets the position type for the element.
        Specified by:
        setPositionType in interface JRElement
        Parameters:
        positionType - the position type
      • setStretchType

        public void setStretchType​(StretchTypeEnum stretchType)
        Description copied from interface: JRElement
        Specifies how the engine should treat a missing image.
        Specified by:
        setStretchType in interface JRElement
        Parameters:
        stretchType - a value representing one of the stretch type constants in StretchTypeEnum
      • setPrintRepeatedValues

        public void setPrintRepeatedValues​(boolean isPrintRepeatedValues)
        Specified by:
        setPrintRepeatedValues in interface JRElement
      • getModeValue

        public ModeEnum getModeValue()
        Description copied from interface: JRCommonElement
        Returns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements.
        Specified by:
        getModeValue in interface JRCommonElement
      • getX

        public int getX()
        Description copied from interface: JRElement
        Gets the the section relative horizontal offset of the element top left corner.
        Specified by:
        getX in interface JRElement
      • setX

        public void setX​(int x)
        Description copied from interface: JRElement
        Sets the the section relative horizontal offset of the element top left corner.
        Specified by:
        setX in interface JRElement
      • setY

        public void setY​(int y)
      • getY

        public int getY()
        Description copied from interface: JRElement
        Gets the the section relative vertical offset of the element top left corner.
        Specified by:
        getY in interface JRElement
      • setWidth

        public void setWidth​(int width)
        Specified by:
        setWidth in interface JRElement
      • setHeight

        public void setHeight​(int height)
      • isRemoveLineWhenBlank

        public boolean isRemoveLineWhenBlank()
        Description copied from interface: JRElement
        Returns true if the remaining blank space appearing when the value is not printed will be removed. Under certain circumstances (the element has an empty string as its value or contains a repeated value that is supressed) the space reserved for the current element remains empty. If this method returns true, it means the engine will try to suppress the blank line, but will only succeed if no other elements occupy the same vertical space.
        Specified by:
        isRemoveLineWhenBlank in interface JRElement
      • setRemoveLineWhenBlank

        public void setRemoveLineWhenBlank​(boolean isRemoveLine)
        Description copied from interface: JRElement
        Specifies whether the remaining blank space appearing when the value is not printed will be removed. Under certain circumstances (the element has an empty string as its value or contains a repeated value that is supressed) the space reserved for the current element remains empty. If the parameter is set to true, it means the engine will try to suppress the blank line, but will only succeed if no other elements occupy the same vertical space.
        Specified by:
        setRemoveLineWhenBlank in interface JRElement
      • isPrintInFirstWholeBand

        public boolean isPrintInFirstWholeBand()
        Description copied from interface: JRElement
        Returns true if an element with a printRepeatedValues attribute set to true will be redisplayed for every new page or column that is not an overflow from a previous page or column.
        Specified by:
        isPrintInFirstWholeBand in interface JRElement
        See Also:
        JRElement.isPrintRepeatedValues()
      • setPrintInFirstWholeBand

        public void setPrintInFirstWholeBand​(boolean isPrint)
        Description copied from interface: JRElement
        Specifies whether an element with a printRepeatedValues attribute set to true should be redisplayed for every new page or column that is not an overflow from a previous page or column.
        Specified by:
        setPrintInFirstWholeBand in interface JRElement
        See Also:
        JRElement.isPrintRepeatedValues()
      • isPrintWhenDetailOverflows

        public boolean isPrintWhenDetailOverflows()
        Description copied from interface: JRElement
        If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page. Actually if there is at least one element with this attribute, the band is redisplayed from the beginning, except those elements that fitted in the current page and have isPrintWhenDetailOverflow set to false.
        Specified by:
        isPrintWhenDetailOverflows in interface JRElement
      • setPrintWhenDetailOverflows

        public void setPrintWhenDetailOverflows​(boolean isPrint)
        Description copied from interface: JRElement
        If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page. Actually if there is at least one element with this attribute, the band is redisplayed from the beginning, except those elements that fitted in the current page and have isPrintWhenDetailOverflow set to false.
        Specified by:
        setPrintWhenDetailOverflows in interface JRElement
      • getPrintWhenExpression

        public JRExpression getPrintWhenExpression()
        Description copied from interface: JRElement
        Gets the expression that is evaluated in order to decide if the element should be displayed. This expression always returns a boolean value.
        Specified by:
        getPrintWhenExpression in interface JRElement
      • getElementGroup

        public JRElementGroup getElementGroup()
        Description copied from interface: JRElement
        Indicates the logical group that the element belongs to. More elements can be grouped in order to make some of them stretch relative to the height of their parent group.
        Specified by:
        getElementGroup in interface JRElement
        See Also:
        StretchTypeEnum
      • isPrintWhenExpressionNull

        protected boolean isPrintWhenExpressionNull()
      • setPrintWhenExpressionNull

        protected void setPrintWhenExpressionNull​(boolean isPrintWhenExpressionNull)
      • isPrintWhenTrue

        protected boolean isPrintWhenTrue()
      • setPrintWhenTrue

        protected void setPrintWhenTrue​(boolean isPrintWhenTrue)
      • isToPrint

        public boolean isToPrint()
      • setToPrint

        protected void setToPrint​(boolean isToPrint)
      • isReprinted

        protected boolean isReprinted()
      • setReprinted

        protected void setReprinted​(boolean isReprinted)
      • isAlreadyPrinted

        public boolean isAlreadyPrinted()
      • setAlreadyPrinted

        public void setAlreadyPrinted​(boolean isAlreadyPrinted)
      • getGroupElements

        protected JRElement[] getGroupElements()
      • getDependantElements

        protected java.util.Collection<JRFillElement> getDependantElements()
      • addDependantElement

        protected void addDependantElement​(JRFillElement element)
      • getRelativeY

        protected int getRelativeY()
      • setRelativeY

        protected void setRelativeY​(int relativeY)
      • getCollapsedHeightAbove

        protected int getCollapsedHeightAbove()
      • setCollapsedHeightAbove

        protected void setCollapsedHeightAbove​(int collapsedHeightAbove)
      • getCollapsedHeightBelow

        protected int getCollapsedHeightBelow()
      • setCollapsedHeightBelow

        protected void setCollapsedHeightBelow​(int collapsedHeightBelow)
      • getStretchHeight

        public int getStretchHeight()
      • setStretchHeight

        protected void setStretchHeight​(int stretchHeight)
      • getPrepareHeight

        public int getPrepareHeight()
      • setPrepareHeight

        protected void setPrepareHeight​(int prepareHeight)
        Element height is calculated in two phases. First, the element stretches on its own during prepare, to accommodate all its content. This is the natural stretch and we keep track of the calculated height in prepareHeight. Secondly, the element stretches further in accordance with its stretchType property. This forced stretch occurs at a later time and the amount of stretch is kept in stretchHeight.
      • setBand

        protected void setBand​(JRFillBand band)
      • initStyleProviders

        protected void initStyleProviders()
      • reset

        protected void reset()
      • setCurrentEvaluation

        protected void setCurrentEvaluation​(byte evaluation)
      • getTimeZone

        protected java.util.TimeZone getTimeZone()
      • evaluatePrintWhenExpression

        protected void evaluatePrintWhenExpression​(byte evaluation)
                                            throws JRException
        Throws:
        JRException
      • createElementTemplate

        protected abstract JRTemplateElement createElementTemplate()
      • toPopulateTemplateStyle

        protected boolean toPopulateTemplateStyle()
      • prepare

        protected boolean prepare​(int availableHeight,
                                  boolean isOverflow)
                           throws JRException
        Throws:
        JRException
      • _stretchElement

        protected void _stretchElement​(int bandStretch)
        Deprecated.
        To be removed.
      • _stretchElementToHeight

        protected void _stretchElementToHeight​(int stretchHeight)
        Deprecated.
        To be removed.
      • stretchElement

        protected boolean stretchElement​(int containerStretch)
      • stretchElementToContainer

        protected boolean stretchElementToContainer​(int containerStretch)
      • stretchElementToElementGroup

        protected boolean stretchElementToElementGroup()
      • stretchElementToHeight

        protected boolean stretchElementToHeight​(int stretchHeight)
        This method returns a boolean signaling if any stretch change occurred. It does not say which amount of stretch was applied, but that is OK, because the only place where this is checked is during frame cascading stretch, where the stretchHeight field of the frame (set here) is used directly.
      • _moveDependantElements

        protected void _moveDependantElements()
        Deprecated.
        To be removed.
      • moveDependantElements

        protected void moveDependantElements()
      • resolveElement

        protected abstract void resolveElement​(JRPrintElement element,
                                               byte evaluation)
                                        throws JRException
        Resolves an element.
        Parameters:
        element - the element
        evaluation - the evaluation type
        Throws:
        JRException
      • delayedEvaluationUpdatesTemplate

        protected boolean delayedEvaluationUpdatesTemplate()
      • evaluateExpression

        public final java.lang.Object evaluateExpression​(JRExpression expression,
                                                         byte evaluation)
                                                  throws JRException
        Evaluates an expression.
        Parameters:
        expression - the expression
        evaluation - the evaluation type
        Returns:
        the evaluation result
        Throws:
        JRException
      • isValueRepeating

        protected boolean isValueRepeating()
        Decides whether the value for this element is repeating.

        Dynamic elements should call setValueRepeating(boolean) on evaluate(byte). Static elements don't have to do anything, this method will return true by default.

        Returns:
        whether the value for this element is repeating
        See Also:
        setValueRepeating(boolean)
      • setValueRepeating

        protected void setValueRepeating​(boolean isValueRepeating)
        Sets the repeating flag for this element.

        This method should be called by dynamic elements on evaluate(byte).

        Parameters:
        isValueRepeating - whether the value of the element is repeating
        See Also:
        isValueRepeating()
      • getVariable

        protected JRFillVariable getVariable​(java.lang.String variableName)
      • getField

        protected JRFillField getField​(java.lang.String fieldName)
      • resolveElement

        protected void resolveElement​(JRPrintElement element,
                                      byte evaluation,
                                      JREvaluationTime evaluationTime)
                               throws JRException
        Resolves an element.
        Parameters:
        element - the element
        evaluation - the evaluation type
        evaluationTime - the current evaluation time
        Throws:
        JRException
      • initDelayedEvaluations

        protected void initDelayedEvaluations()
      • collectDelayedEvaluations

        protected void collectDelayedEvaluations()
      • collectStyleDelayedEvaluations

        protected void collectStyleDelayedEvaluations()
      • collectDelayedEvaluations

        protected void collectDelayedEvaluations​(JRStyle style)
      • collectDelayedEvaluations

        protected void collectDelayedEvaluations​(JRExpression expression)
      • collectStyleProviderDelayedEvaluations

        protected void collectStyleProviderDelayedEvaluations()
      • setConditionalStylesContainer

        public void setConditionalStylesContainer​(JRFillElementContainer conditionalStylesContainer)
      • setShrinkable

        protected final void setShrinkable​(boolean shrinkable)
        Indicates whether an element is shrinkable.

        This flag is only effective when isRemoveLineWhenBlank is also set.

        Parameters:
        shrinkable - whether the element is shrinkable
      • stretchHeightFinal

        protected void stretchHeightFinal()
        Deprecated.
        To be removed.
        Called when the stretch height of an element is final so that the element can perform any adjustments.
      • isEvaluateNow

        protected boolean isEvaluateNow()
      • isAutoEvaluateNow

        protected boolean isAutoEvaluateNow()
      • isEvaluateAuto

        protected boolean isEvaluateAuto()
      • getStyleNameReference

        public java.lang.String getStyleNameReference()
        Description copied from interface: JRStyleContainer
        Returns the name of an external style which is to be used by this object.

        External styles are defined in templates and are resolved at fill time. This attribute is only effective if no direct style (as returned by getStyle() is specified for this object.

        Specified by:
        getStyleNameReference in interface JRStyleContainer
        Returns:
        the name of an external style
      • setStyle

        public void setStyle​(JRStyle style)
        Description copied from interface: JRStyleSetter
        Set the style on the object.

        In some cases, this method is invoked after the object has requested its style to be set.

        Specified by:
        setStyle in interface JRStyleSetter
        Parameters:
        style - the style to be used by the object
      • setStyleNameReference

        public void setStyleNameReference​(java.lang.String name)
        Description copied from interface: JRStyleSetter
        Set the name of an external style that is to be used by the object.
        Specified by:
        setStyleNameReference in interface JRStyleSetter
        Parameters:
        name - the name of an external style
      • clone

        public java.lang.Object clone()
        Specified by:
        clone in interface JRCloneable
        Overrides:
        clone in class java.lang.Object
      • hasProperties

        public boolean hasProperties()
        Description copied from interface: JRPropertiesHolder
        Checks whether the object has any properties.
        Specified by:
        hasProperties in interface JRPropertiesHolder
        Returns:
        whether the object has any properties
      • getPropertyExpressions

        public JRPropertyExpression[] getPropertyExpressions()
        Description copied from interface: JRElement
        Returns the list of dynamic/expression-based properties for this report element.
        Specified by:
        getPropertyExpressions in interface JRElement
        Returns:
        an array containing the expression-based properties of this report element
      • transferProperties

        protected void transferProperties​(JRTemplateElement template)
      • transferProperties

        protected void transferProperties​(JRPrintElement element)
      • getEvaluatedProperties

        protected JRPropertiesMap getEvaluatedProperties()
      • evaluateProperties

        protected void evaluateProperties​(byte evaluation)
                                   throws JRException
        Throws:
        JRException
      • setOriginProvider

        protected void setOriginProvider​(JROriginProvider originProvider)
      • getElementOrigin

        protected JROrigin getElementOrigin()
      • isDelayedStyleEvaluation

        protected boolean isDelayedStyleEvaluation()
      • getInitStyle

        protected JRStyle getInitStyle()
      • getParent

        protected JRElement getParent()
      • addDynamicProperty

        protected void addDynamicProperty​(java.lang.String name,
                                          JRExpression expression)
      • getBookmarkLevel

        public static java.lang.Integer getBookmarkLevel​(java.lang.Object value)
                                                  throws JRException
        Throws:
        JRException