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 JRDefaultStyleProvider
defaultStyleProvider
protected JROrigin
origin
protected JRStyle
parentStyle
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRTemplateElement(String id)
protected
JRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTemplateHash(ObjectUtils.HashCode hash)
Color
getBackcolor()
protected JRStyle
getBaseStyle()
JRDefaultStyleProvider
getDefaultStyleProvider()
Color
getForecolor()
int
getHeight()
String
getId()
String
getKey()
Returns the string value that uniquely identifies the element.ModeEnum
getMode()
Returns the element transparency mode.JROrigin
getOrigin()
Color
getOwnBackcolor()
Color
getOwnForecolor()
ModeEnum
getOwnMode()
JRPropertiesHolder
getParentProperties()
Returns the parent properties holder, whose properties are used as defaults for this object.JRPropertiesMap
getPropertiesMap()
Returns this object's properties map.JRStyle
getStyle()
Returns this object's style.String
getStyleNameReference()
Returns null as external style references are not allowed for print objects.protected StyleResolver
getStyleResolver()
int
getWidth()
boolean
hasProperties()
Checks whether the object has any properties.void
populateStyle()
void
setBackcolor(Color backcolor)
void
setElement(JRElement element)
Copies basic element attributes: the element style, key, mode, forecolor and backcolor.void
setForecolor(Color forecolor)
void
setKey(String key)
void
setMode(ModeEnum mode)
Sets the element transparency mode.void
setStyle(JRStyle style)
Sets the template element style.protected boolean
templateIdentical(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
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getStyleName
-
-
-
-
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:
getDefaultStyleProvider
in interfaceJRStyleContainer
-
getStyleResolver
protected StyleResolver getStyleResolver()
-
getStyle
public JRStyle getStyle()
Description copied from interface:JRStyleContainer
Returns this object's style.- Specified by:
getStyle
in interfaceJRStyleContainer
- Returns:
- this object's style
-
getBaseStyle
protected JRStyle getBaseStyle()
-
getWidth
public int getWidth()
- Specified by:
getWidth
in interfaceJRCommonElement
-
getHeight
public int getHeight()
- Specified by:
getHeight
in interfaceJRCommonElement
-
getMode
public ModeEnum getMode()
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:
getMode
in interfaceJRCommonElement
-
getOwnMode
public ModeEnum getOwnMode()
- Specified by:
getOwnMode
in interfaceJRCommonElement
-
setMode
public void setMode(ModeEnum mode)
Description copied from interface:JRCommonElement
Sets the element transparency mode.- Specified by:
setMode
in interfaceJRCommonElement
-
getForecolor
public Color getForecolor()
- Specified by:
getForecolor
in interfaceJRCommonElement
-
getOwnForecolor
public Color getOwnForecolor()
- Specified by:
getOwnForecolor
in interfaceJRCommonElement
-
setForecolor
public void setForecolor(Color forecolor)
- Specified by:
setForecolor
in interfaceJRCommonElement
-
getBackcolor
public Color getBackcolor()
- Specified by:
getBackcolor
in interfaceJRCommonElement
-
getOwnBackcolor
public Color getOwnBackcolor()
- Specified by:
getOwnBackcolor
in interfaceJRCommonElement
-
setBackcolor
public void setBackcolor(Color backcolor)
- Specified by:
setBackcolor
in interfaceJRCommonElement
-
getId
public String getId()
-
getKey
public String getKey()
Description copied from interface:JRCommonElement
Returns the string value that uniquely identifies the element.- Specified by:
getKey
in 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:
getStyleNameReference
in interfaceJRStyleContainer
- Returns:
- the name of an external style
-
hasProperties
public boolean hasProperties()
Description copied from interface:JRPropertiesHolder
Checks whether the object has any properties.- Specified by:
hasProperties
in interfaceJRPropertiesHolder
- Returns:
- whether the object has any properties
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolder
Returns this object's properties map.- Specified by:
getPropertiesMap
in interfaceJRPropertiesHolder
- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder getParentProperties()
Description copied from interface:JRPropertiesHolder
Returns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentProperties
in interfaceJRPropertiesHolder
- Returns:
- the parent properties holder, or
null
if 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()
-
-