net.sf.jasperreports.engine.fill
Class JRTemplateElement

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JRTemplateElement
All Implemented Interfaces:
java.io.Serializable, JRCommonElement, JRPropertiesHolder, JRStyleContainer
Direct Known Subclasses:
JRTemplateFrame, JRTemplateGenericElement, JRTemplateGraphicElement, JRTemplateText, JRVirtualPrintPage.JRIdHolderTemplateElement

public abstract class JRTemplateElement
extends java.lang.Object
implements JRCommonElement, java.io.Serializable, JRPropertiesHolder

Base class consisting of print element information shared by multiple print elements.

Version:
$Id: JRTemplateElement.java 3034 2009-08-27 11:58:04Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  JRDefaultStyleProvider defaultStyleProvider
           
protected  JROrigin origin
           
protected  JRStyle parentStyle
           
 
Constructor Summary
protected JRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
           
protected JRTemplateElement(JROrigin origin, JRElement element)
           
protected JRTemplateElement(java.lang.String id)
           
 
Method Summary
 java.awt.Color getBackcolor()
           
protected  JRStyle getBaseStyle()
           
 JRDefaultStyleProvider getDefaultStyleProvider()
           
 java.awt.Color getForecolor()
           
 java.lang.String getId()
           
 java.lang.String getKey()
          Returns the string value that uniquely identifies the element.
 byte getMode()
          Returns the element transparency mode.
 JROrigin getOrigin()
           
 java.awt.Color getOwnBackcolor()
           
 java.awt.Color getOwnForecolor()
           
 java.lang.Byte 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.
 java.lang.String getStyleNameReference()
          Returns null as external style references are not allowed for print objects.
 boolean hasProperties()
          Checks whether the object has any properties.
protected  void setBackcolor(java.awt.Color backcolor)
           
 void setElement(JRElement element)
          Copies basic element attributes: the element style, key, mode, forecolor and backcolor.
protected  void setForecolor(java.awt.Color forecolor)
           
 void setKey(java.lang.String key)
           
protected  void setMode(byte mode)
           
protected  void setMode(java.lang.Byte mode)
           
 void setStyle(JRStyle style)
          Sets the template element style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(JROrigin origin,
                            JRElement element)

JRTemplateElement

protected JRTemplateElement(java.lang.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 interface JRStyleContainer

getStyle

public JRStyle getStyle()
Description copied from interface: JRStyleContainer
Returns this object's style.

Specified by:
getStyle in interface JRStyleContainer
Returns:
this object's style

getBaseStyle

protected JRStyle getBaseStyle()

getMode

public byte 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 interface JRCommonElement
Returns:
MODE_OPAQUE or MODE_TRANSPARENT

getOwnMode

public java.lang.Byte getOwnMode()
Specified by:
getOwnMode in interface JRCommonElement

setMode

protected void setMode(byte mode)

setMode

protected void setMode(java.lang.Byte mode)

getForecolor

public java.awt.Color getForecolor()
Specified by:
getForecolor in interface JRCommonElement

getOwnForecolor

public java.awt.Color getOwnForecolor()
Specified by:
getOwnForecolor in interface JRCommonElement

setForecolor

protected void setForecolor(java.awt.Color forecolor)

getBackcolor

public java.awt.Color getBackcolor()
Specified by:
getBackcolor in interface JRCommonElement

getOwnBackcolor

public java.awt.Color getOwnBackcolor()
Specified by:
getOwnBackcolor in interface JRCommonElement

setBackcolor

protected void setBackcolor(java.awt.Color backcolor)

getId

public java.lang.String getId()

getKey

public java.lang.String getKey()
Description copied from interface: JRCommonElement
Returns the string value that uniquely identifies the element.

Specified by:
getKey in interface JRCommonElement

setKey

public void setKey(java.lang.String key)

getStyleNameReference

public java.lang.String getStyleNameReference()
Returns null as external style references are not allowed for print objects.

Specified by:
getStyleNameReference in interface JRStyleContainer
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 interface JRPropertiesHolder
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 interface JRPropertiesHolder
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 interface JRPropertiesHolder
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


© 2001-2009 Jaspersoft Corporation www.jaspersoft.com