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

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 3033 2009-08-27 11:46:22Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
static byte MODE_OPAQUE
          Specifies that the element is opaque.
static byte MODE_TRANSPARENT
          Specifies that the element is transparent.
static byte POSITION_TYPE_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.
static byte POSITION_TYPE_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.
static byte POSITION_TYPE_FLOAT
          The element will float in its parent section if it is pushed downwards by other elements fount above it.
static byte STRETCH_TYPE_NO_STRETCH
          The element preserves its original specified height.
static byte STRETCH_TYPE_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.
static byte STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT
          Users have the possibility to group the elements of a report section in multiple imbricate groups.
 
Method Summary
 void collectExpressions(JRExpressionCollector collector)
           
 JRElementGroup getElementGroup()
          Indicates the logical group that the element belongs to.
 int getHeight()
           
 java.lang.String getKey()
          Returns the string value that uniquely identifies the element.
 byte getPositionType()
          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()
          Returns the stretch type for the element
 int getWidth()
           
 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 setBackcolor(java.awt.Color backcolor)
           
 void setForecolor(java.awt.Color forecolor)
           
 void setMode(byte mode)
          Sets the element transparency mode.
 void setMode(java.lang.Byte mode)
           
 void setPositionType(byte 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)
          Sets the stretch type for the element.
 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, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode
 
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
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
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
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
Specifies that the element is opaque.

See Also:
Constant Field Values

MODE_TRANSPARENT

static final byte MODE_TRANSPARENT
Specifies that the element is transparent.

See Also:
Constant Field Values

STRETCH_TYPE_NO_STRETCH

static final byte STRETCH_TYPE_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
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
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()
Returns the position type for the element

Returns:
a byte value representing one of the position type constants in this class

setPositionType

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

Parameters:
positionType - a byte value that must be one of the position type constants in this class

getStretchType

byte getStretchType()
Returns the stretch type for the element

Returns:
a byte value representing one of the strech type constants in this class

setStretchType

void setStretchType(byte stretchType)
Sets the stretch type for the element.

Parameters:
stretchType - a byte value that must be one of the stretch type constants in this class

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)

setMode

void setMode(byte mode)
Sets the element transparency mode.


setMode

void setMode(java.lang.Byte mode)

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.


getWidth

int getWidth()

setWidth

void setWidth(int width)

getHeight

int getHeight()

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.


setForecolor

void setForecolor(java.awt.Color forecolor)

setBackcolor

void setBackcolor(java.awt.Color backcolor)

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


© 2001-2009 Jaspersoft Corporation www.jaspersoft.com