Class JRBasePrintImage
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBasePrintElement
-
- net.sf.jasperreports.engine.base.JRBasePrintGraphicElement
-
- net.sf.jasperreports.engine.base.JRBasePrintImage
-
- All Implemented Interfaces:
Serializable
,JRBoxContainer
,JRCommonElement
,JRCommonGraphicElement
,JRCommonImage
,JRIdentifiable
,JRImageAlignment
,JRPenContainer
,JRPrintAnchor
,JRPrintElement
,JRPrintGraphicElement
,JRPrintHyperlink
,JRPrintImage
,JRPropertiesHolder
,JRStyleContainer
public class JRBasePrintImage extends JRBasePrintGraphicElement implements JRPrintImage
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
anchorName
protected int
bookmarkLevel
The bookmark level for the anchor associated with this field.protected HorizontalImageAlignEnum
horizontalImageAlign
protected String
hyperlinkAnchor
protected Integer
hyperlinkPage
protected JRPrintHyperlinkParameters
hyperlinkParameters
protected String
hyperlinkReference
protected String
hyperlinkTooltip
protected Boolean
isUsingCache
protected JRLineBox
lineBox
protected String
linkTarget
protected String
linkType
protected OnErrorTypeEnum
onErrorType
protected Renderable
renderable
protected RotationEnum
rotation
protected ScaleImageEnum
scaleImage
protected VerticalImageAlignEnum
verticalImageAlign
-
Fields inherited from class net.sf.jasperreports.engine.base.JRBasePrintGraphicElement
fill, linePen
-
Fields inherited from class net.sf.jasperreports.engine.base.JRBasePrintElement
backcolor, defaultStyleProvider, forecolor, height, key, mode, origin, style, uuid, width, x, y
-
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 JRBasePrintImage(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.void
addHyperlinkParameter(JRPrintHyperlinkParameter parameter)
Adds a custom hyperlink parameter.void
copyBox(JRLineBox lineBox)
String
getAnchorName()
int
getBookmarkLevel()
Returns the level of the bookmark corresponding to the anchor.Float
getDefaultLineWidth()
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.ModeEnum
getMode()
Returns the element transparency mode.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
setAnchorName(String anchorName)
void
setBookmarkLevel(int bookmarkLevel)
Sets the boomark level for the anchor.void
setHorizontalImageAlign(HorizontalImageAlignEnum horizontalImageAlign)
Sets the image horizontal alignment.void
setHyperlinkAnchor(String hyperlinkAnchor)
void
setHyperlinkPage(Integer hyperlinkPage)
void
setHyperlinkPage(String hyperlinkPage)
void
setHyperlinkParameters(JRPrintHyperlinkParameters hyperlinkParameters)
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 linkTarget)
Sets the hyperlink target name.void
setLinkType(String linkType)
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 verticalImageAlign)
Gets the image vertical alignment.-
Methods inherited from class net.sf.jasperreports.engine.base.JRBasePrintGraphicElement
copyPen, getDefaultLineColor, getFill, getLinePen, getOwnFill, setFill
-
Methods inherited from class net.sf.jasperreports.engine.base.JRBasePrintElement
getBackcolor, getDefaultStyleProvider, getForecolor, getHeight, getKey, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPrintElementId, getPropertiesMap, getSourceElementId, getStyle, getStyleNameReference, getStyleResolver, getUUID, getWidth, getX, getY, hasProperties, setBackcolor, setForecolor, setHeight, setKey, setMode, setOrigin, setPrintElementId, setSourceElementId, setStyle, setUUID, setWidth, setX, setY
-
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, 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
-
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
-
renderable
protected Renderable renderable
-
scaleImage
protected ScaleImageEnum scaleImage
-
rotation
protected RotationEnum rotation
-
isUsingCache
protected Boolean isUsingCache
-
horizontalImageAlign
protected HorizontalImageAlignEnum horizontalImageAlign
-
verticalImageAlign
protected VerticalImageAlignEnum verticalImageAlign
-
onErrorType
protected OnErrorTypeEnum onErrorType
-
lineBox
protected JRLineBox lineBox
-
anchorName
protected String anchorName
-
linkType
protected String linkType
-
linkTarget
protected String linkTarget
-
hyperlinkReference
protected String hyperlinkReference
-
hyperlinkAnchor
protected String hyperlinkAnchor
-
hyperlinkPage
protected Integer hyperlinkPage
-
hyperlinkTooltip
protected String hyperlinkTooltip
-
hyperlinkParameters
protected JRPrintHyperlinkParameters hyperlinkParameters
-
bookmarkLevel
protected int bookmarkLevel
The bookmark level for the anchor associated with this field.- See Also:
JRAnchor.getBookmarkLevel()
-
-
Constructor Detail
-
JRBasePrintImage
public JRBasePrintImage(JRDefaultStyleProvider defaultStyleProvider)
-
-
Method Detail
-
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
- Overrides:
getMode
in classJRBasePrintElement
-
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 horizontalImageAlign)
Description copied from interface:JRImageAlignment
Sets the image horizontal alignment.- Specified by:
setHorizontalImageAlign
in interfaceJRImageAlignment
- Parameters:
horizontalImageAlign
- 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 verticalImageAlign)
Description copied from interface:JRImageAlignment
Gets the image vertical alignment.- Specified by:
setVerticalImageAlign
in interfaceJRImageAlignment
- Parameters:
verticalImageAlign
- 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
-
copyBox
public void copyBox(JRLineBox lineBox)
-
getDefaultLineWidth
public Float getDefaultLineWidth()
- Specified by:
getDefaultLineWidth
in interfaceJRPenContainer
- Overrides:
getDefaultLineWidth
in classJRBasePrintGraphicElement
-
getAnchorName
public String getAnchorName()
- Specified by:
getAnchorName
in interfaceJRPrintAnchor
-
setAnchorName
public void setAnchorName(String anchorName)
- Specified by:
setAnchorName
in interfaceJRPrintAnchor
-
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
-
setHyperlinkPage
public void setHyperlinkPage(String hyperlinkPage)
-
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 hyperlinkParameters)
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:
hyperlinkParameters
- the set of custom hyperlink parameters
-
addHyperlinkParameter
public void addHyperlinkParameter(JRPrintHyperlinkParameter parameter)
Adds a custom hyperlink parameter.- Parameters:
parameter
- the parameter to add- See Also:
getHyperlinkParameters()
,JRPrintHyperlinkParameters.addParameter(JRPrintHyperlinkParameter)
-
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 linkType)
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:
linkType
- 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 linkTarget)
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:
linkTarget
- 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 classJRBasePrintElement
- 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
-
-