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
Image Element
- Version:
- $Id: ImageElement.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
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
ConstructorDescriptionImageElement
(int record_ID, boolean isAttachment) Create Image from Attachment or ColumnImageElement
(Image image) Create from existing Image -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Calculate Image Size.static ImageElement
get
(int AD_PrintFormatItem_ID) Create Image from Attachmentstatic ImageElement
Create Image from URLstatic ImageElement
Create Image from URLstatic ImageElement
get
(PrintDataElement data, String imageURLString) Create Image from database columngetImage()
Get the Imagedouble
Get image scale factor.void
paint
(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView) Paint ImageMethods 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 Details
-
ImageElement
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 Details
-
get
Create Image from URL- Parameters:
imageURLString
- image url- Returns:
- image element
-
get
Create Image from URL- Parameters:
imageURL
- image url- Returns:
- image element
-
get
Create Image from Attachment- Parameters:
AD_PrintFormatItem_ID
- record id- Returns:
- image element
-
get
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
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
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)
-