Class JRTemplateImage

All Implemented Interfaces:
Serializable, Deduplicable, JRBoxContainer, JRCommonElement, JRCommonGraphicElement, JRCommonImage, JRImageAlignment, JRPenContainer, JRPropertiesHolder, JRStyleContainer
Direct Known Subclasses:
ChartTemplateImage

public class JRTemplateImage extends JRTemplateGraphicElement implements JRCommonImage
Image information shared by multiple print image objects.
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
  • Field Details

    • isLazy

      protected boolean isLazy
    • onErrorType

      protected OnErrorTypeEnum onErrorType
  • Constructor Details

    • JRTemplateImage

      protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRImage image)
    • 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 Details

    • setImage

      protected void setImage(JRImage image)
    • 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
    • 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 interface JRCommonElement
      Overrides:
      getMode in class JRTemplateElement
    • getScaleImage

      public ScaleImageEnum getScaleImage()
      Description copied from interface: JRCommonImage
      Gets the image scale type.
      Specified by:
      getScaleImage in interface JRCommonImage
      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 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
      Parameters:
      scaleImage - a value representing one of the scale type constants in ScaleImageEnum
    • getRotation

      public RotationEnum getRotation()
      Description copied from interface: JRCommonImage
      Gets the image rotation.
      Specified by:
      getRotation in interface JRCommonImage
      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 interface JRCommonImage
      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 interface JRCommonImage
      Parameters:
      rotation - a value representing one of the image rotation constants in RotationEnum
    • isUsingCache

      public boolean isUsingCache()
    • setUsingCache

      public void setUsingCache(boolean isUsingCache)
    • setUsingCache

      public void setUsingCache(Boolean isUsingCache)
    • getHorizontalImageAlign

      public HorizontalImageAlignEnum getHorizontalImageAlign()
      Description copied from interface: JRImageAlignment
      Gets the image horizontal alignment.
      Specified by:
      getHorizontalImageAlign in interface JRImageAlignment
      Returns:
      a value representing one of the horizontal image alignment constants in HorizontalImageAlignEnum
    • getOwnHorizontalImageAlign

      public HorizontalImageAlignEnum getOwnHorizontalImageAlign()
      Specified by:
      getOwnHorizontalImageAlign in interface JRImageAlignment
    • setHorizontalImageAlign

      public void setHorizontalImageAlign(HorizontalImageAlignEnum horizontalImageAlign)
      Description copied from interface: JRImageAlignment
      Sets the image horizontal alignment.
      Specified by:
      setHorizontalImageAlign in interface JRImageAlignment
      Parameters:
      horizontalImageAlign - a value representing one of the horizontal image alignment constants in HorizontalImageAlignEnum
    • getVerticalImageAlign

      public VerticalImageAlignEnum getVerticalImageAlign()
      Description copied from interface: JRImageAlignment
      Gets the image vertical alignment.
      Specified by:
      getVerticalImageAlign in interface JRImageAlignment
      Returns:
      a value representing one of the vertical image alignment constants in VerticalImageAlignEnum
    • getOwnVerticalImageAlign

      public VerticalImageAlignEnum getOwnVerticalImageAlign()
      Specified by:
      getOwnVerticalImageAlign in interface JRImageAlignment
    • setVerticalImageAlign

      public void setVerticalImageAlign(VerticalImageAlignEnum verticalImageAlign)
      Description copied from interface: JRImageAlignment
      Gets the image vertical alignment.
      Specified by:
      setVerticalImageAlign in interface JRImageAlignment
      Parameters:
      verticalImageAlign - a value representing one of the vertical image alignment constants in VerticalImageAlignEnum
    • isLazy

      public boolean isLazy()
    • setLazy

      public void setLazy(boolean isLazy)
    • getOnErrorType

      public OnErrorTypeEnum getOnErrorType()
    • setOnErrorType

      public void setOnErrorType(OnErrorTypeEnum onErrorType)
    • getHyperlinkType

      public HyperlinkTypeEnum getHyperlinkType()
      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:
    • 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:
    • getHyperlinkTarget

      public HyperlinkTargetEnum getHyperlinkTarget()
    • setHyperlinkTarget

      protected void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget)
    • getLinkTarget

      public 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(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 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(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 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(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
    • populateStyle

      public void populateStyle()
      Overrides:
      populateStyle in class JRTemplateGraphicElement