net.sf.jasperreports.engine.design
Class JRDesignElement

java.lang.Object
  extended by net.sf.jasperreports.engine.base.JRBaseElement
      extended by net.sf.jasperreports.engine.design.JRDesignElement
All Implemented Interfaces:
java.io.Serializable, java.lang.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.

Version:
$Id: JRDesignElement.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
static java.lang.String PROPERTY_ELEMENT_GROUP
           
static java.lang.String PROPERTY_HEIGHT
           
static java.lang.String PROPERTY_KEY
           
static java.lang.String PROPERTY_PARENT_STYLE
           
static java.lang.String PROPERTY_PARENT_STYLE_NAME_REFERENCE
           
static java.lang.String PROPERTY_PRINT_WHEN_EXPRESSION
           
static java.lang.String PROPERTY_PRINT_WHEN_GROUP_CHANGES
           
static java.lang.String PROPERTY_PROPERTY_EXPRESSIONS
           
static java.lang.String PROPERTY_Y
           
 
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, defaultStyleProvider, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, modeValue, parentStyle, parentStyleNameReference, positionTypeValue, printWhenExpression, printWhenGroupChanges, PROPERTY_POSITION_TYPE, PROPERTY_PRINT_IN_FIRST_WHOLE_BAND, PROPERTY_PRINT_REPEATED_VALUES, PROPERTY_PRINT_WHEN_DETAIL_OVERFLOWS, PROPERTY_REMOVE_LINE_WHEN_BLANK, PROPERTY_STRETCH_TYPE, PROPERTY_WIDTH, PROPERTY_X, stretchTypeValue, uuid, width, x, y
 
Constructor Summary
protected JRDesignElement(JRDefaultStyleProvider defaultStyleProvider)
           
 
Method Summary
 void addPropertyExpression(JRPropertyExpression propertyExpression)
          Add a dynamic/expression-based property.
 JRPropertyExpression[] getPropertyExpressions()
          Returns the list of dynamic/expression-based properties for this report element.
 java.util.List<JRPropertyExpression> getPropertyExpressionsList()
          Returns the list of property expressions.
 void removePropertyExpression(JRPropertyExpression propertyExpression)
          Remove a property expression.
 JRPropertyExpression removePropertyExpression(java.lang.String name)
          Remove a property expression.
 void setElementGroup(JRElementGroup elementGroup)
          Specifies the logical group that the element belongs to.
 void setHeight(int height)
           
 void setKey(java.lang.String key)
          Sets the unique identifier for the element.
 void setPrintWhenExpression(JRExpression expression)
          Sets the print when expression.
 void setPrintWhenGroupChanges(JRGroup 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.
 void setStyle(JRStyle style)
           
 void setStyleNameReference(java.lang.String styleName)
          Set the name of the external style to be used for this element.
 void setUUID(java.util.UUID uuid)
           
 void setY(int y)
          Sets the vertical section relative offset for the element.
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
clone, clone, getBackcolor, getBaseStyle, getDefaultStyleProvider, getElementGroup, getEventSupport, getForecolor, getHeight, getKey, getModeValue, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getStretchTypeValue, getStyle, getStyleNameReference, getUUID, getWidth, getX, getY, hasProperties, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jasperreports.engine.JRElement
collectExpressions
 
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
 

Field Detail

PROPERTY_ELEMENT_GROUP

public static final java.lang.String PROPERTY_ELEMENT_GROUP
See Also:
Constant Field Values

PROPERTY_HEIGHT

public static final java.lang.String PROPERTY_HEIGHT
See Also:
Constant Field Values

PROPERTY_KEY

public static final java.lang.String PROPERTY_KEY
See Also:
Constant Field Values

PROPERTY_PRINT_WHEN_EXPRESSION

public static final java.lang.String PROPERTY_PRINT_WHEN_EXPRESSION
See Also:
Constant Field Values

PROPERTY_PRINT_WHEN_GROUP_CHANGES

public static final java.lang.String PROPERTY_PRINT_WHEN_GROUP_CHANGES
See Also:
Constant Field Values

PROPERTY_PARENT_STYLE

public static final java.lang.String PROPERTY_PARENT_STYLE
See Also:
Constant Field Values

PROPERTY_PARENT_STYLE_NAME_REFERENCE

public static final java.lang.String PROPERTY_PARENT_STYLE_NAME_REFERENCE
See Also:
Constant Field Values

PROPERTY_Y

public static final java.lang.String PROPERTY_Y
See Also:
Constant Field Values

PROPERTY_PROPERTY_EXPRESSIONS

public static final java.lang.String PROPERTY_PROPERTY_EXPRESSIONS
See Also:
Constant Field Values
Constructor Detail

JRDesignElement

protected JRDesignElement(JRDefaultStyleProvider defaultStyleProvider)
Method Detail

setUUID

public void setUUID(java.util.UUID uuid)

setKey

public void setKey(java.lang.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(JRGroup 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 get the height of the tallest one.

See Also:
StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT

setStyle

public void setStyle(JRStyle style)

setStyleNameReference

public void setStyleNameReference(java.lang.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:
JRBaseElement.getStyleNameReference()

addPropertyExpression

public void addPropertyExpression(JRPropertyExpression propertyExpression)
Add a dynamic/expression-based property.

Parameters:
propertyExpression - the property to add
See Also:
getPropertyExpressions()

removePropertyExpression

public void removePropertyExpression(JRPropertyExpression propertyExpression)
Remove a property expression.

Parameters:
propertyExpression - the property expression to remove
See Also:
addPropertyExpression(JRPropertyExpression)

removePropertyExpression

public JRPropertyExpression removePropertyExpression(java.lang.String name)
Remove a property expression.

Parameters:
name - the name of the property to remove
Returns:
the removed property expression (if found)

getPropertyExpressionsList

public java.util.List<JRPropertyExpression> getPropertyExpressionsList()
Returns the list of property expressions.

Returns:
the list of property expressions (JRPropertyExpression instances)
See Also:
addPropertyExpression(JRPropertyExpression)

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


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com