org.eclipse.birt.report.engine.api
Class HTMLCompleteImageHandler

java.lang.Object
  extended byorg.eclipse.birt.report.engine.api.HTMLImageHandler
      extended byorg.eclipse.birt.report.engine.api.HTMLCompleteImageHandler
All Implemented Interfaces:
IHTMLImageHandler

public class HTMLCompleteImageHandler
extends HTMLImageHandler

Default implementation for writing images in a form that is compatible with a web browser's "HTML Complete" save option, i.e., writes images to a predefined folder. ImageDirectory: absolute path save the image into that directy, return the aboluste URL of that image. ImageDirectory: null, treat it as "." ImageDirectory: relative relative to the base folder. BaseFolder: parent folder of the output file, save the file into image directory and return the relative path (base on the base folder). BaseFolder:null, use "." as the base folder and return the aboluste path,


Field Summary
protected  java.util.logging.Logger log
           
 
Constructor Summary
HTMLCompleteImageHandler()
          dummy constructor
 
Method Summary
protected  java.io.File createUniqueFile(java.lang.String imageDir, java.lang.String prefix, java.lang.String postfix)
          creates a unique tempoary file to store an image
protected  java.lang.String getImageMapID(IImage image)
          returns the unique identifier for the image
protected  java.lang.String handleImage(IImage image, java.lang.Object context, java.lang.String prefix, boolean needMap)
          handles an image report item and returns an image URL
 java.lang.String onCustomImage(IImage image, java.lang.Object context)
          handles a custom image created for example, by chart extension.
 java.lang.String onDesignImage(IImage image, java.lang.Object context)
          handles a design image.
 java.lang.String onDocImage(IImage image, java.lang.Object context)
          handles a database image.
 java.lang.String onFileImage(IImage image, java.lang.Object context)
          handles a image specified as a on-disk URI.
 java.lang.String onURLImage(IImage image, java.lang.Object context)
          handles an image specified as an external URL.
 
Methods inherited from class org.eclipse.birt.report.engine.api.HTMLImageHandler
addCachedImage, getCachedImage, getRenderContext, onCustomImage, onDesignImage, onDocImage, onFileImage, onURLImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected java.util.logging.Logger log
Constructor Detail

HTMLCompleteImageHandler

public HTMLCompleteImageHandler()
dummy constructor

Method Detail

onDesignImage

public java.lang.String onDesignImage(IImage image,
                                      java.lang.Object context)
Description copied from interface: IHTMLImageHandler
handles a design image. The implementation supplies a URL and optionally stores the image.

Specified by:
onDesignImage in interface IHTMLImageHandler
Overrides:
onDesignImage in class HTMLImageHandler

onDocImage

public java.lang.String onDocImage(IImage image,
                                   java.lang.Object context)
Description copied from interface: IHTMLImageHandler
handles a database image. The implementation supplies a URL and optionally stores the image.

Specified by:
onDocImage in interface IHTMLImageHandler
Overrides:
onDocImage in class HTMLImageHandler

onURLImage

public java.lang.String onURLImage(IImage image,
                                   java.lang.Object context)
Description copied from interface: IHTMLImageHandler
handles an image specified as an external URL. The implementation supplies a URL and optionally stores the image.

Specified by:
onURLImage in interface IHTMLImageHandler
Overrides:
onURLImage in class HTMLImageHandler

onCustomImage

public java.lang.String onCustomImage(IImage image,
                                      java.lang.Object context)
Description copied from interface: IHTMLImageHandler
handles a custom image created for example, by chart extension. The implementation supplies a URL and optionally stores the image.

Specified by:
onCustomImage in interface IHTMLImageHandler
Overrides:
onCustomImage in class HTMLImageHandler

createUniqueFile

protected java.io.File createUniqueFile(java.lang.String imageDir,
                                        java.lang.String prefix,
                                        java.lang.String postfix)
creates a unique tempoary file to store an image

Parameters:
imageDir - directory to put image into
prefix - file name prefix
postfix - file name postfix
Returns:
a Java File Object

onFileImage

public java.lang.String onFileImage(IImage image,
                                    java.lang.Object context)
Description copied from interface: IHTMLImageHandler
handles a image specified as a on-disk URI. The implementation supplies a URL and optionally stores the image.

Specified by:
onFileImage in interface IHTMLImageHandler
Overrides:
onFileImage in class HTMLImageHandler

handleImage

protected java.lang.String handleImage(IImage image,
                                       java.lang.Object context,
                                       java.lang.String prefix,
                                       boolean needMap)
handles an image report item and returns an image URL

Parameters:
image - represents the image design information
context - context information
prefix - image prefix in URL
needMap - whether image map is needed
Returns:
URL for the image

getImageMapID

protected java.lang.String getImageMapID(IImage image)
returns the unique identifier for the image

Parameters:
image - the image object
Returns:
the image id


Copyright © 2005 Actuate Corp. All rights reserved.