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 element from print format item Attachment or AD_ImageImageElement
(Image image) Create from existing Image -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Calculate Image Size.
Set p_width and p_height.static ImageElement
get
(int AD_PrintFormatItem_ID) Create Image element from Attachment of a print format item recordstatic ImageElement
Create Image element from URLstatic ImageElement
Create Image element from URLstatic ImageElement
get
(PrintDataElement data, String imageURLString) Create Image element from AD_ImagegetImage()
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 element from print format item Attachment or AD_Image- Parameters:
record_ID
- record id of print format item or AD_ImageisAttachment
- flag to indicate if is print format item attachment or is AD_Image
-
-
Method Details
-
get
Create Image element from URL- Parameters:
imageURLString
- image url- Returns:
- image element
-
get
Create Image element from URL- Parameters:
imageURL
- image url- Returns:
- image element
-
get
Create Image element from Attachment of a print format item record- Parameters:
AD_PrintFormatItem_ID
- record id- Returns:
- image element
-
get
Create Image element from AD_Image- Parameters:
data
- the PrintDataElement, containing the reference to AD_ImageimageURLString
- ignore- 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.- Returns:
- scale factor
-
paint
Paint Image- Specified by:
paint
in classPrintElement
- Parameters:
g2D
- GraphicspageNo
- page number for multi page support (0 = header/footer) - ignoredpageStart
- top left Location of pagectx
- print contextisView
- true if online view (IDs are links)
-