Package net.sf.jasperreports.engine.base
Class JRBasePrintElement
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBasePrintElement
-
- All Implemented Interfaces:
java.io.Serializable,JRCommonElement,JRIdentifiable,JRPrintElement,JRPropertiesHolder,JRStyleContainer
- Direct Known Subclasses:
JRBaseGenericPrintElement,JRBasePrintFrame,JRBasePrintGraphicElement,JRBasePrintText
public class JRBasePrintElement extends java.lang.Object implements JRPrintElement, java.io.Serializable
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Colorbackcolorprotected JRDefaultStyleProviderdefaultStyleProviderprotected java.awt.Colorforecolorprotected intheightprotected java.lang.Stringkeyprotected ModeEnummodeValueprotected JROriginoriginprotected JRStylestyleprotected java.util.UUIDuuidprotected intwidthprotected intxprotected inty-
Fields inherited from interface net.sf.jasperreports.engine.JRPrintElement
UNSET_PRINT_ELEMENT_ID, UNSET_SOURCE_ELEMENT_ID
-
-
Constructor Summary
Constructors Constructor Description JRBasePrintElement(JRDefaultStyleProvider defaultStyleProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidaccept(PrintElementVisitor<T> visitor, T arg)Accepts a print element visitor.java.awt.ColorgetBackcolor()JRDefaultStyleProvidergetDefaultStyleProvider()java.awt.ColorgetForecolor()intgetHeight()java.lang.StringgetKey()Returns a string key that can be used to identify the element.ModeEnumgetModeValue()Returns the element transparency mode.JROrigingetOrigin()java.awt.ColorgetOwnBackcolor()java.awt.ColorgetOwnForecolor()ModeEnumgetOwnModeValue()JRPropertiesHoldergetParentProperties()Returns the parent properties holder, whose properties are used as defaults for this object.intgetPrintElementId()Returns a numerical Id that together withJRPrintElement.getSourceElementId()uniquely identifies a print element.JRPropertiesMapgetPropertiesMap()Returns this object's properties map.intgetSourceElementId()Returns a numerical Id associated to the fill element that generated this print element.JRStylegetStyle()Returns this object's style.java.lang.StringgetStyleNameReference()Returns null as external style references are not allowed for print objects.protected StyleResolvergetStyleResolver()java.util.UUIDgetUUID()intgetWidth()intgetX()intgetY()booleanhasProperties()Checks whether the object has any properties.voidsetBackcolor(java.awt.Color backcolor)voidsetForecolor(java.awt.Color forecolor)voidsetHeight(int height)voidsetKey(java.lang.String key)Sets the print element key.voidsetMode(ModeEnum modeValue)Sets the element transparency mode.voidsetOrigin(JROrigin origin)voidsetPrintElementId(int printElementId)Sets the print Id for this element.voidsetSourceElementId(int sourceElementId)Sets the source/fill element Id for the print element.voidsetStyle(JRStyle style)voidsetUUID(java.util.UUID uuid)voidsetWidth(int width)voidsetX(int x)voidsetY(int y)
-
-
-
Field Detail
-
uuid
protected java.util.UUID uuid
-
origin
protected JROrigin origin
-
key
protected java.lang.String key
-
modeValue
protected ModeEnum modeValue
-
x
protected int x
-
y
protected int y
-
width
protected int width
-
height
protected int height
-
forecolor
protected java.awt.Color forecolor
-
backcolor
protected java.awt.Color backcolor
-
defaultStyleProvider
protected JRDefaultStyleProvider defaultStyleProvider
-
style
protected JRStyle style
-
-
Constructor Detail
-
JRBasePrintElement
public JRBasePrintElement(JRDefaultStyleProvider defaultStyleProvider)
-
-
Method Detail
-
getDefaultStyleProvider
public JRDefaultStyleProvider getDefaultStyleProvider()
- Specified by:
getDefaultStyleProviderin interfaceJRStyleContainer
-
getStyleResolver
protected StyleResolver getStyleResolver()
-
getUUID
public java.util.UUID getUUID()
- Specified by:
getUUIDin interfaceJRIdentifiable
-
setUUID
public void setUUID(java.util.UUID uuid)
- Specified by:
setUUIDin interfaceJRPrintElement
-
getOrigin
public JROrigin getOrigin()
- Specified by:
getOriginin interfaceJRPrintElement
-
setOrigin
public void setOrigin(JROrigin origin)
-
getStyle
public JRStyle getStyle()
Description copied from interface:JRStyleContainerReturns this object's style.- Specified by:
getStylein interfaceJRStyleContainer- Returns:
- this object's style
-
setStyle
public void setStyle(JRStyle style)
- Specified by:
setStylein interfaceJRPrintElement
-
getModeValue
public ModeEnum getModeValue()
Description copied from interface:JRCommonElementReturns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements.- Specified by:
getModeValuein interfaceJRCommonElement
-
getOwnModeValue
public ModeEnum getOwnModeValue()
- Specified by:
getOwnModeValuein interfaceJRCommonElement
-
setMode
public void setMode(ModeEnum modeValue)
Description copied from interface:JRCommonElementSets the element transparency mode.- Specified by:
setModein interfaceJRCommonElement
-
getX
public int getX()
- Specified by:
getXin interfaceJRPrintElement
-
setX
public void setX(int x)
- Specified by:
setXin interfaceJRPrintElement
-
getY
public int getY()
- Specified by:
getYin interfaceJRPrintElement
-
setY
public void setY(int y)
- Specified by:
setYin interfaceJRPrintElement
-
getWidth
public int getWidth()
- Specified by:
getWidthin interfaceJRCommonElement- Specified by:
getWidthin interfaceJRPrintElement
-
setWidth
public void setWidth(int width)
- Specified by:
setWidthin interfaceJRPrintElement
-
getHeight
public int getHeight()
- Specified by:
getHeightin interfaceJRCommonElement- Specified by:
getHeightin interfaceJRPrintElement
-
setHeight
public void setHeight(int height)
- Specified by:
setHeightin interfaceJRPrintElement
-
getForecolor
public java.awt.Color getForecolor()
- Specified by:
getForecolorin interfaceJRCommonElement
-
getOwnForecolor
public java.awt.Color getOwnForecolor()
- Specified by:
getOwnForecolorin interfaceJRCommonElement
-
setForecolor
public void setForecolor(java.awt.Color forecolor)
- Specified by:
setForecolorin interfaceJRCommonElement
-
getBackcolor
public java.awt.Color getBackcolor()
- Specified by:
getBackcolorin interfaceJRCommonElement
-
getOwnBackcolor
public java.awt.Color getOwnBackcolor()
- Specified by:
getOwnBackcolorin interfaceJRCommonElement
-
setBackcolor
public void setBackcolor(java.awt.Color backcolor)
- Specified by:
setBackcolorin interfaceJRCommonElement
-
getKey
public java.lang.String getKey()
Description copied from interface:JRPrintElementReturns a string key that can be used to identify the element.When filling a report, the
report element keyis copied to all print elements generated by a report element. Note that this means that multiple elements having the same key can appear on the same page/filled report.- Specified by:
getKeyin interfaceJRCommonElement- Specified by:
getKeyin interfaceJRPrintElement
-
setKey
public void setKey(java.lang.String key)
Sets the print element key.- Parameters:
key- the element key- See Also:
getKey()
-
getStyleNameReference
public java.lang.String getStyleNameReference()
Returns null as external style references are not allowed for print objects.- Specified by:
getStyleNameReferencein interfaceJRStyleContainer- Returns:
- the name of an external style
-
hasProperties
public boolean hasProperties()
Description copied from interface:JRPropertiesHolderChecks whether the object has any properties.- Specified by:
hasPropertiesin interfaceJRPropertiesHolder- Returns:
- whether the object has any properties
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder getParentProperties()
Description copied from interface:JRPropertiesHolderReturns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentPropertiesin interfaceJRPropertiesHolder- Returns:
- the parent properties holder, or
nullif no parent
-
accept
public <T> void accept(PrintElementVisitor<T> visitor, T arg)
Description copied from interface:JRPrintElementAccepts a print element visitor.The element calls the method that corresponds to the element type on the visitor.
- Specified by:
acceptin interfaceJRPrintElement- Type Parameters:
T- the type of the argument passed to the visit operation- Parameters:
visitor- the visitor objectsarg- the argument passed to the visit operation
-
getSourceElementId
public int getSourceElementId()
Description copied from interface:JRPrintElementReturns a numerical Id associated to the fill element that generated this print element.- Specified by:
getSourceElementIdin interfaceJRPrintElement- Returns:
- the Id of the fill element that generated this element
-
setSourceElementId
public void setSourceElementId(int sourceElementId)
Sets the source/fill element Id for the print element.- Parameters:
sourceElementId-- See Also:
getSourceElementId()
-
getPrintElementId
public int getPrintElementId()
Description copied from interface:JRPrintElementReturns a numerical Id that together withJRPrintElement.getSourceElementId()uniquely identifies a print element.- Specified by:
getPrintElementIdin interfaceJRPrintElement- Returns:
- a print Id for the element
- See Also:
PrintElementId
-
setPrintElementId
public void setPrintElementId(int printElementId)
Sets the print Id for this element.- Parameters:
printElementId- the print Id- See Also:
getPrintElementId()
-
-