Package org.compiere.print.layout
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.compiere.print.layout.PrintElement
LINK_COLOR, log, p_FieldAlignmentType, p_height, p_maxHeight, p_maxWidth, p_pageLocation, p_sizeCalculated, p_width
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description ImageElement(int record_ID, boolean isAttachment)
Create Image from Attachment or ColumnImageElement(Image image)
Create from existing Image
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
calculateSize()
Calculate Image Size.static ImageElement
get(int AD_PrintFormatItem_ID)
Create Image from Attachmentstatic ImageElement
get(String imageURLString)
Create Image from URLstatic ImageElement
get(URL imageURL)
Create Image from URLstatic ImageElement
get(PrintDataElement data, String imageURLString)
Create Image from database columnImage
getImage()
Get the Imagedouble
getScaleFactor()
Get image scale factor.void
paint(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView)
Paint Image-
Methods inherited from class org.compiere.print.layout.PrintElement
getAbsoluteLocation, getBounds, getCurrentPage, getDetailInfo, getDrillAcross, getDrillDown, getHeight, getHeight, getLocation, getPageCount, getPageLogic, getPrintData, getRowIndex, getWidth, imageUpdate, isTranslated, layout, setCurrentPage, setLocation, setMaxHeight, setMaxWidth, setPageLogic, setPrintData, setRowIndex, toString, translate, waitForLoad
-
-
-
-
Constructor Detail
-
ImageElement
public ImageElement(Image image)
Create from existing Image- Parameters:
image
- image
-
ImageElement
public ImageElement(int record_ID, boolean isAttachment)
Create Image from Attachment or Column- Parameters:
record_ID
- record id from printformat or columnisAttachment
- flag to indicate if is attachment or is a column from DB
-
-
Method Detail
-
get
public static ImageElement get(String imageURLString)
Create Image from URL- Parameters:
imageURLString
- image url- Returns:
- image element
-
get
public static ImageElement get(URL imageURL)
Create Image from URL- Parameters:
imageURL
- image url- Returns:
- image element
-
get
public static ImageElement get(int AD_PrintFormatItem_ID)
Create Image from Attachment- Parameters:
AD_PrintFormatItem_ID
- record id- Returns:
- image element
-
get
public static ImageElement get(PrintDataElement data, String imageURLString)
Create Image from database column- Parameters:
data
- the printdataelement, containing the referenceimageURLString
- image url - containing just the AD_Image_ID reference- Returns:
- image element
-
calculateSize
protected boolean calculateSize()
Calculate Image Size. Set p_width and p_height- Specified by:
calculateSize
in classPrintElement
- Returns:
- true if calculated
-
getImage
public Image getImage()
Get the Image- Returns:
- image
-
getScaleFactor
public double getScaleFactor()
Get image scale factor. author teo_sarca - [ 1673548 ] Image is not scaled in a report table cell- Returns:
- scale factor
-
paint
public void paint(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView)
Paint Image- Specified by:
paint
in classPrintElement
- Parameters:
g2D
- GraphicspageStart
- top left Location of pagepageNo
- page number for multi page support (0 = header/footer) - ignoredctx
- print contextisView
- true if online view (IDs are links)
-
-