net.sf.jasperreports.engine
Interface JRElement

All Superinterfaces:
java.lang.Cloneable, JRChild, JRCloneable, JRCommonElement, JRPropertiesHolder, JRStyleContainer, JRVisitable
All Known Subinterfaces:
JRBreak, JRChart, JRComponentElement, JRCrosstab, JREllipse, JRFrame, JRGenericElement, JRGraphicElement, JRImage, JRLine, JRRectangle, JRStaticText, JRSubreport, JRTextElement, JRTextField
All Known Implementing Classes:
ElementDecorator, FillTableSubreport, JRBaseBreak, JRBaseChart, JRBaseComponentElement, JRBaseCrosstab, JRBaseElement, JRBaseEllipse, JRBaseFrame, JRBaseGenericElement, JRBaseGraphicElement, JRBaseImage, JRBaseLine, JRBaseRectangle, JRBaseStaticText, JRBaseSubreport, JRBaseTextElement, JRBaseTextField, JRDesignBreak, JRDesignChart, JRDesignComponentElement, JRDesignCrosstab, JRDesignElement, JRDesignEllipse, JRDesignFrame, JRDesignGenericElement, JRDesignGraphicElement, JRDesignImage, JRDesignLine, JRDesignRectangle, JRDesignStaticText, JRDesignSubreport, JRDesignTextElement, JRDesignTextField, JRFillBreak, JRFillChart, JRFillComponentElement, JRFillCrosstab, JRFillElement, JRFillEllipse, JRFillFrame, JRFillGenericElement, JRFillGraphicElement, JRFillImage, JRFillLine, JRFillRectangle, JRFillStaticText, JRFillSubreport, JRFillTextElement, JRFillTextField, TableSubreport

public interface JRElement
extends JRChild, JRCommonElement, JRPropertiesHolder

An abstract representation of a report element. All report elements implement this interface. The interface contains constants and methods that apply to all report elements.

Version:
$Id: JRElement.java 3501 2010-03-04 10:22:55Z shertage $
Author:
Teodor Danciu ([email protected])

Field Summary
static byte MODE_OPAQUE
          Deprecated. Replaced by ModeEnum.OPAQUE.
static byte MODE_TRANSPARENT
          Deprecated. Replaced by ModeEnum.TRANSPARENT.
static byte POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM
          Deprecated. Replaced by PositionTypeEnum.FIX_RELATIVE_TO_BOTTOM.
static byte POSITION_TYPE_FIX_RELATIVE_TO_TOP
          Deprecated. Replaced by PositionTypeEnum.FIX_RELATIVE_TO_TOP.
static byte POSITION_TYPE_FLOAT
          Deprecated. Replaced by PositionTypeEnum.FLOAT.
static byte STRETCH_TYPE_NO_STRETCH
          Deprecated. Replaced by StretchTypeEnum.NO_STRETCH.
static byte STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT
          Deprecated. Replaced by StretchTypeEnum.RELATIVE_TO_BAND_HEIGHT.
static byte STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT
          Deprecated. Replaced by StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT.
 
Method Summary
 void collectExpressions(JRExpressionCollector collector)
           
 JRElementGroup getElementGroup()
          Indicates the logical group that the element belongs to.
 java.lang.String getKey()
          Returns the string value that uniquely identifies the element.
 byte getPositionType()
          Deprecated. Replaced by getPositionTypeValue().
 PositionTypeEnum getPositionTypeValue()
          Returns the position type for the element
 JRExpression getPrintWhenExpression()
          Gets the the expression that is evaluated in order to decide if the element should be displayed.
 JRGroup getPrintWhenGroupChanges()
          Returns the group for which an element with a printRepeatedValues attribute set to true will be redisplayed even if the value has not changed.
 JRPropertyExpression[] getPropertyExpressions()
          Returns the list of dynamic/expression-based properties for this report element.
 byte getStretchType()
          Deprecated. Replaced by getStretchTypeValue().
 StretchTypeEnum getStretchTypeValue()
          Indicates the stretch type for the element
 int getX()
          Gets the the section relative horizontal offset of the element top left corner.
 int getY()
          Gets the the section relative vertical offset of the element top left corner.
 boolean isPrintInFirstWholeBand()
          Returns true if an element with a printRepeatedValues attribute set to true will be redisplayed for every new page or column that is not an overflow from a previous page or column.
 boolean isPrintRepeatedValues()
          Specifies if the element value will be printed for every iteration, even if its value has not changed.
 boolean isPrintWhenDetailOverflows()
          If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page.
 boolean isRemoveLineWhenBlank()
          Returns true if the remaining blank space appearing when the value is not printed will be removed.
 void setPositionType(byte positionType)
          Deprecated. Replaced by setPositionType(PositionTypeEnum).
 void setPositionType(PositionTypeEnum positionType)
          Sets the position type for the element.
 void setPrintInFirstWholeBand(boolean isPrintInFirstWholeBand)
          Specifies whether an element with a printRepeatedValues attribute set to true should be redisplayed for every new page or column that is not an overflow from a previous page or column.
 void setPrintRepeatedValues(boolean isPrintRepeatedValues)
           
 void setPrintWhenDetailOverflows(boolean isPrintWhenDetailOverflows)
          If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page.
 void setRemoveLineWhenBlank(boolean isRemoveLineWhenBlank)
          Specifies whether the remaining blank space appearing when the value is not printed will be removed.
 void setStretchType(byte stretchType)
          Deprecated. Replaced by setStretchType(StretchTypeEnum).
 void setStretchType(StretchTypeEnum stretchTypeEnum)
          Specifies how the engine should treat a missing image.
 void setWidth(int width)
           
 void setX(int x)
          Sets the the section relative horizontal offset of the element top left corner.
 
Methods inherited from interface net.sf.jasperreports.engine.JRChild
clone
 
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
 
Methods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
 
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getMode, getModeValue, getOwnBackcolor, getOwnForecolor, getOwnMode, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode, setMode, setMode
 
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleNameReference
 
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
 

Field Detail

POSITION_TYPE_FLOAT

static final byte POSITION_TYPE_FLOAT
Deprecated. Replaced by PositionTypeEnum.FLOAT.
The element will float in its parent section if it is pushed downwards by other elements fount above it. It will try to conserve the distance between it and the neighboring elements placed immediately above.

See Also:
Constant Field Values

POSITION_TYPE_FIX_RELATIVE_TO_TOP

static final byte POSITION_TYPE_FIX_RELATIVE_TO_TOP
Deprecated. Replaced by PositionTypeEnum.FIX_RELATIVE_TO_TOP.
The element will simply ignore what happens to the other section elements and tries to conserve the y offset measured from the top of its parent report section.

See Also:
Constant Field Values

POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM

static final byte POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM
Deprecated. Replaced by PositionTypeEnum.FIX_RELATIVE_TO_BOTTOM.
If the height of the parent report section is affected by elements that stretch, the current element will try to conserve the original distance between its bottom margin and the bottom of the band.

See Also:
Constant Field Values

MODE_OPAQUE

static final byte MODE_OPAQUE
Deprecated. Replaced by ModeEnum.OPAQUE.
Specifies that the element is opaque.

See Also:
Constant Field Values

MODE_TRANSPARENT

static final byte MODE_TRANSPARENT
Deprecated. Replaced by ModeEnum.TRANSPARENT.
Specifies that the element is transparent.

See Also:
Constant Field Values

STRETCH_TYPE_NO_STRETCH

static final byte STRETCH_TYPE_NO_STRETCH
Deprecated. Replaced by StretchTypeEnum.NO_STRETCH.
The element preserves its original specified height.

See Also:
Constant Field Values

STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT

static final byte STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT
Deprecated. Replaced by StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT.
Users have the possibility to group the elements of a report section in multiple imbricate groups. The only reason one might have for grouping your report elements is to be able to stretch them to fit the tallest object.

See Also:
Constant Field Values

STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT

static final byte STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT
Deprecated. Replaced by StretchTypeEnum.RELATIVE_TO_BAND_HEIGHT.
The graphic element will adapt its height to match the new height of the report section it placed on, which has been affected by stretch.

See Also:
Constant Field Values
Method Detail

getKey

java.lang.String getKey()
Returns the string value that uniquely identifies the element.

Specified by:
getKey in interface JRCommonElement

getPositionType

byte getPositionType()
Deprecated. Replaced by getPositionTypeValue().


getPositionTypeValue

PositionTypeEnum getPositionTypeValue()
Returns the position type for the element

Returns:
the position type

setPositionType

void setPositionType(byte positionType)
Deprecated. Replaced by setPositionType(PositionTypeEnum).


setPositionType

void setPositionType(PositionTypeEnum positionType)
Sets the position type for the element.

Parameters:
positionType - the position type

getStretchType

byte getStretchType()
Deprecated. Replaced by getStretchTypeValue().


setStretchType

void setStretchType(byte stretchType)
Deprecated. Replaced by setStretchType(StretchTypeEnum).


getStretchTypeValue

StretchTypeEnum getStretchTypeValue()
Indicates the stretch type for the element

Returns:
a value representing one of the stretch type constants in StretchTypeEnum

setStretchType

void setStretchType(StretchTypeEnum stretchTypeEnum)
Specifies how the engine should treat a missing image.

Parameters:
stretchTypeEnum - a value representing one of the stretch type constants in StretchTypeEnum

isPrintRepeatedValues

boolean isPrintRepeatedValues()
Specifies if the element value will be printed for every iteration, even if its value has not changed.

See Also:
isRemoveLineWhenBlank(), isPrintInFirstWholeBand()

setPrintRepeatedValues

void setPrintRepeatedValues(boolean isPrintRepeatedValues)

getX

int getX()
Gets the the section relative horizontal offset of the element top left corner.


setX

void setX(int x)
Sets the the section relative horizontal offset of the element top left corner.


getY

int getY()
Gets the the section relative vertical offset of the element top left corner.


setWidth

void setWidth(int width)

isRemoveLineWhenBlank

boolean isRemoveLineWhenBlank()
Returns true if the remaining blank space appearing when the value is not printed will be removed. Under certain circumstances (the element has an empty string as its value or contains a repeated value that is supressed) the space reserved for the current element remains empty. If this method returns true, it means the engine will try to suppress the blank line, but will only succeed if no other elements occupy the same vertical space.


setRemoveLineWhenBlank

void setRemoveLineWhenBlank(boolean isRemoveLineWhenBlank)
Specifies whether the remaining blank space appearing when the value is not printed will be removed. Under certain circumstances (the element has an empty string as its value or contains a repeated value that is supressed) the space reserved for the current element remains empty. If the parameter is set to true, it means the engine will try to suppress the blank line, but will only succeed if no other elements occupy the same vertical space.


isPrintInFirstWholeBand

boolean isPrintInFirstWholeBand()
Returns true if an element with a printRepeatedValues attribute set to true will be redisplayed for every new page or column that is not an overflow from a previous page or column.

See Also:
isPrintRepeatedValues()

setPrintInFirstWholeBand

void setPrintInFirstWholeBand(boolean isPrintInFirstWholeBand)
Specifies whether an element with a printRepeatedValues attribute set to true should be redisplayed for every new page or column that is not an overflow from a previous page or column.

See Also:
isPrintRepeatedValues()

isPrintWhenDetailOverflows

boolean isPrintWhenDetailOverflows()
If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page. Actually if there is at least one element with this attribute, the band is redisplayed from the beginning, except those elements that fitted in the current page and have isPrintWhenDetailOverflow set to false.


setPrintWhenDetailOverflows

void setPrintWhenDetailOverflows(boolean isPrintWhenDetailOverflows)
If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page. Actually if there is at least one element with this attribute, the band is redisplayed from the beginning, except those elements that fitted in the current page and have isPrintWhenDetailOverflow set to false.


getPrintWhenExpression

JRExpression getPrintWhenExpression()
Gets the the expression that is evaluated in order to decide if the element should be displayed. The print expression always returns a boolean value.


getPrintWhenGroupChanges

JRGroup getPrintWhenGroupChanges()
Returns the group for which an element with a printRepeatedValues attribute set to true will be redisplayed even if the value has not changed.

See Also:
isPrintRepeatedValues()

getElementGroup

JRElementGroup getElementGroup()
Indicates 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:
STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT

collectExpressions

void collectExpressions(JRExpressionCollector collector)

getPropertyExpressions

JRPropertyExpression[] getPropertyExpressions()
Returns the list of dynamic/expression-based properties for this report element.

Returns:
an array containing the expression-based properties of this report element


Copyright © 2011. All Rights Reserved.