Package net.sf.jasperreports.engine.fill
Class JRFillComponentElement
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRFillElement
-
- net.sf.jasperreports.engine.fill.JRFillComponentElement
-
- All Implemented Interfaces:
Cloneable
,FillContext
,DynamicPropertiesHolder
,JRFillCloneable
,JRFillExpressionEvaluator
,JRChild
,JRCloneable
,JRCommonElement
,JRComponentElement
,JRElement
,JRIdentifiable
,JRPropertiesHolder
,JRStyleContainer
,JRStyleSetter
,JRVisitable
public class JRFillComponentElement extends JRFillElement implements JRComponentElement, FillContext
AJRComponentElement
which is used during report fill.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElement
band, conditionalStylesContainer, currentEvaluation, currentStyle, defaultPopulateTemplateStyle, defaultStyleProvider, delayedEvaluationsMap, dynamicProperties, dynamicTransferProperties, elementGroup, EXCEPTION_MESSAGE_KEY_INVALID_BOOKMARK_LEVEL, expressionEvaluator, exprStyle, fillContainerContext, filler, hasDynamicPopulateTemplateStyle, initStyle, mergedProperties, originProvider, parent, printElementOriginator, printWhenGroupChanges, propertyExpressions, providerStyle, staticProperties, staticTransferProperties, styleProviders, templates
-
Fields inherited from interface net.sf.jasperreports.engine.JRComponentElement
PROPERTY_COMPONENT_NAME
-
Fields inherited from interface net.sf.jasperreports.engine.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE
-
-
Constructor Summary
Constructors Constructor Description JRFillComponentElement(JRBaseFiller filler, JRComponentElement element, JRFillObjectFactory factory)
JRFillComponentElement(JRFillComponentElement element, JRFillCloneFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collectExpressions(JRExpressionCollector collector)
JRFillCloneable
createClone(JRFillCloneFactory factory)
Creates a working clone of itself.protected JRTemplateElement
createElementTemplate()
protected void
evaluate(byte evaluation)
Object
evaluate(JRExpression expression, byte evaluation)
Evaluates an expression in the main report dataset.protected JRPrintElement
fill()
Component
getComponent()
Returns the component instance wrapped by this element.JRComponentElement
getComponentElement()
Returns the component element that wraps the component.JROrigin
getElementOrigin()
Returns the origin of the current component element.int
getElementPrintY()
Returns the position on the vertical axis where the component element starts printing.int
getElementSourceId()
Returns the fill element Id associated to the component element.JRStyle
getElementStyle()
Returns the current style of the component element.FillContainerContext
getFillContainerContext()
JRFillDataset
getFillDataset()
Returns the dataset used by the expression evaluator.JRBaseFiller
getFiller()
Returns the filler object.JRComponentElement
getParent()
PrintElementOriginator
getPrintElementOriginator()
Returns a generator for print Ids for the component element.Locale
getReportLocale()
Returns the locale used to fill the current report.ResourceBundle
getReportResourceBundle()
Returns the resource bundle used for the current report.TimeZone
getReportTimezone()
Returns the time zone used to fill the current report.protected boolean
prepare(int availableHeight, boolean isOverflow)
void
registerDelayedEvaluation(JRPrintElement printElement, EvaluationTimeEnum evaluationTime, String evaluationGroup)
Registers a delayed evaluation for a print element.protected void
resolveElement(JRPrintElement element, byte evaluation)
Resolves an element.protected void
resolveElement(JRPrintElement element, byte evaluation, JREvaluationTime evaluationTime)
Resolves an element.protected void
rewind()
protected void
setBand(JRFillBand band)
void
setConditionalStylesContainer(JRFillElementContainer conditionalStylesContainer)
protected void
setStretchHeight(int stretchHeight)
void
visit(JRVisitor visitor)
-
Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElement
addDependantElement, addDynamicProperty, clone, clone, clone, collectDelayedEvaluations, collectDelayedEvaluations, collectDelayedEvaluations, collectStyleDelayedEvaluations, collectStyleProviderDelayedEvaluations, delayedEvaluate, delayedEvaluationUpdatesTemplate, evaluateExpression, evaluatePrintWhenExpression, evaluateProperties, evaluateStyle, getBackcolor, getBand, getBookmarkLevel, getCollapsedHeightAbove, getCollapsedHeightBelow, getConditionalStylesContainer, getDefaultStyleProvider, getDependantElements, getDynamicProperties, getElementGroup, getElementTemplate, getEvaluatedProperties, getEvaluationTime, getField, getForecolor, getGroupElements, getHeight, getInitStyle, getKey, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPositionType, getPrepareHeight, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getPropertyExpressions, getRelativeY, getStretchHeight, getStretchType, getStyle, getStyleExpression, getStyleNameReference, getStyleResolver, getTemplate, getTimeZone, getUUID, getVariable, getWidth, getX, getY, hasDynamicProperties, hasDynamicProperty, hasProperties, initDelayedEvaluationPrint, initDelayedEvaluations, initStyleProviders, isAlreadyPrinted, isAutoEvaluateNow, isDelayedStyleEvaluation, isEvaluateAuto, isEvaluateNow, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isPrintWhenExpressionNull, isPrintWhenTrue, isRemoveLineWhenBlank, isReprinted, isToPrint, isValueRepeating, moveDependantElements, performDelayedEvaluation, registerTemplate, reset, setAlreadyPrinted, setBackcolor, setCollapsedHeightAbove, setCollapsedHeightBelow, setCurrentEvaluation, setExpressionEvaluator, setForecolor, setHeight, setMode, setOriginProvider, setPositionType, setPrepareHeight, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setPrintWhenExpressionNull, setPrintWhenTrue, setRelativeY, setRemoveLineWhenBlank, setReprinted, setShrinkable, setStretchType, setStyle, setStyleNameReference, setToPrint, setValueRepeating, setWidth, setX, setY, stretchElement, stretchElementToContainer, stretchElementToElementGroup, stretchElementToHeight, toPopulateTemplateStyle, transferProperties, transferProperties
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.component.FillContext
getDefaultStyleProvider
-
Methods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getKey, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, getElementGroup, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchType, getStyleExpression, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
-
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
-
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleName, getStyleNameReference
-
-
-
-
Constructor Detail
-
JRFillComponentElement
public JRFillComponentElement(JRBaseFiller filler, JRComponentElement element, JRFillObjectFactory factory)
-
JRFillComponentElement
public JRFillComponentElement(JRFillComponentElement element, JRFillCloneFactory factory)
-
-
Method Detail
-
setBand
protected void setBand(JRFillBand band)
- Overrides:
setBand
in classJRFillElement
-
evaluate
protected void evaluate(byte evaluation) throws JRException
- Specified by:
evaluate
in classJRFillElement
- Throws:
JRException
-
prepare
protected boolean prepare(int availableHeight, boolean isOverflow) throws JRException
- Overrides:
prepare
in classJRFillElement
- Throws:
JRException
-
setStretchHeight
protected void setStretchHeight(int stretchHeight)
- Overrides:
setStretchHeight
in classJRFillElement
-
setConditionalStylesContainer
public void setConditionalStylesContainer(JRFillElementContainer conditionalStylesContainer)
- Overrides:
setConditionalStylesContainer
in classJRFillElement
-
fill
protected JRPrintElement fill() throws JRException
- Specified by:
fill
in classJRFillElement
- Throws:
JRException
-
createElementTemplate
protected JRTemplateElement createElementTemplate()
- Specified by:
createElementTemplate
in classJRFillElement
-
resolveElement
protected void resolveElement(JRPrintElement element, byte evaluation, JREvaluationTime evaluationTime) throws JRException
Description copied from class:JRFillElement
Resolves an element.- Overrides:
resolveElement
in classJRFillElement
- Parameters:
element
- the elementevaluation
- the evaluation typeevaluationTime
- the current evaluation time- Throws:
JRException
-
resolveElement
protected void resolveElement(JRPrintElement element, byte evaluation) throws JRException
Description copied from class:JRFillElement
Resolves an element.- Specified by:
resolveElement
in classJRFillElement
- Parameters:
element
- the elementevaluation
- the evaluation type- Throws:
JRException
-
rewind
protected void rewind() throws JRException
- Specified by:
rewind
in classJRFillElement
- Throws:
JRException
-
collectExpressions
public void collectExpressions(JRExpressionCollector collector)
- Specified by:
collectExpressions
in interfaceJRElement
-
visit
public void visit(JRVisitor visitor)
- Specified by:
visit
in interfaceJRVisitable
-
createClone
public JRFillCloneable createClone(JRFillCloneFactory factory)
Description copied from interface:JRFillCloneable
Creates a working clone of itself.- Specified by:
createClone
in interfaceJRFillCloneable
- Parameters:
factory
- the clone factory to use while creating the clone- Returns:
- a working clone of itself
-
getParent
public JRComponentElement getParent()
- Overrides:
getParent
in classJRFillElement
-
getComponent
public Component getComponent()
Description copied from interface:JRComponentElement
Returns the component instance wrapped by this element.- Specified by:
getComponent
in interfaceJRComponentElement
- Returns:
- the component instance
-
evaluate
public Object evaluate(JRExpression expression, byte evaluation) throws JRException
Description copied from interface:FillContext
Evaluates an expression in the main report dataset.- Specified by:
evaluate
in interfaceFillContext
- Specified by:
evaluate
in interfaceJRFillExpressionEvaluator
- Parameters:
expression
- the expression to evaluateevaluation
- the evaluation type; usually directly passed fromFillComponent.evaluate(byte)
- Returns:
- the result of the evaluation
- Throws:
JRException
-
getFillDataset
public JRFillDataset getFillDataset()
Description copied from interface:JRFillExpressionEvaluator
Returns the dataset used by the expression evaluator.- Specified by:
getFillDataset
in interfaceJRFillExpressionEvaluator
-
getComponentElement
public JRComponentElement getComponentElement()
Description copied from interface:FillContext
Returns the component element that wraps the component.- Specified by:
getComponentElement
in interfaceFillContext
- Returns:
- the current component element
-
getElementSourceId
public int getElementSourceId()
Description copied from interface:FillContext
Returns the fill element Id associated to the component element.- Specified by:
getElementSourceId
in interfaceFillContext
- Returns:
- the Id of the component fill element
- See Also:
JRPrintElement.getSourceElementId()
,FillContext.getPrintElementOriginator()
-
getPrintElementOriginator
public PrintElementOriginator getPrintElementOriginator()
Description copied from interface:FillContext
Returns a generator for print Ids for the component element.- Specified by:
getPrintElementOriginator
in interfaceFillContext
- Returns:
- a generator for print Ids
- See Also:
JRPrintElement.getSourceElementId()
,JRPrintElement.getPrintElementId()
-
getElementOrigin
public JROrigin getElementOrigin()
Description copied from interface:FillContext
Returns the origin of the current component element.- Specified by:
getElementOrigin
in interfaceFillContext
- Overrides:
getElementOrigin
in classJRFillElement
- Returns:
- the origin of the component element
-
getElementPrintY
public int getElementPrintY()
Description copied from interface:FillContext
Returns the position on the vertical axis where the component element starts printing.- Specified by:
getElementPrintY
in interfaceFillContext
- Returns:
- the position on the vertical axis of the component element
-
getElementStyle
public JRStyle getElementStyle()
Description copied from interface:FillContext
Returns the current style of the component element.- Specified by:
getElementStyle
in interfaceFillContext
- Returns:
- the current style of the component element
-
registerDelayedEvaluation
public void registerDelayedEvaluation(JRPrintElement printElement, EvaluationTimeEnum evaluationTime, String evaluationGroup)
Description copied from interface:FillContext
Registers a delayed evaluation for a print element.- Specified by:
registerDelayedEvaluation
in interfaceFillContext
- Parameters:
printElement
- the print elementevaluationTime
- the delayed evaluation time; one ofevaluationGroup
- the evaluation group name, ifevaluationTime
isEvaluationTimeEnum.GROUP
- See Also:
FillComponent.evaluateDelayedElement(JRPrintElement, byte)
-
getReportLocale
public Locale getReportLocale()
Description copied from interface:FillContext
Returns the locale used to fill the current report.- Specified by:
getReportLocale
in interfaceFillContext
- Returns:
- the report locale
- See Also:
JRParameter.REPORT_LOCALE
-
getReportResourceBundle
public ResourceBundle getReportResourceBundle()
Description copied from interface:FillContext
Returns the resource bundle used for the current report.- Specified by:
getReportResourceBundle
in interfaceFillContext
- Returns:
- the report resource bundle
- See Also:
JRReport.getResourceBundle()
,JRParameter.REPORT_RESOURCE_BUNDLE
-
getReportTimezone
public TimeZone getReportTimezone()
Description copied from interface:FillContext
Returns the time zone used to fill the current report.- Specified by:
getReportTimezone
in interfaceFillContext
- Returns:
- the report time zone
- See Also:
JRParameter.REPORT_TIME_ZONE
-
getFiller
public JRBaseFiller getFiller()
Description copied from interface:FillContext
Returns the filler object.- Specified by:
getFiller
in interfaceFillContext
- Overrides:
getFiller
in classJRFillElement
- Returns:
- the filler object
-
getFillContainerContext
public FillContainerContext getFillContainerContext()
- Specified by:
getFillContainerContext
in interfaceFillContext
-
-