net.sf.jasperreports.engine
Class JRImageRenderer

java.lang.Object
  extended by net.sf.jasperreports.engine.JRAbstractRenderer
      extended by net.sf.jasperreports.engine.JRImageRenderer
All Implemented Interfaces:
java.io.Serializable, JRRenderable
Direct Known Subclasses:
JRSimpleImageMapRenderer

public class JRImageRenderer
extends JRAbstractRenderer

Version:
$Id: JRImageRenderer.java 3033 2009-08-27 11:46:22Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface net.sf.jasperreports.engine.JRRenderable
IMAGE_TYPE_GIF, IMAGE_TYPE_JPEG, IMAGE_TYPE_PNG, IMAGE_TYPE_TIFF, IMAGE_TYPE_UNKNOWN, MIME_TYPE_GIF, MIME_TYPE_JPEG, MIME_TYPE_PNG, MIME_TYPE_TIFF, TYPE_IMAGE, TYPE_SVG
 
Constructor Summary
protected JRImageRenderer(byte[] imageData)
           
protected JRImageRenderer(java.lang.String imageLocation)
           
 
Method Summary
static java.lang.ClassLoader getClassLoader()
          Deprecated. replaced by JRResourcesUtil.getThreadClassLoader()
 java.awt.geom.Dimension2D getDimension()
           
 java.awt.Image getImage()
           
 byte[] getImageData()
           
 java.lang.String getImageLocation()
           
 byte getImageType()
           
static JRImageRenderer getInstance(byte[] imageData)
           
static JRRenderable getInstance(java.io.File file, byte onErrorType)
           
static JRRenderable getInstance(java.awt.Image img, byte onErrorType)
           
static JRRenderable getInstance(java.awt.Image image, byte imageType, byte onErrorType)
          Creates and returns an instance of the JRImageRenderer class after encoding the image object using an image encoder that supports the supplied image type.
static JRRenderable getInstance(java.io.InputStream is, byte onErrorType)
           
static JRRenderable getInstance(java.lang.String imageLocation)
           
static JRRenderable getInstance(java.lang.String imageLocation, byte onErrorType)
           
static JRRenderable getInstance(java.lang.String imageLocation, byte onErrorType, boolean isLazy)
           
static JRRenderable getInstance(java.lang.String imageLocation, byte onErrorType, boolean isLazy, java.lang.ClassLoader classLoader, java.net.URLStreamHandlerFactory urlHandlerFactory, FileResolver fileResolver)
           
static JRRenderable getInstance(java.net.URL url, byte onErrorType)
           
static JRRenderable getOnErrorRendererForDimension(JRRenderable renderer, byte onErrorType)
           
static JRImageRenderer getOnErrorRendererForImage(JRImageRenderer renderer, byte onErrorType)
           
static JRRenderable getOnErrorRendererForImageData(JRRenderable renderer, byte onErrorType)
           
 byte getType()
           
 void render(java.awt.Graphics2D grx, java.awt.geom.Rectangle2D rectangle)
           
static void setClassLoader(java.lang.ClassLoader classLoader)
          Deprecated. replace by JRResourcesUtil.setThreadClassLoader(ClassLoader)
 
Methods inherited from class net.sf.jasperreports.engine.JRAbstractRenderer
getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRImageRenderer

protected JRImageRenderer(byte[] imageData)

JRImageRenderer

protected JRImageRenderer(java.lang.String imageLocation)
Method Detail

getClassLoader

public static java.lang.ClassLoader getClassLoader()
Deprecated. replaced by JRResourcesUtil.getThreadClassLoader()


setClassLoader

public static void setClassLoader(java.lang.ClassLoader classLoader)
Deprecated. replace by JRResourcesUtil.setThreadClassLoader(ClassLoader)


getInstance

public static JRImageRenderer getInstance(byte[] imageData)

getInstance

public static JRRenderable getInstance(java.lang.String imageLocation)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.lang.String imageLocation,
                                       byte onErrorType)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.lang.String imageLocation,
                                       byte onErrorType,
                                       boolean isLazy)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.lang.String imageLocation,
                                       byte onErrorType,
                                       boolean isLazy,
                                       java.lang.ClassLoader classLoader,
                                       java.net.URLStreamHandlerFactory urlHandlerFactory,
                                       FileResolver fileResolver)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.awt.Image img,
                                       byte onErrorType)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.awt.Image image,
                                       byte imageType,
                                       byte onErrorType)
                                throws JRException
Creates and returns an instance of the JRImageRenderer class after encoding the image object using an image encoder that supports the supplied image type.

Parameters:
image - the java.awt.Image object to wrap into a JRImageRenderer instance
imageType - the type of the image as specified by one of the constants defined in the JRRenderable interface
onErrorType - one of the error type constants defined in the JRImage interface
Returns:
the image renderer instance
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.io.InputStream is,
                                       byte onErrorType)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.net.URL url,
                                       byte onErrorType)
                                throws JRException
Throws:
JRException

getInstance

public static JRRenderable getInstance(java.io.File file,
                                       byte onErrorType)
                                throws JRException
Throws:
JRException

getOnErrorRendererForDimension

public static JRRenderable getOnErrorRendererForDimension(JRRenderable renderer,
                                                          byte onErrorType)
                                                   throws JRException
Throws:
JRException

getOnErrorRendererForImageData

public static JRRenderable getOnErrorRendererForImageData(JRRenderable renderer,
                                                          byte onErrorType)
                                                   throws JRException
Throws:
JRException

getOnErrorRendererForImage

public static JRImageRenderer getOnErrorRendererForImage(JRImageRenderer renderer,
                                                         byte onErrorType)
                                                  throws JRException
Throws:
JRException

getImage

public java.awt.Image getImage()
                        throws JRException
Throws:
JRException

getImageLocation

public java.lang.String getImageLocation()

getType

public byte getType()

getImageType

public byte getImageType()

getDimension

public java.awt.geom.Dimension2D getDimension()
                                       throws JRException
Throws:
JRException

getImageData

public byte[] getImageData()
                    throws JRException
Throws:
JRException

render

public void render(java.awt.Graphics2D grx,
                   java.awt.geom.Rectangle2D rectangle)
            throws JRException
Throws:
JRException


© 2001-2009 Jaspersoft Corporation www.jaspersoft.com