Package net.sf.jasperreports.engine.base
Class JRBasePrintElement
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBasePrintElement
-
- All Implemented Interfaces:
Serializable
,JRCommonElement
,JRIdentifiable
,JRPrintElement
,JRPropertiesHolder
,JRStyleContainer
- Direct Known Subclasses:
JRBaseGenericPrintElement
,JRBasePrintFrame
,JRBasePrintGraphicElement
,JRBasePrintText
public class JRBasePrintElement extends Object implements JRPrintElement, Serializable
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
backcolor
protected JRDefaultStyleProvider
defaultStyleProvider
protected Color
forecolor
protected int
height
protected String
key
protected ModeEnum
mode
protected JROrigin
origin
protected JRStyle
style
protected UUID
uuid
protected int
width
protected int
x
protected int
y
-
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> void
accept(PrintElementVisitor<T> visitor, T arg)
Accepts a print element visitor.Color
getBackcolor()
JRDefaultStyleProvider
getDefaultStyleProvider()
Color
getForecolor()
int
getHeight()
String
getKey()
Returns a string key that can be used to identify the element.ModeEnum
getMode()
Returns the element transparency mode.JROrigin
getOrigin()
Color
getOwnBackcolor()
Color
getOwnForecolor()
ModeEnum
getOwnMode()
JRPropertiesHolder
getParentProperties()
Returns the parent properties holder, whose properties are used as defaults for this object.int
getPrintElementId()
Returns a numerical Id that together withJRPrintElement.getSourceElementId()
uniquely identifies a print element.JRPropertiesMap
getPropertiesMap()
Returns this object's properties map.int
getSourceElementId()
Returns a numerical Id associated to the fill element that generated this print element.JRStyle
getStyle()
Returns this object's style.String
getStyleNameReference()
Returns null as external style references are not allowed for print objects.protected StyleResolver
getStyleResolver()
UUID
getUUID()
int
getWidth()
int
getX()
int
getY()
boolean
hasProperties()
Checks whether the object has any properties.void
setBackcolor(Color backcolor)
void
setForecolor(Color forecolor)
void
setHeight(int height)
void
setKey(String key)
Sets the print element key.void
setMode(ModeEnum mode)
Sets the element transparency mode.void
setOrigin(JROrigin origin)
void
setPrintElementId(int printElementId)
Sets the print Id for this element.void
setSourceElementId(int sourceElementId)
Sets the source/fill element Id for the print element.void
setStyle(JRStyle style)
void
setUUID(UUID uuid)
void
setWidth(int width)
void
setX(int x)
void
setY(int y)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getStyleName
-
-
-
-
Field Detail
-
uuid
protected UUID uuid
-
origin
protected JROrigin origin
-
key
protected String key
-
mode
protected ModeEnum mode
-
x
protected int x
-
y
protected int y
-
width
protected int width
-
height
protected int height
-
forecolor
protected Color forecolor
-
backcolor
protected 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:
getDefaultStyleProvider
in interfaceJRStyleContainer
-
getStyleResolver
protected StyleResolver getStyleResolver()
-
getUUID
public UUID getUUID()
- Specified by:
getUUID
in interfaceJRIdentifiable
-
setUUID
public void setUUID(UUID uuid)
- Specified by:
setUUID
in interfaceJRPrintElement
-
getOrigin
public JROrigin getOrigin()
- Specified by:
getOrigin
in interfaceJRPrintElement
-
setOrigin
public void setOrigin(JROrigin origin)
-
getStyle
public JRStyle getStyle()
Description copied from interface:JRStyleContainer
Returns this object's style.- Specified by:
getStyle
in interfaceJRStyleContainer
- Returns:
- this object's style
-
setStyle
public void setStyle(JRStyle style)
- Specified by:
setStyle
in interfaceJRPrintElement
-
getMode
public ModeEnum getMode()
Description copied from interface:JRCommonElement
Returns 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:
getMode
in interfaceJRCommonElement
-
getOwnMode
public ModeEnum getOwnMode()
- Specified by:
getOwnMode
in interfaceJRCommonElement
-
setMode
public void setMode(ModeEnum mode)
Description copied from interface:JRCommonElement
Sets the element transparency mode.- Specified by:
setMode
in interfaceJRCommonElement
-
getX
public int getX()
- Specified by:
getX
in interfaceJRPrintElement
-
setX
public void setX(int x)
- Specified by:
setX
in interfaceJRPrintElement
-
getY
public int getY()
- Specified by:
getY
in interfaceJRPrintElement
-
setY
public void setY(int y)
- Specified by:
setY
in interfaceJRPrintElement
-
getWidth
public int getWidth()
- Specified by:
getWidth
in interfaceJRCommonElement
- Specified by:
getWidth
in interfaceJRPrintElement
-
setWidth
public void setWidth(int width)
- Specified by:
setWidth
in interfaceJRPrintElement
-
getHeight
public int getHeight()
- Specified by:
getHeight
in interfaceJRCommonElement
- Specified by:
getHeight
in interfaceJRPrintElement
-
setHeight
public void setHeight(int height)
- Specified by:
setHeight
in interfaceJRPrintElement
-
getForecolor
public Color getForecolor()
- Specified by:
getForecolor
in interfaceJRCommonElement
-
getOwnForecolor
public Color getOwnForecolor()
- Specified by:
getOwnForecolor
in interfaceJRCommonElement
-
setForecolor
public void setForecolor(Color forecolor)
- Specified by:
setForecolor
in interfaceJRCommonElement
-
getBackcolor
public Color getBackcolor()
- Specified by:
getBackcolor
in interfaceJRCommonElement
-
getOwnBackcolor
public Color getOwnBackcolor()
- Specified by:
getOwnBackcolor
in interfaceJRCommonElement
-
setBackcolor
public void setBackcolor(Color backcolor)
- Specified by:
setBackcolor
in interfaceJRCommonElement
-
getKey
public String getKey()
Description copied from interface:JRPrintElement
Returns a string key that can be used to identify the element.When filling a report, the
report element key
is 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:
getKey
in interfaceJRCommonElement
- Specified by:
getKey
in interfaceJRPrintElement
-
setKey
public void setKey(String key)
Sets the print element key.- Parameters:
key
- the element key- See Also:
getKey()
-
getStyleNameReference
public String getStyleNameReference()
Returns null as external style references are not allowed for print objects.- Specified by:
getStyleNameReference
in interfaceJRStyleContainer
- Returns:
- the name of an external style
-
hasProperties
public boolean hasProperties()
Description copied from interface:JRPropertiesHolder
Checks whether the object has any properties.- Specified by:
hasProperties
in interfaceJRPropertiesHolder
- Returns:
- whether the object has any properties
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolder
Returns this object's properties map.- Specified by:
getPropertiesMap
in interfaceJRPropertiesHolder
- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder getParentProperties()
Description copied from interface:JRPropertiesHolder
Returns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentProperties
in interfaceJRPropertiesHolder
- Returns:
- the parent properties holder, or
null
if no parent
-
accept
public <T> void accept(PrintElementVisitor<T> visitor, T arg)
Description copied from interface:JRPrintElement
Accepts a print element visitor.The element calls the method that corresponds to the element type on the visitor.
- Specified by:
accept
in 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:JRPrintElement
Returns a numerical Id associated to the fill element that generated this print element.- Specified by:
getSourceElementId
in 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:JRPrintElement
Returns a numerical Id that together withJRPrintElement.getSourceElementId()
uniquely identifies a print element.- Specified by:
getPrintElementId
in 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()
-
-