Class ImageElement

java.lang.Object
org.compiere.print.layout.PrintElement
org.compiere.print.layout.ImageElement
All Implemented Interfaces:
ImageObserver, Serializable

public class ImageElement extends PrintElement
Image Element
Version:
$Id: ImageElement.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Constructor Details

    • ImageElement

      public ImageElement(Image image)
      Create from existing Image
      Parameters:
      image - image
    • ImageElement

      public ImageElement(int record_ID, boolean isAttachment)
      Create Image element from print format item Attachment or AD_Image
      Parameters:
      record_ID - record id of print format item or AD_Image
      isAttachment - flag to indicate if is print format item attachment or is AD_Image
  • Method Details

    • get

      public static ImageElement get(String imageURLString)
      Create Image element from URL
      Parameters:
      imageURLString - image url
      Returns:
      image element
    • get

      public static ImageElement get(URL imageURL)
      Create Image element from URL
      Parameters:
      imageURL - image url
      Returns:
      image element
    • get

      public static ImageElement get(int AD_PrintFormatItem_ID)
      Create Image element from Attachment of a print format item record
      Parameters:
      AD_PrintFormatItem_ID - record id
      Returns:
      image element
    • get

      public static ImageElement get(PrintDataElement data, String imageURLString)
      Create Image element from AD_Image
      Parameters:
      data - the PrintDataElement, containing the reference to AD_Image
      imageURLString - ignore
      Returns:
      image element
    • calculateSize

      protected boolean calculateSize()
      Calculate Image Size.
      Set p_width and p_height.
      Specified by:
      calculateSize in class PrintElement
      Returns:
      true if calculated
    • getImage

      public Image getImage()
      Get the Image
      Returns:
      image
    • getScaleFactor

      public double getScaleFactor()
      Get image scale factor.
      Returns:
      scale factor
    • paint

      public void paint(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView)
      Paint Image
      Specified by:
      paint in class PrintElement
      Parameters:
      g2D - Graphics
      pageNo - page number for multi page support (0 = header/footer) - ignored
      pageStart - top left Location of page
      ctx - print context
      isView - true if online view (IDs are links)