Package net.sf.jasperreports.renderers
Interface Renderable
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
ImageMapRenderable,Renderable
- All Known Implementing Classes:
AbstractRenderer,AbstractRenderToImageAwareRenderer,AbstractRenderToImageDataRenderer,AbstractSvgDataToGraphics2DRenderer,AwtComponentRenderer,AwtComponentRendererImpl,BarbecueRenderer,BarbecueRendererImpl,BatikRenderer,DrawChartRenderer,DrawChartRendererImpl,JCommonDrawableRenderer,JCommonDrawableRendererImpl,JRAbstractRenderer,JRAbstractSvgRenderer,JRImageRenderer,JRSimpleImageMapRenderer,JRVirtualPrintPage.JRIdHolderRenderer,JRWrappingSvgRenderer,ResourceRenderer,SimpleDataRenderer,SimpleRenderToImageAwareDataRenderer,UnusedSpaceImageRenderer,WrappingDataToGraphics2DRenderer,WrappingDeprecatedRenderable,WrappingImageDataToGraphics2DRenderer,WrappingImageMapRenderable,WrappingRenderable,WrappingRenderToImageDataRenderer,WrappingSvgDataToGraphics2DRenderer
public interface Renderable extends java.io.SerializableProvides functionality for image rendering. The content of an image element can come either directly from an image file like a JPG, GIF, PNG, or can be a Scalable Vector Graphics (SVG) file that is rendered using some business logic or a special graphics API like a charting or a barcode library. Either way, JasperReports treats images in a very transparent way because it relies on a special interface calledRenderableto offer a common way to render images. TheGraphics2DRenderableinterface has a method calledGraphics2DRenderable.render(JasperReportsContext, Graphics2D, Rectangle2D), which gets called by the engine each time it needs to draw the image on a given device or graphic context. This approach provides the best quality for the SVG images when they must be drawn on unknown devices or zoomed into without losing sharpness. TheDataRenderableinterface has a method calledDataRenderable.getData(JasperReportsContext), which gets called by the engine each time it needs the actual image data either to embed it directly into the exported documents, or to use it to draw the image or the graphic onto a device or graphic context. When a renderable object provides only binary data, the engine uses wrapping renderable implementations to add rendering functionality to the source renderable object. On the other hand, when the renderable object provides only direct rendering functionality, the engine wraps it into special renderable implementations that would allow producing image data out of the source rendering routines. The library comes with a default implementation for theDataRenderableinterface that wraps images that come from files or binary image data in JPG, GIF, or PNG format. This is theSimpleDataRendererclass. For wrapping SVG data, theSimpleRenderToImageAwareDataRendereris better suited because it allows providing additional information about required resolution of the graphic, when converted to and image, as the engine needs to do that for certain document formats at export time. Image renderers are serializable because inside the generated document for each image is a renderer object kept as reference, which is serialized along with the whole JasperPrint object. When aSimpleDataRendererinstance is serialized, so is the binary image data it contains. However, if the image element must be lazy loaded (see theisLazyimage attribute), then the engine will not load the binary image data at report-filling time. Rather, it stores inside the renderer only thejava.lang.Stringlocation of the image. The actual image data is loaded only when needed for rendering at report-export or view time. Lazy image renderers are represented by the theResourceRendererimplementation and require the image data to be loaded at export time for certain export formats.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_IMAGE_DPISpecifies the image resolution in dots-per-inch, for the images created by the engine when rasterizing SVGs or when clipping other renderers.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetId()
-
-
-
Field Detail
-
PROPERTY_IMAGE_DPI
static final java.lang.String PROPERTY_IMAGE_DPI
Specifies the image resolution in dots-per-inch, for the images created by the engine when rasterizing SVGs or when clipping other renderers.- See Also:
- Constant Field Values
-
-