public class BatikRenderer extends JRAbstractSvgRenderer implements ImageMapRenderable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BatikRenderer.JRUserAgent |
PROPERTY_IMAGE_DPIIMAGE_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| Modifier | Constructor and Description |
|---|---|
|
BatikRenderer(byte[] svgData,
List<JRPrintImageAreaHyperlink> areaHyperlinks)
Creates a SVG renderer.
|
protected |
BatikRenderer(List<JRPrintImageAreaHyperlink> areaHyperlinks) |
|
BatikRenderer(String svgText,
List<JRPrintImageAreaHyperlink> areaHyperlinks)
Creates a SVG renderer.
|
| Modifier and Type | Method and Description |
|---|---|
protected Graphics2D |
createGraphics(BufferedImage bi) |
protected void |
ensureData()
Deprecated.
Replaced by
ensureData(JasperReportsContext). |
protected void |
ensureData(JasperReportsContext jasperReportsContext) |
protected void |
ensureSvg()
Deprecated.
Replaced by
ensureSvg(JasperReportsContext). |
protected void |
ensureSvg(JasperReportsContext jasperReportsContext) |
Dimension2D |
getDimension()
Deprecated.
Replaced by
getDimension(JasperReportsContext). |
Dimension2D |
getDimension(JasperReportsContext jasperReportsContext) |
List<JRPrintImageAreaHyperlink> |
getImageAreaHyperlinks(Rectangle2D renderingArea)
Returns the list of
image map areas. |
protected int |
getImageDataDPI(JasperReportsContext jasperReportsContext) |
static BatikRenderer |
getInstance(byte[] svgData)
Creates a SVG renderer from binary data.
|
static BatikRenderer |
getInstance(File svgFile)
Creates a SVG renderer from a file.
|
static BatikRenderer |
getInstance(InputStream svgDataStream)
Creates a SVG renderer from a data stream.
|
static BatikRenderer |
getInstance(URL svgURL)
Creates a SVG renderer from a
URL. |
static BatikRenderer |
getInstanceFromLocation(JasperReportsContext jasperReportsContext,
String location)
Creates a SVG renderer by loading data from a generic location.
|
static BatikRenderer |
getInstanceFromLocation(String location)
Deprecated.
|
static BatikRenderer |
getInstanceFromLocation(String location,
ClassLoader classLoader,
URLStreamHandlerFactory urlHandlerFactory,
FileResolver fileResolver)
Deprecated.
Replaced by
getInstanceFromLocation(String). |
static BatikRenderer |
getInstanceFromText(String svgText)
Creates a SVG renderer from SVG text.
|
static BatikRenderer |
getLocationInstance(String location)
Creates a lazily loaded SVG renderer for a location.
|
int |
getMinDPI() |
boolean |
hasImageAreaHyperlinks()
Indicates whether the renderer actually includes any image map areas.
|
boolean |
isAntiAlias() |
void |
render(Graphics2D grx,
Rectangle2D rectangle)
Deprecated.
|
void |
render(JasperReportsContext jasperReportsContext,
Graphics2D grx,
Rectangle2D rectangle) |
List<JRPrintImageAreaHyperlink> |
renderWithHyperlinks(Graphics2D grx,
Rectangle2D rectangle)
Deprecated.
To be removed.
|
void |
setAntiAlias(boolean antiAlias) |
void |
setMinDPI(int minDPI) |
protected void |
setSvgDataLocation(String svgDataLocation) |
getBackcolor, getImageData, getImageData, getImageType, getImageTypeValue, getType, getTypeValuegetIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetId, getImageData, getImageTypeValue, getTypeValuegetImageData, getImageType, getTypeprotected BatikRenderer(List<JRPrintImageAreaHyperlink> areaHyperlinks)
public BatikRenderer(String svgText, List<JRPrintImageAreaHyperlink> areaHyperlinks)
svgText - the SVG textareaHyperlinks - a list of area hyperlinkspublic BatikRenderer(byte[] svgData,
List<JRPrintImageAreaHyperlink> areaHyperlinks)
svgData - the SVG (binary) dataareaHyperlinks - a list of area hyperlinkspublic void render(Graphics2D grx, Rectangle2D rectangle) throws JRException
render(JasperReportsContext, Graphics2D, Rectangle2D).render in interface JRRenderableJRExceptionpublic void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) throws JRException
render in interface Renderablerender in class JRAbstractRendererJRExceptionpublic Dimension2D getDimension(JasperReportsContext jasperReportsContext)
getDimension in interface RenderablegetDimension in class JRAbstractSvgRendererpublic Dimension2D getDimension()
getDimension(JasperReportsContext).getDimension in interface JRRenderablegetDimension in class JRAbstractSvgRendererprotected void ensureData(JasperReportsContext jasperReportsContext) throws JRException
JRExceptionprotected void ensureData()
throws JRException
ensureData(JasperReportsContext).JRExceptionprotected void ensureSvg(JasperReportsContext jasperReportsContext) throws JRException
JRExceptionprotected void ensureSvg()
throws JRException
ensureSvg(JasperReportsContext).JRExceptionpublic List<JRPrintImageAreaHyperlink> renderWithHyperlinks(Graphics2D grx, Rectangle2D rectangle) throws JRException
JRImageMapRendererimage map areas.renderWithHyperlinks in interface JRImageMapRendererrectangle - the area on which the image would be renderedJRPrintImageAreaHyperlink instances.JRExceptionpublic List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
ImageMapRenderableimage map areas.getImageAreaHyperlinks in interface ImageMapRenderablegetImageAreaHyperlinks in interface JRImageMapRendererrenderingArea - the area on which the image would be renderedJRPrintImageAreaHyperlink instances.JRExceptionpublic boolean hasImageAreaHyperlinks()
ImageMapRenderablehasImageAreaHyperlinks in interface ImageMapRenderablehasImageAreaHyperlinks in interface JRImageMapRendererprotected Graphics2D createGraphics(BufferedImage bi)
createGraphics in class JRAbstractSvgRendererprotected void setSvgDataLocation(String svgDataLocation)
public static BatikRenderer getInstance(byte[] svgData)
svgData - the SVG (binary) datapublic static BatikRenderer getInstance(InputStream svgDataStream) throws JRException
Note: the data stream is exhausted, but not closed.
svgDataStream - the SVG binary data streamJRExceptionpublic static BatikRenderer getInstance(File svgFile) throws JRException
svgFile - the SVG file to readJRExceptionpublic static BatikRenderer getInstance(URL svgURL) throws JRException
URL.svgURL - the SVG URLJRExceptionpublic static BatikRenderer getInstanceFromText(String svgText) throws JRException
svgText - the SVG textJRExceptionpublic static BatikRenderer getInstanceFromLocation(String location) throws JRException
getInstanceFromLocation(JasperReportsContext, String).location - the locationJRExceptionRepositoryUtil.getBytes(String)public static BatikRenderer getInstanceFromLocation(JasperReportsContext jasperReportsContext, String location) throws JRException
location - the locationJRExceptionRepositoryUtil.getBytes(String)public static BatikRenderer getInstanceFromLocation(String location, ClassLoader classLoader, URLStreamHandlerFactory urlHandlerFactory, FileResolver fileResolver) throws JRException
getInstanceFromLocation(String).location - the locationclassLoader - the classloader to be used to resolve resourcesurlHandlerFactory - the URL handler factory used to resolve URLsfileResolver - the file resolverJRExceptionJRLoader.loadBytesFromLocation(String, ClassLoader, URLStreamHandlerFactory, FileResolver)public static BatikRenderer getLocationInstance(String location) throws JRException
The returned renderer loads the SVG data lazily, i.e. only when the data
is actually required (which is at the first
render(Graphics2D, Rectangle2D)}.
location - the SVG locationJRExceptionprotected int getImageDataDPI(JasperReportsContext jasperReportsContext)
getImageDataDPI in class JRAbstractSvgRendererpublic int getMinDPI()
public void setMinDPI(int minDPI)
public boolean isAntiAlias()
public void setAntiAlias(boolean antiAlias)
Copyright © 2012. All Rights Reserved.