net.sf.jasperreports.engine.fill
Class JRTemplatePrintImage

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JRTemplatePrintElement
      extended by net.sf.jasperreports.engine.fill.JRTemplatePrintGraphicElement
          extended by net.sf.jasperreports.engine.fill.JRTemplatePrintImage
All Implemented Interfaces:
java.io.Serializable, JRAlignment, JRBoxContainer, JRCommonElement, JRCommonGraphicElement, JRCommonImage, JRIdentifiable, JRPenContainer, JRPrintAnchor, JRPrintElement, JRPrintGraphicElement, JRPrintHyperlink, JRPrintImage, JRPropertiesHolder, JRStyleContainer
Direct Known Subclasses:
JRRecordedValuesPrintImage

public class JRTemplatePrintImage
extends JRTemplatePrintGraphicElement
implements JRPrintImage

Implementation of JRPrintImage that uses a JRTemplateImage instance to store common attributes.

Version:
$Id: JRTemplatePrintImage.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  int bookmarkLevel
          The bookmark level for the anchor associated with this field.
 
Fields inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintElement
template
 
Fields inherited from interface net.sf.jasperreports.engine.JRPrintElement
UNSET_SOURCE_ELEMENT_ID
 
Constructor Summary
JRTemplatePrintImage(JRTemplateImage image)
          Deprecated. provide a source Id via JRTemplatePrintImage(JRTemplateImage, int)
JRTemplatePrintImage(JRTemplateImage image, int sourceElementId)
          Creates a print image element.
 
Method Summary
<T> void
accept(PrintElementVisitor<T> visitor, T arg)
          Accepts a print element visitor.
 java.lang.String getAnchorName()
           
 int getBookmarkLevel()
          Returns the level of the bookmark corresponding to the anchor.
 HorizontalAlignEnum getHorizontalAlignmentValue()
          Gets the text horizontal alignment.
 java.lang.String getHyperlinkAnchor()
           
 java.lang.Integer getHyperlinkPage()
           
 JRPrintHyperlinkParameters getHyperlinkParameters()
          Returns the set of custom hyperlink parameters.
 java.lang.String getHyperlinkReference()
           
 HyperlinkTargetEnum getHyperlinkTargetValue()
           
 java.lang.String getHyperlinkTooltip()
          Returns the hyperlink tooltip.
 HyperlinkTypeEnum getHyperlinkTypeValue()
          Retrieves the hyperlink type for the element.
 JRLineBox getLineBox()
           
 java.lang.String getLinkTarget()
          Returns the hyperlink target name.
 java.lang.String getLinkType()
          Returns the hyperlink type.
 OnErrorTypeEnum getOnErrorTypeValue()
           
 HorizontalAlignEnum getOwnHorizontalAlignmentValue()
           
 ScaleImageEnum getOwnScaleImageValue()
          Gets the image own scale type.
 VerticalAlignEnum getOwnVerticalAlignmentValue()
           
 Renderable getRenderable()
           
 JRRenderable getRenderer()
          Deprecated. Replaced by getRenderable().
 ScaleImageEnum getScaleImageValue()
          Gets the image scale type.
 VerticalAlignEnum getVerticalAlignmentValue()
          Gets the text vertical alignment.
 boolean isLazy()
           
 boolean isUsingCache()
           
 void setAnchorName(java.lang.String anchorName)
           
 void setBookmarkLevel(int bookmarkLevel)
          Sets the boomark level for the anchor.
 void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignment)
          Sets the text horizontal alignment.
 void setHyperlinkAnchor(java.lang.String hyperlinkAnchor)
           
 void setHyperlinkPage(java.lang.Integer hyperlinkPage)
           
 void setHyperlinkParameters(JRPrintHyperlinkParameters parameters)
          Sets the custom hyperlink parameters.
 void setHyperlinkReference(java.lang.String hyperlinkReference)
           
 void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)
           
 void setHyperlinkTooltip(java.lang.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 setLazy(boolean isLazy)
           
 void setLinkTarget(java.lang.String target)
          Sets the hyperlink target name.
 void setLinkType(java.lang.String type)
          Sets the hyperlink type.
 void setOnErrorType(OnErrorTypeEnum onErrorType)
           
 void setRenderable(Renderable renderable)
           
 void setRenderer(JRRenderable renderer)
          Deprecated. Replaced by setRenderable(Renderable).
 void setScaleImage(ScaleImageEnum scaleImage)
          Sets the image scale type.
 void setUsingCache(boolean isUsingCache)
           
 void setVerticalAlignment(VerticalAlignEnum verticalAlignment)
          Gets the text vertical alignment.
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintGraphicElement
getDefaultLineColor, getDefaultLineWidth, getFillValue, getLinePen, getOwnFillValue, setFill
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintElement
getBackcolor, getDefaultStyleProvider, getForecolor, getHeight, getKey, getModeValue, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPropertiesMap, getSourceElementId, getStyle, getStyleNameReference, getTemplate, getUUID, getWidth, getX, getY, hasProperties, setBackcolor, setForecolor, setHeight, setMode, setSourceElementId, setStyle, setTemplate, 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.JRPrintGraphicElement
setFill
 
Methods inherited from interface net.sf.jasperreports.engine.JRPrintElement
getHeight, getKey, getOrigin, getSourceElementId, getWidth, getX, getY, setHeight, setStyle, setWidth, setX, setY
 
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
 
Methods inherited from interface net.sf.jasperreports.engine.JRCommonGraphicElement
getFillValue, getLinePen, getOwnFillValue
 
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getModeValue, getOwnBackcolor, getOwnForecolor, getOwnModeValue, setBackcolor, setForecolor, setMode
 
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.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleNameReference
 
Methods inherited from interface net.sf.jasperreports.engine.JRBoxContainer
getDefaultLineColor
 

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(JRTemplateImage image)
Deprecated. provide a source Id via JRTemplatePrintImage(JRTemplateImage, int)

Creates a print image element.

Parameters:
image - the template image that the element will use

JRTemplatePrintImage

public JRTemplatePrintImage(JRTemplateImage image,
                            int sourceElementId)
Creates a print image element.

Parameters:
image - the template image that the element will use
sourceElementId - the Id of the source element
Method Detail

getRenderable

public Renderable getRenderable()
Specified by:
getRenderable in interface JRPrintImage

setRenderable

public void setRenderable(Renderable renderable)
Specified by:
setRenderable in interface JRPrintImage

getRenderer

public JRRenderable getRenderer()
Deprecated. Replaced by getRenderable().

Specified by:
getRenderer in interface JRPrintImage

setRenderer

public void setRenderer(JRRenderable renderer)
Deprecated. Replaced by setRenderable(Renderable).

Specified by:
setRenderer in interface JRPrintImage

getScaleImageValue

public ScaleImageEnum getScaleImageValue()
Description copied from interface: JRCommonImage
Gets the image scale type.

Specified by:
getScaleImageValue in interface JRCommonImage
Returns:
a value representing one of the scale type constants in ScaleImageEnum

getOwnScaleImageValue

public ScaleImageEnum getOwnScaleImageValue()
Description copied from interface: JRCommonImage
Gets the image own scale type.

Specified by:
getOwnScaleImageValue in interface JRCommonImage
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 interface JRCommonImage
Specified by:
setScaleImage in interface JRPrintImage
Parameters:
scaleImage - a value representing one of the scale type constants in ScaleImageEnum

isUsingCache

public boolean isUsingCache()
Specified by:
isUsingCache in interface JRPrintImage

setUsingCache

public void setUsingCache(boolean isUsingCache)
Specified by:
setUsingCache in interface JRPrintImage

getHorizontalAlignmentValue

public HorizontalAlignEnum getHorizontalAlignmentValue()
Description copied from interface: JRAlignment
Gets the text horizontal alignment.

Specified by:
getHorizontalAlignmentValue in interface JRAlignment
Returns:
a value representing one of the horizontal alignment constants in HorizontalAlignEnum

getOwnHorizontalAlignmentValue

public HorizontalAlignEnum getOwnHorizontalAlignmentValue()
Specified by:
getOwnHorizontalAlignmentValue in interface JRAlignment

setHorizontalAlignment

public void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignment)
Description copied from interface: JRAlignment
Sets the text horizontal alignment.

Specified by:
setHorizontalAlignment in interface JRAlignment
Parameters:
horizontalAlignment - a value representing one of the horizontal alignment constants in HorizontalAlignEnum

getVerticalAlignmentValue

public VerticalAlignEnum getVerticalAlignmentValue()
Description copied from interface: JRAlignment
Gets the text vertical alignment.

Specified by:
getVerticalAlignmentValue in interface JRAlignment
Returns:
a value representing one of the vertical alignment constants in VerticalAlignEnum

getOwnVerticalAlignmentValue

public VerticalAlignEnum getOwnVerticalAlignmentValue()
Specified by:
getOwnVerticalAlignmentValue in interface JRAlignment

setVerticalAlignment

public void setVerticalAlignment(VerticalAlignEnum verticalAlignment)
Description copied from interface: JRAlignment
Gets the text vertical alignment.

Specified by:
setVerticalAlignment in interface JRAlignment
Parameters:
verticalAlignment - a value representing one of the vertical alignment constants in VerticalAlignEnum

isLazy

public boolean isLazy()
Specified by:
isLazy in interface JRPrintImage

setLazy

public void setLazy(boolean isLazy)
Specified by:
setLazy in interface JRPrintImage

getOnErrorTypeValue

public OnErrorTypeEnum getOnErrorTypeValue()
Specified by:
getOnErrorTypeValue in interface JRPrintImage

setOnErrorType

public void setOnErrorType(OnErrorTypeEnum onErrorType)
Specified by:
setOnErrorType in interface JRPrintImage

getLineBox

public JRLineBox getLineBox()
Specified by:
getLineBox in interface JRBoxContainer

getAnchorName

public java.lang.String getAnchorName()
Specified by:
getAnchorName in interface JRPrintAnchor

setAnchorName

public void setAnchorName(java.lang.String anchorName)
Specified by:
setAnchorName in interface JRPrintAnchor

getHyperlinkTypeValue

public HyperlinkTypeEnum getHyperlinkTypeValue()
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:
getHyperlinkTypeValue in interface JRPrintHyperlink
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 interface JRPrintHyperlink
Parameters:
hyperlinkType - the built-in hyperlink type
See Also:
JRPrintHyperlink.getLinkType()

getHyperlinkTargetValue

public HyperlinkTargetEnum getHyperlinkTargetValue()
Specified by:
getHyperlinkTargetValue in interface JRPrintHyperlink

setHyperlinkTarget

public void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)
Specified by:
setHyperlinkTarget in interface JRPrintHyperlink

getHyperlinkReference

public java.lang.String getHyperlinkReference()
Specified by:
getHyperlinkReference in interface JRPrintHyperlink

setHyperlinkReference

public void setHyperlinkReference(java.lang.String hyperlinkReference)
Specified by:
setHyperlinkReference in interface JRPrintHyperlink

getHyperlinkAnchor

public java.lang.String getHyperlinkAnchor()
Specified by:
getHyperlinkAnchor in interface JRPrintHyperlink

setHyperlinkAnchor

public void setHyperlinkAnchor(java.lang.String hyperlinkAnchor)
Specified by:
setHyperlinkAnchor in interface JRPrintHyperlink

getHyperlinkPage

public java.lang.Integer getHyperlinkPage()
Specified by:
getHyperlinkPage in interface JRPrintHyperlink

setHyperlinkPage

public void setHyperlinkPage(java.lang.Integer hyperlinkPage)
Specified by:
setHyperlinkPage in interface JRPrintHyperlink

getBookmarkLevel

public int getBookmarkLevel()
Description copied from interface: JRPrintAnchor
Returns the level of the bookmark corresponding to the anchor.

Specified by:
getBookmarkLevel in interface JRPrintAnchor
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 interface JRPrintAnchor
Parameters:
bookmarkLevel - the bookmark level (starting from 1) or NO_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 interface JRPrintHyperlink
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 interface JRPrintHyperlink
Parameters:
parameters - the set of custom hyperlink parameters

getLinkType

public java.lang.String getLinkType()
Description copied from interface: JRPrintHyperlink
Returns the hyperlink type.

Specified by:
getLinkType in interface JRPrintHyperlink
Returns:
the hyperlink type

setLinkType

public void setLinkType(java.lang.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 interface JRPrintHyperlink
Parameters:
type - the hyperlink type

getLinkTarget

public java.lang.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 interface JRPrintHyperlink
Returns:
the hyperlink type

setLinkTarget

public void setLinkTarget(java.lang.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 interface JRPrintHyperlink
Parameters:
target - the hyperlink target name

getHyperlinkTooltip

public java.lang.String getHyperlinkTooltip()
Description copied from interface: JRPrintHyperlink
Returns the hyperlink tooltip.

Specified by:
getHyperlinkTooltip in interface JRPrintHyperlink
Returns:
the hyperlink tooltip

setHyperlinkTooltip

public void setHyperlinkTooltip(java.lang.String hyperlinkTooltip)
Description copied from interface: JRPrintHyperlink
Sets the tooltip to be used for the hyperlink.

Specified by:
setHyperlinkTooltip in interface JRPrintHyperlink
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 interface JRPrintElement
Overrides:
accept in class JRTemplatePrintElement
Type Parameters:
T - the type of the argument passed to the visit operation
Parameters:
visitor - the visitor objects
arg - the argument passed to the visit operation


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com