Class JRDesignElement

java.lang.Object
net.sf.jasperreports.engine.base.JRBaseElement
net.sf.jasperreports.engine.design.JRDesignElement
All Implemented Interfaces:
Serializable, Cloneable, JRChangeEventsSupport, JRChild, JRCloneable, JRCommonElement, JRElement, JRIdentifiable, JRPropertiesHolder, JRStyleContainer, JRVisitable
Direct Known Subclasses:
JRDesignBreak, JRDesignChart, JRDesignComponentElement, JRDesignCrosstab, JRDesignFrame, JRDesignGenericElement, JRDesignGraphicElement, JRDesignSubreport, JRDesignTextElement

public abstract class JRDesignElement extends JRBaseElement
This class provides a skeleton implementation for a design time report element. The difference between design elements and compiled elements is that at design time they are more customizable. This class contains setters for properties that can be only modified at design time.
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • setKey

      public void setKey(String key)
      Sets the unique identifier for the element.
    • setY

      public void setY(int y)
      Sets the vertical section relative offset for the element.
    • setHeight

      public void setHeight(int height)
    • setPrintWhenExpression

      public void setPrintWhenExpression(JRExpression expression)
      Sets the print when expression. This expression must always return an instance of Boolean and its value will decide if the element will be displayed.
    • setPrintWhenGroupChanges

      public void setPrintWhenGroupChanges(String group)
      Specifies the group for which an element with a printRepeatedValues attribute set to true will be redisplayed even if the value has not changed.
    • setElementGroup

      public void setElementGroup(JRElementGroup elementGroup)
      Specifies 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.
      See Also:
    • setStyle

      public void setStyle(JRStyle style)
    • setStyleNameReference

      public void setStyleNameReference(String styleName)
      Set the name of the external style to be used for this element.

      An external style is only effective when there is no internal style set for this element, i.e. getStyle() returns null The external style will be resolved at fill time from the templates used in the report.

      Parameters:
      styleName - the name of the external style
      See Also:
    • setStyleExpression

      public void setStyleExpression(JRExpression expression)
      Sets the style expression. This expression must always return a String value representing the name of the style.
    • addPropertyExpression

      public void addPropertyExpression(JRPropertyExpression propertyExpression)
      Add a dynamic/expression-based property.
      Parameters:
      propertyExpression - the property to add
      See Also:
    • removePropertyExpression

      public void removePropertyExpression(JRPropertyExpression propertyExpression)
      Remove a property expression.
      Parameters:
      propertyExpression - the property expression to remove
      See Also:
    • removePropertyExpression

      public JRPropertyExpression removePropertyExpression(String name)
      Remove a property expression.
      Parameters:
      name - the name of the property to remove
      Returns:
      the removed property expression (if found)
    • getPropertyExpressionsList

      public List<JRPropertyExpression> getPropertyExpressionsList()
      Returns the list of property expressions.
      Returns:
      the list of property expressions (JRPropertyExpression instances)
      See Also:
    • getPropertyExpressions

      public JRPropertyExpression[] getPropertyExpressions()
      Description copied from interface: JRElement
      Returns the list of dynamic/expression-based properties for this report element.
      Specified by:
      getPropertyExpressions in interface JRElement
      Overrides:
      getPropertyExpressions in class JRBaseElement
      Returns:
      an array containing the expression-based properties of this report element
    • clone

      public Object clone()
      Specified by:
      clone in interface JRCloneable
      Overrides:
      clone in class JRBaseElement