Compiere 3.1

org.compiere.print.layout
Class ImageElement

java.lang.Object
  extended by org.compiere.print.layout.PrintElement
      extended by org.compiere.print.layout.ImageElement
All Implemented Interfaces:
ImageObserver

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

Field Summary
 
Fields inherited from class org.compiere.print.layout.PrintElement
LINK_COLOR, log, p_FieldAlignmentType, p_height, p_info, 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
ImageElement(Image image, String info)
          Create from existing Image
 
Method Summary
protected  boolean calculateSize()
          Calculate Image Size.
static ImageElement get(int AD_PrintFormatItem_ID)
          Create Image from Attachment
static ImageElement get(String imageURLString)
          Create Image from URL
static ImageElement get(URL imageURL)
          Create Image from URL
 Image getImage()
          Get the Image
 void paint(Graphics2D g2D, int pageNo, Point2D pageStart, Ctx ctx, boolean isView)
          Paint Image
 
Methods inherited from class org.compiere.print.layout.PrintElement
getAbsoluteLocation, getBounds, getDrillAcross, getDrillDown, getHeight, getHeight, getLocation, getPageCount, getWidth, imageUpdate, isTranslated, layout, setLocation, setMaxHeight, setMaxWidth, toString, translate, waitForLoad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageElement

public ImageElement(Image image,
                    String info)
Create from existing Image

Parameters:
image - image
optional - info
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

calculateSize

protected boolean calculateSize()
Calculate Image Size. Set p_width & p_height

Specified by:
calculateSize in class PrintElement
Returns:
true if calculated

getImage

public Image getImage()
Get the Image

Returns:
image

paint

public void paint(Graphics2D g2D,
                  int pageNo,
                  Point2D pageStart,
                  Ctx ctx,
                  boolean isView)
Paint Image

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

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.