Package net.sf.jasperreports.engine.fill
Class JRFillElementContainer
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRFillElementGroup
-
- net.sf.jasperreports.engine.fill.JRFillElementContainer
-
- All Implemented Interfaces:
Cloneable
,FillContainerContext
,JRFillCloneable
,JRChild
,JRCloneable
,JRElementGroup
,JRVisitable
- Direct Known Subclasses:
FillListContents
,JRFillBand
,JRFillCellContents
,JRFillFrame.JRFillFrameElements
public abstract class JRFillElementContainer extends JRFillElementGroup implements FillContainerContext
Abstract implementation of an element container filler.This is the base for band, frame and crosstab cell fillers.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
atLeastOneElementIsToPrint
protected boolean
currentOverflowWithElements
protected boolean
currentOverflowWithWhiteSpace
protected JRFillElement[]
deepElements
protected Map<JRStyle,JRStyle>
evaluatedStyles
protected JRFillExpressionEvaluator
expressionEvaluator
protected JRBaseFiller
filler
protected boolean
hasPrintWhenOverflowElement
protected boolean
isOverflow
protected Set<JRStyle>
stylesToEvaluate
protected boolean
willOverflowWithElements
protected boolean
willOverflowWithWhiteSpace
-
Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElementGroup
bottomElementInGroup, children, elementGroup, elements, topElementInGroup
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRFillElementContainer(JRBaseFiller filler, JRElementGroup container, JRFillObjectFactory factory)
protected
JRFillElementContainer(JRFillElementContainer container, JRFillCloneFactory factory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addSubElements(JRPrintElementContainer printContainer, JRFillElement element, Collection<? extends JRPrintElement> printElements)
protected boolean
buildConsolidatedStyle(JRStyle style, byte evaluation, StringBuilder code, List<JRStyle> condStylesToApply)
protected int
calculateStretchHeight()
protected void
collectConditionalStyle(JRStyle style)
protected void
evaluate(byte evaluation)
protected JRStyle
evaluateConditionalStyle(JRStyle initialStyle, byte evaluation)
protected void
evaluateConditionalStyles(byte evaluation)
void
fillElements(JRPrintElementContainer printContainer)
Fills the elements from this container into a print element container.protected abstract int
getActualContainerHeight()
Returns the actual height of the element container.protected abstract int
getContainerHeight()
Returns the height of the element container.JRStyle
getEvaluatedConditionalStyle(JRStyle parentStyle)
protected int
getFirstY()
protected int
getStretchHeight()
protected void
initConditionalStyles()
Find all styles containing conditional styles which are referenced by elements in this band.protected void
initDeepElements()
protected void
initElements()
protected void
initFill()
boolean
isCurrentOverflow()
boolean
isCurrentOverflowAllowed()
protected void
moveBandBottomElements()
protected void
prepareElements(int availableHeight, boolean isOverflowAllowed)
protected void
prepareStretchHeight(int availableHeight, boolean isOverflowAllowed)
protected void
removeBlankElements()
protected void
resetElements()
protected void
rewind()
protected void
setElementOriginProvider(JROriginProvider originProvider)
protected void
setStretchHeight(int stretchHeight)
protected void
stretchElementsToContainer()
protected void
stretchElementsToElementGroup()
boolean
willOverflow()
Indicates whether the elements in this container will overflow.-
Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElementGroup
clone, clone, createClone, getChildren, getElementByKey, getElementGroup, getElements, getStretchHeightDiff, reset, visit
-
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.fill.FillContainerContext
isSplitTypePreventInhibited
-
-
-
-
Field Detail
-
filler
protected JRBaseFiller filler
-
willOverflowWithElements
protected boolean willOverflowWithElements
-
willOverflowWithWhiteSpace
protected boolean willOverflowWithWhiteSpace
-
isOverflow
protected boolean isOverflow
-
currentOverflowWithElements
protected boolean currentOverflowWithElements
-
currentOverflowWithWhiteSpace
protected boolean currentOverflowWithWhiteSpace
-
atLeastOneElementIsToPrint
protected boolean atLeastOneElementIsToPrint
-
expressionEvaluator
protected final JRFillExpressionEvaluator expressionEvaluator
-
deepElements
protected JRFillElement[] deepElements
-
hasPrintWhenOverflowElement
protected boolean hasPrintWhenOverflowElement
-
-
Constructor Detail
-
JRFillElementContainer
protected JRFillElementContainer(JRBaseFiller filler, JRElementGroup container, JRFillObjectFactory factory)
-
JRFillElementContainer
protected JRFillElementContainer(JRFillElementContainer container, JRFillCloneFactory factory)
-
-
Method Detail
-
initDeepElements
protected void initDeepElements()
-
initElements
protected final void initElements()
-
evaluate
protected void evaluate(byte evaluation) throws JRException
- Throws:
JRException
-
resetElements
protected void resetElements()
-
willOverflow
public boolean willOverflow()
Indicates whether the elements in this container will overflow.- Returns:
- whether this container will overflow
-
initFill
protected void initFill()
-
prepareElements
protected void prepareElements(int availableHeight, boolean isOverflowAllowed) throws JRException
- Throws:
JRException
-
prepareStretchHeight
protected void prepareStretchHeight(int availableHeight, boolean isOverflowAllowed) throws JRException
- Throws:
JRException
-
calculateStretchHeight
protected int calculateStretchHeight() throws JRException
- Throws:
JRException
-
isCurrentOverflow
public boolean isCurrentOverflow()
- Specified by:
isCurrentOverflow
in interfaceFillContainerContext
-
isCurrentOverflowAllowed
public boolean isCurrentOverflowAllowed()
- Specified by:
isCurrentOverflowAllowed
in interfaceFillContainerContext
-
setStretchHeight
protected void setStretchHeight(int stretchHeight)
-
stretchElementsToElementGroup
protected void stretchElementsToElementGroup()
-
stretchElementsToContainer
protected void stretchElementsToContainer()
-
getStretchHeight
protected int getStretchHeight()
-
moveBandBottomElements
protected void moveBandBottomElements()
-
removeBlankElements
protected void removeBlankElements()
-
fillElements
public void fillElements(JRPrintElementContainer printContainer) throws JRException
Fills the elements from this container into a print element container.- Parameters:
printContainer
- the print element container- Throws:
JRException
-
addSubElements
protected void addSubElements(JRPrintElementContainer printContainer, JRFillElement element, Collection<? extends JRPrintElement> printElements)
-
rewind
protected void rewind() throws JRException
- Throws:
JRException
-
getFirstY
protected int getFirstY()
-
getActualContainerHeight
protected abstract int getActualContainerHeight()
Returns the actual height of the element container. Some element containers such as frames have a larger calculated container height, resulting from content being placed beyond container declared height.- Returns:
- the height of the element container
-
getContainerHeight
protected abstract int getContainerHeight()
Returns the height of the element container.- Returns:
- the height of the element container
-
initConditionalStyles
protected void initConditionalStyles()
Find all styles containing conditional styles which are referenced by elements in this band.
-
collectConditionalStyle
protected void collectConditionalStyle(JRStyle style)
-
evaluateConditionalStyles
protected void evaluateConditionalStyles(byte evaluation) throws JRException
- Throws:
JRException
-
evaluateConditionalStyle
protected JRStyle evaluateConditionalStyle(JRStyle initialStyle, byte evaluation) throws JRException
- Throws:
JRException
-
buildConsolidatedStyle
protected boolean buildConsolidatedStyle(JRStyle style, byte evaluation, StringBuilder code, List<JRStyle> condStylesToApply) throws JRException
- Throws:
JRException
-
setElementOriginProvider
protected final void setElementOriginProvider(JROriginProvider originProvider)
-
-