Class JRTemplatePrintImage
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRTemplatePrintElement
-
- net.sf.jasperreports.engine.fill.JRTemplatePrintGraphicElement
-
- net.sf.jasperreports.engine.fill.JRTemplatePrintImage
-
- All Implemented Interfaces:
Serializable
,JRBoxContainer
,JRCommonElement
,JRCommonGraphicElement
,JRCommonImage
,JRIdentifiable
,JRImageAlignment
,JRPenContainer
,JRPrintAnchor
,JRPrintElement
,JRPrintGraphicElement
,JRPrintHyperlink
,JRPrintImage
,JRPropertiesHolder
,JRStyleContainer
,VirtualizationSerializable
- Direct Known Subclasses:
JRRecordedValuesPrintImage
public class JRTemplatePrintImage extends JRTemplatePrintGraphicElement implements JRPrintImage
Implementation ofJRPrintImage
that uses aJRTemplateImage
instance to store common attributes.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
bookmarkLevel
The bookmark level for the anchor associated with this field.-
Fields inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintElement
EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND, template
-
Fields inherited from interface net.sf.jasperreports.engine.JRPrintElement
UNSET_PRINT_ELEMENT_ID, UNSET_SOURCE_ELEMENT_ID
-
Fields inherited from interface net.sf.jasperreports.engine.JRPrintHyperlink
PROPERTY_IGNORE_HYPERLINK_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description JRTemplatePrintImage()
JRTemplatePrintImage(JRTemplateImage image, PrintElementOriginator originator)
Creates a print image element.
-
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.String
getAnchorName()
int
getBookmarkLevel()
Returns the level of the bookmark corresponding to the anchor.HorizontalImageAlignEnum
getHorizontalImageAlign()
Gets the image horizontal alignment.String
getHyperlinkAnchor()
Integer
getHyperlinkPage()
JRPrintHyperlinkParameters
getHyperlinkParameters()
Returns the set of custom hyperlink parameters.String
getHyperlinkReference()
HyperlinkTargetEnum
getHyperlinkTarget()
String
getHyperlinkTooltip()
Returns the hyperlink tooltip.HyperlinkTypeEnum
getHyperlinkType()
Retrieves the hyperlink type for the element.JRLineBox
getLineBox()
String
getLinkTarget()
Returns the hyperlink target name.String
getLinkType()
Returns the hyperlink type.OnErrorTypeEnum
getOnErrorType()
HorizontalImageAlignEnum
getOwnHorizontalImageAlign()
RotationEnum
getOwnRotation()
Gets the image own rotation.ScaleImageEnum
getOwnScaleImage()
Gets the image own scale type.VerticalImageAlignEnum
getOwnVerticalImageAlign()
Renderable
getRenderer()
RotationEnum
getRotation()
Gets the image rotation.ScaleImageEnum
getScaleImage()
Gets the image scale type.VerticalImageAlignEnum
getVerticalImageAlign()
Gets the image vertical alignment.boolean
isUsingCache()
void
readVirtualized(VirtualizationInput in)
void
setAnchorName(String anchorName)
void
setBookmarkLevel(int bookmarkLevel)
Sets the boomark level for the anchor.void
setHorizontalImageAlign(HorizontalImageAlignEnum horizontalAlignment)
Sets the image horizontal alignment.void
setHyperlinkAnchor(String hyperlinkAnchor)
void
setHyperlinkOmitted(boolean hyperlinkOmitted)
void
setHyperlinkPage(Integer hyperlinkPage)
void
setHyperlinkParameters(JRPrintHyperlinkParameters parameters)
Sets the custom hyperlink parameters.void
setHyperlinkReference(String hyperlinkReference)
void
setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)
void
setHyperlinkTooltip(String hyperlinkTooltip)
Sets the tooltip to be used for the hyperlink.void
setHyperlinkType(HyperlinkTypeEnum hyperlinkType)
Sets the link type as a built-in hyperlink type.void
setLinkTarget(String target)
Sets the hyperlink target name.void
setLinkType(String type)
Sets the hyperlink type.void
setOnErrorType(OnErrorTypeEnum onErrorType)
void
setRenderer(Renderable renderable)
void
setRotation(RotationEnum rotation)
Sets the image rotation.void
setScaleImage(ScaleImageEnum scaleImage)
Sets the image scale type.void
setUsingCache(boolean isUsingCache)
void
setVerticalImageAlign(VerticalImageAlignEnum verticalAlignment)
Gets the image vertical alignment.void
writeVirtualized(VirtualizationOutput out)
-
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintGraphicElement
getDefaultLineColor, getDefaultLineWidth, getFill, getLinePen, getOwnFill, setFill
-
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintElement
getBackcolor, getDefaultStyleProvider, getForecolor, getHeight, getKey, getMode, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPrintElementId, getPropertiesMap, getSourceElementId, getStyle, getStyleNameReference, getTemplate, getUUID, getWidth, getX, getY, hasProperties, setBackcolor, setForecolor, setHeight, setMode, setSourceElementId, setStyle, setTemplate, setUUID, setWidth, setX, setY, updateElementTemplate
-
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.JRBoxContainer
getDefaultLineColor
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonGraphicElement
getFill, getLinePen, getOwnFill
-
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
-
Methods inherited from interface net.sf.jasperreports.engine.JRPenContainer
getDefaultLineColor, getDefaultLineWidth
-
Methods inherited from interface net.sf.jasperreports.engine.JRPrintElement
getHeight, getKey, getOrigin, getPrintElementId, getSourceElementId, getWidth, getX, getY, setHeight, setStyle, setUUID, setWidth, setX, setY
-
Methods inherited from interface net.sf.jasperreports.engine.JRPrintGraphicElement
setFill
-
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleName, getStyleNameReference
-
-
-
-
Field Detail
-
bookmarkLevel
protected int bookmarkLevel
The bookmark level for the anchor associated with this field.- See Also:
JRAnchor.getBookmarkLevel()
-
-
Constructor Detail
-
JRTemplatePrintImage
public JRTemplatePrintImage()
-
JRTemplatePrintImage
public JRTemplatePrintImage(JRTemplateImage image, PrintElementOriginator originator)
Creates a print image element.- Parameters:
image
- the template image that the element will useoriginator
-
-
-
Method Detail
-
getRenderer
public Renderable getRenderer()
- Specified by:
getRenderer
in interfaceJRPrintImage
-
setRenderer
public void setRenderer(Renderable renderable)
- Specified by:
setRenderer
in interfaceJRPrintImage
-
getScaleImage
public ScaleImageEnum getScaleImage()
Description copied from interface:JRCommonImage
Gets the image scale type.- Specified by:
getScaleImage
in interfaceJRCommonImage
- Returns:
- a value representing one of the scale type constants in
ScaleImageEnum
-
getOwnScaleImage
public ScaleImageEnum getOwnScaleImage()
Description copied from interface:JRCommonImage
Gets the image own scale type.- Specified by:
getOwnScaleImage
in interfaceJRCommonImage
- Returns:
- a value representing one of the scale type constants in
ScaleImageEnum
-
setScaleImage
public void setScaleImage(ScaleImageEnum scaleImage)
Description copied from interface:JRCommonImage
Sets the image scale type.- Specified by:
setScaleImage
in interfaceJRCommonImage
- Parameters:
scaleImage
- a value representing one of the scale type constants inScaleImageEnum
-
getRotation
public RotationEnum getRotation()
Description copied from interface:JRCommonImage
Gets the image rotation.- Specified by:
getRotation
in interfaceJRCommonImage
- Returns:
- a value representing one of the image rotation constants in
RotationEnum
-
getOwnRotation
public RotationEnum getOwnRotation()
Description copied from interface:JRCommonImage
Gets the image own rotation.- Specified by:
getOwnRotation
in interfaceJRCommonImage
- Returns:
- a value representing one of the image rotation constants in
RotationEnum
-
setRotation
public void setRotation(RotationEnum rotation)
Description copied from interface:JRCommonImage
Sets the image rotation.- Specified by:
setRotation
in interfaceJRCommonImage
- Parameters:
rotation
- a value representing one of the image rotation constants inRotationEnum
-
isUsingCache
public boolean isUsingCache()
- Specified by:
isUsingCache
in interfaceJRPrintImage
-
setUsingCache
public void setUsingCache(boolean isUsingCache)
- Specified by:
setUsingCache
in interfaceJRPrintImage
-
getHorizontalImageAlign
public HorizontalImageAlignEnum getHorizontalImageAlign()
Description copied from interface:JRImageAlignment
Gets the image horizontal alignment.- Specified by:
getHorizontalImageAlign
in interfaceJRImageAlignment
- Returns:
- a value representing one of the horizontal image alignment constants in
HorizontalImageAlignEnum
-
getOwnHorizontalImageAlign
public HorizontalImageAlignEnum getOwnHorizontalImageAlign()
- Specified by:
getOwnHorizontalImageAlign
in interfaceJRImageAlignment
-
setHorizontalImageAlign
public void setHorizontalImageAlign(HorizontalImageAlignEnum horizontalAlignment)
Description copied from interface:JRImageAlignment
Sets the image horizontal alignment.- Specified by:
setHorizontalImageAlign
in interfaceJRImageAlignment
- Parameters:
horizontalAlignment
- a value representing one of the horizontal image alignment constants inHorizontalImageAlignEnum
-
getVerticalImageAlign
public VerticalImageAlignEnum getVerticalImageAlign()
Description copied from interface:JRImageAlignment
Gets the image vertical alignment.- Specified by:
getVerticalImageAlign
in interfaceJRImageAlignment
- Returns:
- a value representing one of the vertical image alignment constants in
VerticalImageAlignEnum
-
getOwnVerticalImageAlign
public VerticalImageAlignEnum getOwnVerticalImageAlign()
- Specified by:
getOwnVerticalImageAlign
in interfaceJRImageAlignment
-
setVerticalImageAlign
public void setVerticalImageAlign(VerticalImageAlignEnum verticalAlignment)
Description copied from interface:JRImageAlignment
Gets the image vertical alignment.- Specified by:
setVerticalImageAlign
in interfaceJRImageAlignment
- Parameters:
verticalAlignment
- a value representing one of the vertical image alignment constants inVerticalImageAlignEnum
-
getOnErrorType
public OnErrorTypeEnum getOnErrorType()
- Specified by:
getOnErrorType
in interfaceJRPrintImage
-
setOnErrorType
public void setOnErrorType(OnErrorTypeEnum onErrorType)
- Specified by:
setOnErrorType
in interfaceJRPrintImage
-
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBox
in interfaceJRBoxContainer
-
getAnchorName
public String getAnchorName()
- Specified by:
getAnchorName
in interfaceJRPrintAnchor
-
setAnchorName
public void setAnchorName(String anchorName)
- Specified by:
setAnchorName
in interfaceJRPrintAnchor
-
setHyperlinkOmitted
public void setHyperlinkOmitted(boolean hyperlinkOmitted)
-
getHyperlinkType
public HyperlinkTypeEnum getHyperlinkType()
Description copied from interface:JRPrintHyperlink
Retrieves the hyperlink type for the element.The actual hyperlink type is determined by
getLinkType()
. This method can is used to determine whether the hyperlink type is one of the built-in types or a custom type. When hyperlink is of custom type,CUSTOM
is returned.- Specified by:
getHyperlinkType
in interfaceJRPrintHyperlink
- Returns:
- one of the hyperlink type constants
- See Also:
JRPrintHyperlink.getLinkType()
-
setHyperlinkType
public void setHyperlinkType(HyperlinkTypeEnum hyperlinkType)
Description copied from interface:JRPrintHyperlink
Sets the link type as a built-in hyperlink type.- Specified by:
setHyperlinkType
in interfaceJRPrintHyperlink
- Parameters:
hyperlinkType
- the built-in hyperlink type- See Also:
JRPrintHyperlink.getLinkType()
-
getHyperlinkTarget
public HyperlinkTargetEnum getHyperlinkTarget()
- Specified by:
getHyperlinkTarget
in interfaceJRPrintHyperlink
-
setHyperlinkTarget
public void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)
- Specified by:
setHyperlinkTarget
in interfaceJRPrintHyperlink
-
getHyperlinkReference
public String getHyperlinkReference()
- Specified by:
getHyperlinkReference
in interfaceJRPrintHyperlink
-
setHyperlinkReference
public void setHyperlinkReference(String hyperlinkReference)
- Specified by:
setHyperlinkReference
in interfaceJRPrintHyperlink
-
getHyperlinkAnchor
public String getHyperlinkAnchor()
- Specified by:
getHyperlinkAnchor
in interfaceJRPrintHyperlink
-
setHyperlinkAnchor
public void setHyperlinkAnchor(String hyperlinkAnchor)
- Specified by:
setHyperlinkAnchor
in interfaceJRPrintHyperlink
-
getHyperlinkPage
public Integer getHyperlinkPage()
- Specified by:
getHyperlinkPage
in interfaceJRPrintHyperlink
-
setHyperlinkPage
public void setHyperlinkPage(Integer hyperlinkPage)
- Specified by:
setHyperlinkPage
in interfaceJRPrintHyperlink
-
getBookmarkLevel
public int getBookmarkLevel()
Description copied from interface:JRPrintAnchor
Returns the level of the bookmark corresponding to the anchor.- Specified by:
getBookmarkLevel
in interfaceJRPrintAnchor
- Returns:
- the level of the bookmark corresponding to the anchor (starting from 1)
or
NO_BOOKMARK
if no bookmark should be created for this anchor
-
setBookmarkLevel
public void setBookmarkLevel(int bookmarkLevel)
Description copied from interface:JRPrintAnchor
Sets the boomark level for the anchor.- Specified by:
setBookmarkLevel
in interfaceJRPrintAnchor
- Parameters:
bookmarkLevel
- the bookmark level (starting from 1) orNO_BOOKMARK
if no bookmark should be created
-
getHyperlinkParameters
public JRPrintHyperlinkParameters getHyperlinkParameters()
Description copied from interface:JRPrintHyperlink
Returns the set of custom hyperlink parameters.- Specified by:
getHyperlinkParameters
in interfaceJRPrintHyperlink
- Returns:
- the set of custom hyperlink parameters
- See Also:
JRPrintHyperlink.setHyperlinkParameters(JRPrintHyperlinkParameters)
,JRPrintHyperlinkParameter
-
setHyperlinkParameters
public void setHyperlinkParameters(JRPrintHyperlinkParameters parameters)
Description copied from interface:JRPrintHyperlink
Sets the custom hyperlink parameters.These parameters will be used to produce the actual hyperlink when the report is exported.
- Specified by:
setHyperlinkParameters
in interfaceJRPrintHyperlink
- Parameters:
parameters
- the set of custom hyperlink parameters
-
getLinkType
public String getLinkType()
Description copied from interface:JRPrintHyperlink
Returns the hyperlink type.- Specified by:
getLinkType
in interfaceJRPrintHyperlink
- Returns:
- the hyperlink type
-
setLinkType
public void setLinkType(String type)
Description copied from interface:JRPrintHyperlink
Sets the hyperlink type.The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.
- Specified by:
setLinkType
in interfaceJRPrintHyperlink
- Parameters:
type
- the hyperlink type
-
getLinkTarget
public String getLinkTarget()
Description copied from interface:JRPrintHyperlink
Returns the hyperlink target name.The target name can be one of the built-in names (Self, Blank, Top, Parent), or can be an arbitrary name.
- Specified by:
getLinkTarget
in interfaceJRPrintHyperlink
- Returns:
- the hyperlink type
-
setLinkTarget
public void setLinkTarget(String target)
Description copied from interface:JRPrintHyperlink
Sets the hyperlink target name.The target name can be one of the built-in names (Self, Blank, Top, Parent), or can be an arbitrary name.
- Specified by:
setLinkTarget
in interfaceJRPrintHyperlink
- Parameters:
target
- the hyperlink target name
-
getHyperlinkTooltip
public String getHyperlinkTooltip()
Description copied from interface:JRPrintHyperlink
Returns the hyperlink tooltip.- Specified by:
getHyperlinkTooltip
in interfaceJRPrintHyperlink
- Returns:
- the hyperlink tooltip
-
setHyperlinkTooltip
public void setHyperlinkTooltip(String hyperlinkTooltip)
Description copied from interface:JRPrintHyperlink
Sets the tooltip to be used for the hyperlink.- Specified by:
setHyperlinkTooltip
in interfaceJRPrintHyperlink
- Parameters:
hyperlinkTooltip
- the tooltip
-
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
- Overrides:
accept
in classJRTemplatePrintElement
- 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
-
writeVirtualized
public void writeVirtualized(VirtualizationOutput out) throws IOException
- Specified by:
writeVirtualized
in interfaceVirtualizationSerializable
- Overrides:
writeVirtualized
in classJRTemplatePrintElement
- Throws:
IOException
-
readVirtualized
public void readVirtualized(VirtualizationInput in) throws IOException
- Specified by:
readVirtualized
in interfaceVirtualizationSerializable
- Overrides:
readVirtualized
in classJRTemplatePrintElement
- Throws:
IOException
-
-