net.sf.jasperreports.engine.fill

## Class JRTemplateElement

- java.lang.Object
- - net.sf.jasperreports.engine.fill.JRTemplateElement

- All Implemented Interfaces:
    java.io.Serializable, Deduplicable, 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, Deduplicable

  Base class consisting of print element information shared by multiple print elements.
  Version:
    $Id: JRTemplateElement.java 5985 2013-03-14 16:33:54Z lucianc $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JRDefaultStyleProvider` | `defaultStyleProvider`
    `protected JROrigin` | `origin`
    `protected JRStyle` | `parentStyle`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)`
    `protected` | `JRTemplateElement(JROrigin origin, JRElement element)`
    `protected` | `JRTemplateElement(java.lang.String id)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addTemplateHash(ObjectUtils.HashCode hash)`
    `java.awt.Color` | `getBackcolor()`
    `protected JRStyle` | `getBaseStyle()`
    `JRDefaultStyleProvider` | `getDefaultStyleProvider()`
    `java.awt.Color` | `getForecolor()`
    `int` | `getHeight()`
    `java.lang.String` | `getId()`
    `java.lang.String` | `getKey()` Returns the string value that uniquely identifies the element.
    `ModeEnum` | `getModeValue()` Returns the element transparency mode.
    `JROrigin` | `getOrigin()`
    `java.awt.Color` | `getOwnBackcolor()`
    `java.awt.Color` | `getOwnForecolor()`
    `ModeEnum` | `getOwnModeValue()`
    `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.
    `int` | `getWidth()`
    `boolean` | `hasProperties()` Checks whether the object has any properties.
    `void` | `setBackcolor(java.awt.Color backcolor)`
    `void` | `setElement(JRElement element)` Copies basic element attributes: the element style, key, mode, forecolor and backcolor.
    `void` | `setForecolor(java.awt.Color forecolor)`
    `void` | `setKey(java.lang.String key)`
    `void` | `setMode(ModeEnum modeValue)` 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`

- - ### 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()

    - #### getWidth

          public int getWidth()

      Specified by:
        `getWidth` in interface `JRCommonElement`

    - #### getHeight

          public int getHeight()

      Specified by:
        `getHeight` in interface `JRCommonElement`

    - #### getModeValue

          public ModeEnum getModeValue()

      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:
        `getModeValue` in interface `JRCommonElement`

    - #### getOwnModeValue

          public ModeEnum getOwnModeValue()

      Specified by:
        `getOwnModeValue` in interface `JRCommonElement`

    - #### setMode

          public void setMode(ModeEnum modeValue)

      Description copied from interface: `JRCommonElement`
      Sets the element transparency mode.
      Specified by:
        `setMode` in interface `JRCommonElement`

    - #### 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

          public void setForecolor(java.awt.Color forecolor)

      Specified by:
        `setForecolor` in interface `JRCommonElement`

    - #### 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

          public void setBackcolor(java.awt.Color backcolor)

      Specified by:
        `setBackcolor` in interface `JRCommonElement`

    - #### 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

    - #### addTemplateHash

          protected void addTemplateHash(ObjectUtils.HashCode hash)

    - #### templateIdentical

          protected boolean templateIdentical(JRTemplateElement template)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com