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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_ELEMENT_GROUP
static String
PROPERTY_HEIGHT
static String
PROPERTY_KEY
static String
PROPERTY_PARENT_STYLE
static String
PROPERTY_PARENT_STYLE_NAME_REFERENCE
static String
PROPERTY_PRINT_WHEN_EXPRESSION
static String
PROPERTY_PRINT_WHEN_GROUP_CHANGES
static String
PROPERTY_PROPERTY_EXPRESSIONS
static String
PROPERTY_STYLE_EXPRESSION
static String
PROPERTY_Y
-
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, defaultStyleProvider, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, mode, parentStyle, parentStyleNameReference, positionType, 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, stretchType, styleExpression, uuid, width, x, y
-
Fields inherited from interface net.sf.jasperreports.engine.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRDesignElement(JRDefaultStyleProvider defaultStyleProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyExpression(JRPropertyExpression propertyExpression)
Add a dynamic/expression-based property.Object
clone()
JRPropertyExpression[]
getPropertyExpressions()
Returns the list of dynamic/expression-based properties for this report element.List<JRPropertyExpression>
getPropertyExpressionsList()
Returns the list of property expressions.JRPropertyExpression
removePropertyExpression(String name)
Remove a property expression.void
removePropertyExpression(JRPropertyExpression propertyExpression)
Remove a property expression.void
setElementGroup(JRElementGroup elementGroup)
Specifies the logical group that the element belongs to.void
setHeight(int height)
void
setKey(String key)
Sets the unique identifier for the element.void
setPrintWhenExpression(JRExpression expression)
Sets the print when expression.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.void
setStyle(JRStyle style)
void
setStyleExpression(JRExpression expression)
Sets the style expression.void
setStyleNameReference(String styleName)
Set the name of the external style to be used for this element.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, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getStretchType, getStyle, getStyleExpression, getStyleNameReference, getStyleResolver, getUUID, getWidth, getX, getY, hasProperties, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setUUID, 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.JRStyleContainer
getStyleName
-
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
-
-
-
-
Field Detail
-
PROPERTY_ELEMENT_GROUP
public static final String PROPERTY_ELEMENT_GROUP
- See Also:
- Constant Field Values
-
PROPERTY_HEIGHT
public static final String PROPERTY_HEIGHT
- See Also:
- Constant Field Values
-
PROPERTY_KEY
public static final String PROPERTY_KEY
- See Also:
- Constant Field Values
-
PROPERTY_PRINT_WHEN_EXPRESSION
public static final String PROPERTY_PRINT_WHEN_EXPRESSION
- See Also:
- Constant Field Values
-
PROPERTY_PRINT_WHEN_GROUP_CHANGES
public static final String PROPERTY_PRINT_WHEN_GROUP_CHANGES
- See Also:
- Constant Field Values
-
PROPERTY_PARENT_STYLE
public static final String PROPERTY_PARENT_STYLE
- See Also:
- Constant Field Values
-
PROPERTY_PARENT_STYLE_NAME_REFERENCE
public static final String PROPERTY_PARENT_STYLE_NAME_REFERENCE
- See Also:
- Constant Field Values
-
PROPERTY_STYLE_EXPRESSION
public static final String PROPERTY_STYLE_EXPRESSION
- See Also:
- Constant Field Values
-
PROPERTY_Y
public static final String PROPERTY_Y
- See Also:
- Constant Field Values
-
PROPERTY_PROPERTY_EXPRESSIONS
public static final String PROPERTY_PROPERTY_EXPRESSIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRDesignElement
protected JRDesignElement(JRDefaultStyleProvider defaultStyleProvider)
-
-
Method Detail
-
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:
StretchTypeEnum
-
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()
returnsnull
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()
-
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:
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(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:
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 interfaceJRElement
- Overrides:
getPropertyExpressions
in classJRBaseElement
- Returns:
- an array containing the expression-based properties of this report element
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classJRBaseElement
-
-