TPTP 4.6.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.report.tools.internal
Class AbstractIImageProvider

java.lang.Object
  extended by org.eclipse.tptp.platform.report.tools.internal.AbstractIImageProvider
All Implemented Interfaces:
IDIImageProvider, IDisposable
Direct Known Subclasses:
AWTIImageProvider, SWTIImageProvider

Deprecated. As of TPTP 4.5.0, use the TPTP Business Intelligence and Reporting Tools (BIRT) reporting infrastructure (org.eclipse.tptp.platform.report.birt).

public abstract class AbstractIImageProvider
extends java.lang.Object
implements IDIImageProvider

Implementation of IDIImageProvider definiting common behaviour for image search path (url, class path for image resources ...). This class must be subclassed to create IImage for the underlaygin graphic system with "real images" (ie: SWT or AWT, ... ).


Field Summary
protected  IImage brokenImage
          Deprecated. current broken image, can be null before first getBrokenImage() call
 
Constructor Summary
AbstractIImageProvider()
          Deprecated.  
 
Method Summary
 void addImageSearchPath(java.lang.String path)
          Deprecated. Add a search path for images for search in file system, only if search path isn't already in.
 void addResourceClass(java.lang.Class c)
          Deprecated. Add a new class to get image from it's resources (do not include if class i already in)
 void clear()
          Deprecated. Clear this object, do a full dispose of contained images, and clear search path and resources classes.
 void clearImageSearchPath()
          Deprecated. Clear current search path.
protected abstract  IImage createBrokenImage()
          Deprecated. Create and return the broken image, must not return null image in any way (at least create in memory image, a red tiny rectangle for example).
protected abstract  IImage createImageFromFile(java.lang.String filename)
          Deprecated.  
protected abstract  IImage createImageFromInputStream(java.io.InputStream is)
          Deprecated.  
 void dispose()
          Deprecated. Dispose all image resource (including broken image) held by this image provider, do not forget to call this method else you'll become under hand of the "no more handle" crash...
protected abstract  void disposeImage(IImage image)
          Deprecated. called to dispose any resource system associated with image
 IImage getBrokenImage()
          Deprecated.  
 IImage getImage(java.lang.String name)
          Deprecated. Return image, first look into current image pool, then try to get image from an url, or try from search path, file system, in the worst case return the broken image.
 void removeImageSearchPath(java.lang.String path)
          Deprecated. Remove a search path for images for search in file system.
 boolean removeResourceClass(java.lang.Class c)
          Deprecated. Remove a class from the resources classes.
 java.lang.String searchImage(java.lang.String ip)
          Deprecated.  
 void setBrokenImage(IImage image)
          Deprecated. Change current broken image, disposing current one before.
 void setImage(java.lang.String name, IImage image)
          Deprecated. sets an image into the image provider with its associated name.
 void setImageSearchPath(java.lang.String[] paths)
          Deprecated. Change current search path for images, used to get image in file system.
 IImage takeImage(java.lang.String name)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

brokenImage

protected IImage brokenImage
Deprecated. 
current broken image, can be null before first getBrokenImage() call

Constructor Detail

AbstractIImageProvider

public AbstractIImageProvider()
Deprecated. 
Method Detail

createBrokenImage

protected abstract IImage createBrokenImage()
Deprecated. 
Create and return the broken image, must not return null image in any way (at least create in memory image, a red tiny rectangle for example).


createImageFromFile

protected abstract IImage createImageFromFile(java.lang.String filename)
Deprecated. 
Returns:
new IImage for the given file name, or null if image can't be loaded. This method must never return broken image.

createImageFromInputStream

protected abstract IImage createImageFromInputStream(java.io.InputStream is)
Deprecated. 
Returns:
new IImage for the given input stream, or null if image can't be loaded. This method must never return broken image.

disposeImage

protected abstract void disposeImage(IImage image)
Deprecated. 
called to dispose any resource system associated with image


getBrokenImage

public IImage getBrokenImage()
Deprecated. 
Specified by:
getBrokenImage in interface IDIImageProvider
Returns:
the image used when other image aren't found.

setBrokenImage

public void setBrokenImage(IImage image)
Deprecated. 
Change current broken image, disposing current one before. After this call broken imag is under the control of image provider, do not dispose it, image provide will do.

Specified by:
setBrokenImage in interface IDIImageProvider

getImage

public IImage getImage(java.lang.String name)
Deprecated. 
Return image, first look into current image pool, then try to get image from an url, or try from search path, file system, in the worst case return the broken image. This means you don't have to dispose returned image, but the creator of DImageProvider must do this calling IDIImageProvider.dispose(). If animage is found, put it in current image pool, next time it will be faster...

Specified by:
getImage in interface IDIImageProvider
Returns:
image, first look into current image pool, then try to get image from an url, or try from search path, file system, in the worst case return the broken image. This means you don't have to dispose returned image, but the creator of DImageProvider must do this calling IDImageProvider.dispose(). If an image is found, put it in current image pool, next time it will be faster...

takeImage

public IImage takeImage(java.lang.String name)
Deprecated. 
Specified by:
takeImage in interface IDIImageProvider
Returns:
Image currently stored in image pool, remove this image from pool. After this the caller have the responsability to dispose taken image. (as image is no longer in image pool image provider can't dispose it). Return null if image isn't in pool...

searchImage

public java.lang.String searchImage(java.lang.String ip)
Deprecated. 
Specified by:
searchImage in interface IDIImageProvider
Returns:
real file name for given image name using search path list, file must exist on file system.

dispose

public void dispose()
Deprecated. 
Dispose all image resource (including broken image) held by this image provider, do not forget to call this method else you'll become under hand of the "no more handle" crash...

Specified by:
dispose in interface IDIImageProvider
Specified by:
dispose in interface IDisposable

clear

public void clear()
Deprecated. 
Clear this object, do a full dispose of contained images, and clear search path and resources classes.

Specified by:
clear in interface IDIImageProvider

setImageSearchPath

public void setImageSearchPath(java.lang.String[] paths)
Deprecated. 
Change current search path for images, used to get image in file system. set paths to null, clear current search path.

Specified by:
setImageSearchPath in interface IDIImageProvider

clearImageSearchPath

public void clearImageSearchPath()
Deprecated. 
Clear current search path.

Specified by:
clearImageSearchPath in interface IDIImageProvider

addImageSearchPath

public void addImageSearchPath(java.lang.String path)
Deprecated. 
Add a search path for images for search in file system, only if search path isn't already in.

Specified by:
addImageSearchPath in interface IDIImageProvider

removeImageSearchPath

public void removeImageSearchPath(java.lang.String path)
Deprecated. 
Remove a search path for images for search in file system.

Specified by:
removeImageSearchPath in interface IDIImageProvider

addResourceClass

public void addResourceClass(java.lang.Class c)
Deprecated. 
Add a new class to get image from it's resources (do not include if class i already in)

Specified by:
addResourceClass in interface IDIImageProvider
See Also:
Class.getResourceAsStream(java.lang.String)

removeResourceClass

public boolean removeResourceClass(java.lang.Class c)
Deprecated. 
Remove a class from the resources classes.

Specified by:
removeResourceClass in interface IDIImageProvider
Returns:
true if class was removed, false otherwise.

setImage

public void setImage(java.lang.String name,
                     IImage image)
Deprecated. 
Description copied from interface: IDIImageProvider
sets an image into the image provider with its associated name. If the name already exists into the image provider the old image will be replaced by the new one.

Specified by:
setImage in interface IDIImageProvider
See Also:
IDIImageProvider.setImage(java.lang.String, org.eclipse.tptp.platform.report.igc.internal.IImage)

TPTP 4.6.0 Platform Project
Internal API Specification