Package net.sf.jasperreports.engine
Class ElementDecorator
java.lang.Object
net.sf.jasperreports.engine.ElementDecorator
- All Implemented Interfaces:
Cloneable,JRChild,JRCloneable,JRCommonElement,JRElement,JRIdentifiable,JRPropertiesHolder,JRStyleContainer,JRVisitable
- Direct Known Subclasses:
SubreportElementAdapter
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Field Summary
Fields inherited from interface net.sf.jasperreports.engine.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()clone(JRElementGroup parentGroup) clone(JRElementGroup parentGroup, int y) voidcollectExpressions(JRExpressionCollector collector) Indicates the logical group that the element belongs to.intgetKey()Returns the string value that uniquely identifies the element.getMode()Returns the element transparency mode.Returns the parent properties holder, whose properties are used as defaults for this object.Returns the position type for the elementGets the expression that is evaluated in order to decide if the element should be displayed.Returns the group for which an element with a printRepeatedValues attribute set to true will be redisplayed even if the value has not changed.Returns this object's properties map.Returns the list of dynamic/expression-based properties for this report element.Indicates the stretch type for the elementgetStyle()Returns this object's style.Gets the expression that is evaluated in order to obtain the runtime style name to be used for the element.Returns the name of an external style which is to be used by this object.getUUID()intgetWidth()intgetX()Gets the the section relative horizontal offset of the element top left corner.intgetY()Gets the the section relative vertical offset of the element top left corner.booleanChecks whether the object has any properties.booleanReturns 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.booleanSpecifies if the element value will be printed for every iteration, even if its value has not changed.booleanIf this is set to true, the element will be reprinted on the next page if the band does not fit in the current page.booleanReturns true if the remaining blank space appearing when the value is not printed will be removed.voidsetBackcolor(Color backcolor) voidsetForecolor(Color forecolor) voidSets the element transparency mode.voidsetPositionType(PositionTypeEnum positionType) Sets the position type for the element.voidsetPrintInFirstWholeBand(boolean isPrintInFirstWholeBand) 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.voidsetPrintRepeatedValues(boolean isPrintRepeatedValues) voidsetPrintWhenDetailOverflows(boolean isPrintWhenDetailOverflows) 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.voidsetRemoveLineWhenBlank(boolean isRemoveLineWhenBlank) Specifies whether the remaining blank space appearing when the value is not printed will be removed.voidsetStretchType(StretchTypeEnum stretchTypeEnum) Specifies how the engine should treat a missing image.voidsetWidth(int width) voidsetX(int x) Sets the the section relative horizontal offset of the element top left corner.voidMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getStyleName
-
Constructor Details
-
ElementDecorator
-
-
Method Details
-
clone
- Specified by:
clonein interfaceJRCloneable- Overrides:
clonein classObject
-
collectExpressions
- Specified by:
collectExpressionsin interfaceJRElement
-
getElementGroup
Description copied from interface:JRElementIndicates 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:
getElementGroupin interfaceJRElement- See Also:
-
getUUID
- Specified by:
getUUIDin interfaceJRIdentifiable
-
getKey
Description copied from interface:JRCommonElementReturns the string value that uniquely identifies the element.- Specified by:
getKeyin interfaceJRCommonElement
-
getPositionType
Description copied from interface:JRElementReturns the position type for the element- Specified by:
getPositionTypein interfaceJRElement- Returns:
- the position type
-
getPrintWhenExpression
Description copied from interface:JRElementGets the expression that is evaluated in order to decide if the element should be displayed. This expression always returns a boolean value.- Specified by:
getPrintWhenExpressionin interfaceJRElement
-
getPrintWhenGroupChanges
Description copied from interface:JRElementReturns the group for which an element with a printRepeatedValues attribute set to true will be redisplayed even if the value has not changed.- Specified by:
getPrintWhenGroupChangesin interfaceJRElement- See Also:
-
getPropertyExpressions
Description copied from interface:JRElementReturns the list of dynamic/expression-based properties for this report element.- Specified by:
getPropertyExpressionsin interfaceJRElement- Returns:
- an array containing the expression-based properties of this report element
-
getStretchType
Description copied from interface:JRElementIndicates the stretch type for the element- Specified by:
getStretchTypein interfaceJRElement- Returns:
- a value representing one of the stretch type constants in
StretchTypeEnum
-
getX
public int getX()Description copied from interface:JRElementGets the the section relative horizontal offset of the element top left corner. -
getY
public int getY()Description copied from interface:JRElementGets the the section relative vertical offset of the element top left corner. -
isPrintInFirstWholeBand
public boolean isPrintInFirstWholeBand()Description copied from interface:JRElementReturns 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:
isPrintInFirstWholeBandin interfaceJRElement- See Also:
-
isPrintRepeatedValues
public boolean isPrintRepeatedValues()Description copied from interface:JRElementSpecifies if the element value will be printed for every iteration, even if its value has not changed.- Specified by:
isPrintRepeatedValuesin interfaceJRElement- See Also:
-
isPrintWhenDetailOverflows
public boolean isPrintWhenDetailOverflows()Description copied from interface:JRElementIf 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:
isPrintWhenDetailOverflowsin interfaceJRElement
-
isRemoveLineWhenBlank
public boolean isRemoveLineWhenBlank()Description copied from interface:JRElementReturns 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:
isRemoveLineWhenBlankin interfaceJRElement
-
setPositionType
Description copied from interface:JRElementSets the position type for the element.- Specified by:
setPositionTypein interfaceJRElement- Parameters:
positionType- the position type
-
setPrintInFirstWholeBand
public void setPrintInFirstWholeBand(boolean isPrintInFirstWholeBand) Description copied from interface:JRElementSpecifies 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:
setPrintInFirstWholeBandin interfaceJRElement- See Also:
-
setPrintRepeatedValues
public void setPrintRepeatedValues(boolean isPrintRepeatedValues) - Specified by:
setPrintRepeatedValuesin interfaceJRElement
-
setPrintWhenDetailOverflows
public void setPrintWhenDetailOverflows(boolean isPrintWhenDetailOverflows) Description copied from interface:JRElementIf 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:
setPrintWhenDetailOverflowsin interfaceJRElement
-
setRemoveLineWhenBlank
public void setRemoveLineWhenBlank(boolean isRemoveLineWhenBlank) Description copied from interface:JRElementSpecifies 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:
setRemoveLineWhenBlankin interfaceJRElement
-
setStretchType
Description copied from interface:JRElementSpecifies how the engine should treat a missing image.- Specified by:
setStretchTypein interfaceJRElement- Parameters:
stretchTypeEnum- a value representing one of the stretch type constants inStretchTypeEnum
-
setWidth
public void setWidth(int width) -
setX
public void setX(int x) Description copied from interface:JRElementSets the the section relative horizontal offset of the element top left corner. -
clone
-
clone
-
visit
- Specified by:
visitin interfaceJRVisitable
-
getBackcolor
- Specified by:
getBackcolorin interfaceJRCommonElement
-
getForecolor
- Specified by:
getForecolorin interfaceJRCommonElement
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceJRCommonElement
-
getMode
Description copied from interface:JRCommonElementReturns 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:
getModein interfaceJRCommonElement
-
getOwnBackcolor
- Specified by:
getOwnBackcolorin interfaceJRCommonElement
-
getOwnForecolor
- Specified by:
getOwnForecolorin interfaceJRCommonElement
-
getOwnMode
- Specified by:
getOwnModein interfaceJRCommonElement
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceJRCommonElement
-
setBackcolor
- Specified by:
setBackcolorin interfaceJRCommonElement
-
setForecolor
- Specified by:
setForecolorin interfaceJRCommonElement
-
setMode
Description copied from interface:JRCommonElementSets the element transparency mode.- Specified by:
setModein interfaceJRCommonElement
-
getDefaultStyleProvider
- Specified by:
getDefaultStyleProviderin interfaceJRStyleContainer
-
getStyle
Description copied from interface:JRStyleContainerReturns this object's style.- Specified by:
getStylein interfaceJRStyleContainer- Returns:
- this object's style
-
getStyleNameReference
Description copied from interface:JRStyleContainerReturns the name of an external style which is to be used by this object. External styles are defined intemplatesand are resolved at fill time. This attribute is only effective if no direct style (as returned bygetStyle()is specified for this object.- Specified by:
getStyleNameReferencein interfaceJRStyleContainer- Returns:
- the name of an external style
-
getStyleExpression
Description copied from interface:JRElementGets the expression that is evaluated in order to obtain the runtime style name to be used for the element. When used, this expression takes precedence over theJRStyleContainer.getStyle()orJRStyleContainer.getStyleNameReference().- Specified by:
getStyleExpressionin interfaceJRElement
-
getParentProperties
Description copied from interface:JRPropertiesHolderReturns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentPropertiesin interfaceJRPropertiesHolder- Returns:
- the parent properties holder, or
nullif no parent
-
getPropertiesMap
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Returns:
- this object's properties map
-
hasProperties
public boolean hasProperties()Description copied from interface:JRPropertiesHolderChecks whether the object has any properties.- Specified by:
hasPropertiesin interfaceJRPropertiesHolder- Returns:
- whether the object has any properties
-