Package net.sf.jasperreports.engine.fill
Class JRTemplateElement
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRTemplateElement
-
- All Implemented Interfaces:
Serializable,Deduplicable,JRCommonElement,JRPropertiesHolder,JRStyleContainer
- Direct Known Subclasses:
JRTemplateFrame,JRTemplateGenericElement,JRTemplateGraphicElement,JRTemplateText,JRVirtualPrintPage.JRIdHolderTemplateElement
public abstract class JRTemplateElement extends Object implements JRCommonElement, Serializable, JRPropertiesHolder, Deduplicable
Base class consisting of print element information shared by multiple print elements.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JRDefaultStyleProviderdefaultStyleProviderprotected JROriginoriginprotected JRStyleparentStyle
-
Constructor Summary
Constructors Modifier Constructor Description protectedJRTemplateElement(String id)protectedJRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTemplateHash(ObjectUtils.HashCode hash)ColorgetBackcolor()protected JRStylegetBaseStyle()JRDefaultStyleProvidergetDefaultStyleProvider()ColorgetForecolor()intgetHeight()StringgetId()StringgetKey()Returns the string value that uniquely identifies the element.ModeEnumgetModeValue()Returns the element transparency mode.JROrigingetOrigin()ColorgetOwnBackcolor()ColorgetOwnForecolor()ModeEnumgetOwnModeValue()JRPropertiesHoldergetParentProperties()Returns the parent properties holder, whose properties are used as defaults for this object.JRPropertiesMapgetPropertiesMap()Returns this object's properties map.JRStylegetStyle()Returns this object's style.StringgetStyleNameReference()Returns null as external style references are not allowed for print objects.protected StyleResolvergetStyleResolver()intgetWidth()booleanhasProperties()Checks whether the object has any properties.voidpopulateStyle()voidsetBackcolor(Color backcolor)voidsetElement(JRElement element)Copies basic element attributes: the element style, key, mode, forecolor and backcolor.voidsetForecolor(Color forecolor)voidsetKey(String key)voidsetMode(ModeEnum modeValue)Sets the element transparency mode.voidsetStyle(JRStyle style)Sets the template element style.protected booleantemplateIdentical(JRTemplateElement template)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.Deduplicable
getHashCode, isIdentical
-
-
-
-
Field Detail
-
origin
protected JROrigin origin
-
defaultStyleProvider
protected JRDefaultStyleProvider defaultStyleProvider
-
parentStyle
protected JRStyle parentStyle
-
-
Constructor Detail
-
JRTemplateElement
protected JRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
-
JRTemplateElement
protected JRTemplateElement(String id)
-
-
Method Detail
-
setElement
public void setElement(JRElement element)
Copies basic element attributes: the element style, key, mode, forecolor and backcolor.- Parameters:
element- the element to copy attributes from
-
getOrigin
public JROrigin getOrigin()
-
getDefaultStyleProvider
public JRDefaultStyleProvider getDefaultStyleProvider()
- Specified by:
getDefaultStyleProviderin interfaceJRStyleContainer
-
getStyleResolver
protected StyleResolver getStyleResolver()
-
getStyle
public JRStyle getStyle()
Description copied from interface:JRStyleContainerReturns this object's style.- Specified by:
getStylein interfaceJRStyleContainer- Returns:
- this object's style
-
getBaseStyle
protected JRStyle getBaseStyle()
-
getWidth
public int getWidth()
- Specified by:
getWidthin interfaceJRCommonElement
-
getHeight
public int getHeight()
- Specified by:
getHeightin interfaceJRCommonElement
-
getModeValue
public ModeEnum getModeValue()
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:
getModeValuein interfaceJRCommonElement
-
getOwnModeValue
public ModeEnum getOwnModeValue()
- Specified by:
getOwnModeValuein interfaceJRCommonElement
-
setMode
public void setMode(ModeEnum modeValue)
Description copied from interface:JRCommonElementSets the element transparency mode.- Specified by:
setModein interfaceJRCommonElement
-
getForecolor
public Color getForecolor()
- Specified by:
getForecolorin interfaceJRCommonElement
-
getOwnForecolor
public Color getOwnForecolor()
- Specified by:
getOwnForecolorin interfaceJRCommonElement
-
setForecolor
public void setForecolor(Color forecolor)
- Specified by:
setForecolorin interfaceJRCommonElement
-
getBackcolor
public Color getBackcolor()
- Specified by:
getBackcolorin interfaceJRCommonElement
-
getOwnBackcolor
public Color getOwnBackcolor()
- Specified by:
getOwnBackcolorin interfaceJRCommonElement
-
setBackcolor
public void setBackcolor(Color backcolor)
- Specified by:
setBackcolorin interfaceJRCommonElement
-
getId
public String getId()
-
getKey
public String getKey()
Description copied from interface:JRCommonElementReturns the string value that uniquely identifies the element.- Specified by:
getKeyin interfaceJRCommonElement
-
setKey
public void setKey(String key)
-
getStyleNameReference
public String getStyleNameReference()
Returns null as external style references are not allowed for print objects.- Specified by:
getStyleNameReferencein interfaceJRStyleContainer- Returns:
- the name of an external style
-
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
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder 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
-
setStyle
public void setStyle(JRStyle style)
Sets the template element style.- Parameters:
style- the style
-
addTemplateHash
protected void addTemplateHash(ObjectUtils.HashCode hash)
-
templateIdentical
protected boolean templateIdentical(JRTemplateElement template)
-
populateStyle
public void populateStyle()
-
-