net.sf.jasperreports.engine.fill
Class JRTemplateImage

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JRTemplateElement
      extended by net.sf.jasperreports.engine.fill.JRTemplateGraphicElement
          extended by net.sf.jasperreports.engine.fill.JRTemplateImage
All Implemented Interfaces:
java.io.Serializable, Deduplicable, JRAlignment, JRBoxContainer, JRCommonElement, JRCommonGraphicElement, JRCommonImage, JRIdentifiable, JRPenContainer, JRPropertiesHolder, JRStyleContainer

public class JRTemplateImage
extends JRTemplateGraphicElement
implements JRAlignment, JRCommonImage

Image information shared by multiple print image objects.

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

Field Summary
protected  boolean isLazy
           
protected  OnErrorTypeEnum onErrorTypeValue
           
 
Fields inherited from class net.sf.jasperreports.engine.fill.JRTemplateGraphicElement
linePen
 
Fields inherited from class net.sf.jasperreports.engine.fill.JRTemplateElement
defaultStyleProvider, origin, parentStyle
 
Constructor Summary
  JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
          Creates a template image.
protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRChart chart)
           
protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRImage image)
           
 
Method Summary
 void copyLineBox(JRLineBox box)
          Copies box attributes.
 java.lang.Float getDefaultLineWidth()
           
 int getHashCode()
          Returns a hash code to be used for the deduplicate map.
 HorizontalAlignEnum getHorizontalAlignmentValue()
          Gets the text horizontal alignment.
 HyperlinkTargetEnum getHyperlinkTargetValue()
           
 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.
 ModeEnum getModeValue()
          Returns the element transparency mode.
 OnErrorTypeEnum getOnErrorTypeValue()
           
 HorizontalAlignEnum getOwnHorizontalAlignmentValue()
           
 ScaleImageEnum getOwnScaleImageValue()
          Gets the image own scale type.
 VerticalAlignEnum getOwnVerticalAlignmentValue()
           
 ScaleImageEnum getScaleImageValue()
          Gets the image scale type.
 VerticalAlignEnum getVerticalAlignmentValue()
          Gets the text vertical alignment.
 boolean isIdentical(java.lang.Object object)
          Determines if this instance is identical to another object.
 boolean isLazy()
           
 boolean isUsingCache()
           
protected  void setChart(JRChart chart)
           
 void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignmentValue)
          Sets the text horizontal alignment.
protected  void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)
           
protected  void setHyperlinkType(HyperlinkTypeEnum hyperlinkType)
          Sets the link type as a built-in hyperlink type.
protected  void setImage(JRImage image)
           
 void setLazy(boolean isLazy)
           
 void setLinkTarget(java.lang.String linkTarget)
          Sets the hyperlink target name.
 void setLinkType(java.lang.String linkType)
          Sets the hyperlink type.
 void setOnErrorType(OnErrorTypeEnum onErrorTypeValue)
           
 void setScaleImage(ScaleImageEnum scaleImageValue)
          Sets the image scale type.
 void setUsingCache(boolean isUsingCache)
           
 void setUsingCache(java.lang.Boolean isUsingCache)
           
 void setVerticalAlignment(VerticalAlignEnum verticalAlignmentValue)
          Gets the text vertical alignment.
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplateGraphicElement
addGraphicHash, copyLinePen, getDefaultLineColor, getFillValue, getLinePen, getOwnFillValue, graphicIdentical, setFill, setGraphicElement
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplateElement
addTemplateHash, getBackcolor, getBaseStyle, getDefaultStyleProvider, getForecolor, getHeight, getId, getKey, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPropertiesMap, getStyle, getStyleNameReference, getUUID, getWidth, hasProperties, setBackcolor, setElement, setForecolor, setKey, setMode, setStyle, templateIdentical
 
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.JRCommonGraphicElement
getFillValue, getLinePen, getOwnFillValue, setFill
 
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode
 
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.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleNameReference
 
Methods inherited from interface net.sf.jasperreports.engine.JRBoxContainer
getDefaultLineColor
 

Field Detail

isLazy

protected boolean isLazy

onErrorTypeValue

protected OnErrorTypeEnum onErrorTypeValue
Constructor Detail

JRTemplateImage

protected JRTemplateImage(JROrigin origin,
                          JRDefaultStyleProvider defaultStyleProvider,
                          JRImage image)

JRTemplateImage

protected JRTemplateImage(JROrigin origin,
                          JRDefaultStyleProvider defaultStyleProvider,
                          JRChart chart)

JRTemplateImage

public JRTemplateImage(JROrigin origin,
                       JRDefaultStyleProvider defaultStyleProvider)
Creates a template image.

Parameters:
origin - the origin of the elements that will use this template
defaultStyleProvider - the default style provider to use for this template
Method Detail

setImage

protected void setImage(JRImage image)

setChart

protected void setChart(JRChart chart)

copyLineBox

public void copyLineBox(JRLineBox box)
Copies box attributes.

Parameters:
box - the object to copy attributes from

getLineBox

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

getModeValue

public ModeEnum getModeValue()
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:
getModeValue in interface JRCommonElement
Overrides:
getModeValue in class JRTemplateElement

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 scaleImageValue)
Description copied from interface: JRCommonImage
Sets the image scale type.

Specified by:
setScaleImage in interface JRCommonImage
Parameters:
scaleImageValue - a value representing one of the scale type constants in ScaleImageEnum

isUsingCache

public boolean isUsingCache()

setUsingCache

public void setUsingCache(boolean isUsingCache)

setUsingCache

public void setUsingCache(java.lang.Boolean isUsingCache)

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 horizontalAlignmentValue)
Description copied from interface: JRAlignment
Sets the text horizontal alignment.

Specified by:
setHorizontalAlignment in interface JRAlignment
Parameters:
horizontalAlignmentValue - 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 verticalAlignmentValue)
Description copied from interface: JRAlignment
Gets the text vertical alignment.

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

isLazy

public boolean isLazy()

setLazy

public void setLazy(boolean isLazy)

getOnErrorTypeValue

public OnErrorTypeEnum getOnErrorTypeValue()

setOnErrorType

public void setOnErrorType(OnErrorTypeEnum onErrorTypeValue)

getHyperlinkTypeValue

public HyperlinkTypeEnum getHyperlinkTypeValue()
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.

Returns:
one of the hyperlink type constants
See Also:
getLinkType()

setHyperlinkType

protected void setHyperlinkType(HyperlinkTypeEnum hyperlinkType)
Sets the link type as a built-in hyperlink type.

Parameters:
hyperlinkType - the built-in hyperlink type
See Also:
getLinkType()

getHyperlinkTargetValue

public HyperlinkTargetEnum getHyperlinkTargetValue()

setHyperlinkTarget

protected void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)

getLinkTarget

public java.lang.String getLinkTarget()
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.

Returns:
the hyperlink type

setLinkTarget

public void setLinkTarget(java.lang.String linkTarget)
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.

Parameters:
linkTarget - the hyperlink target name

getLinkType

public java.lang.String getLinkType()
Returns the hyperlink type.

The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.

Returns:
the hyperlink type

setLinkType

public void setLinkType(java.lang.String linkType)
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.

Parameters:
linkType - the hyperlink type

getDefaultLineWidth

public java.lang.Float getDefaultLineWidth()
Specified by:
getDefaultLineWidth in interface JRPenContainer
Overrides:
getDefaultLineWidth in class JRTemplateGraphicElement

getHashCode

public int getHashCode()
Description copied from interface: Deduplicable
Returns a hash code to be used for the deduplicate map. The returned hash code should be consitent wiwh Deduplicable.isIdentical(Object), i.e. if two objects are identical they should have the same hash code.

Specified by:
getHashCode in interface Deduplicable
Returns:
deduplication hash code

isIdentical

public boolean isIdentical(java.lang.Object object)
Description copied from interface: Deduplicable
Determines if this instance is identical to another object.

Specified by:
isIdentical in interface Deduplicable
Parameters:
object - the object to compare with this instance
Returns:
true if the two objects are identical and can be deduplicated


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com