org.wicketstuff.jasperreports
Class JRImageResource

java.lang.Object
  extended by org.apache.wicket.request.resource.AbstractResource
      extended by org.wicketstuff.jasperreports.JRResource
          extended by org.wicketstuff.jasperreports.JRImageResource
All Implemented Interfaces:
Serializable, org.apache.wicket.request.resource.IResource

public final class JRImageResource
extends JRResource

Resource class for jasper reports PDF resources.

Author:
Eelco Hillenius
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.AbstractResource.ResourceResponse, org.apache.wicket.request.resource.AbstractResource.WriteCallback
 
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
org.apache.wicket.request.resource.IResource.Attributes
 
Constructor Summary
JRImageResource()
          Construct without a report.
JRImageResource(File report)
          Construct.
JRImageResource(InputStream report)
          Construct.
JRImageResource(URL report)
          Construct.
 
Method Summary
 String getContentType()
           
protected  byte[] getExporterData(net.sf.jasperreports.engine.JasperPrint print, net.sf.jasperreports.engine.JRAbstractExporter exporter)
           
 String getExtension()
          Returns the extension for the resource's file.
 String getFormat()
          Gets the image type.
 int getType()
          Gets type of image (one of BufferedImage.TYPE_*).
 float getZoomRatio()
          Gets the zoom ratio.
 net.sf.jasperreports.engine.JRAbstractExporter newExporter()
          Called by getData to obtain an exporter instance.
 void setFormat(String format)
          Sets the image type.
 void setType(int type)
          Sets type of image (one of BufferedImage.TYPE_*).
 void setZoomRatio(float ratio)
          Sets the zoom ratio.
protected  byte[] toImageData(BufferedImage image)
           
 
Methods inherited from class org.wicketstuff.jasperreports.JRResource
getConnectionProvider, getContentDisposition, getFileName, getJasperReport, getReportDataSource, getReportParameters, newJasperPrint, newResourceResponse, setConnectionProvider, setFileName, setJasperReport, setReportDataSource, setReportParameters
 
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, respond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRImageResource

public JRImageResource()
Construct without a report. You must provide a report before you can use this resource.


JRImageResource

public JRImageResource(InputStream report)
Construct.

Parameters:
report - the report input stream

JRImageResource

public JRImageResource(URL report)
Construct.

Parameters:
report - the report input stream

JRImageResource

public JRImageResource(File report)
Construct.

Parameters:
report - the report input stream
Method Detail

newExporter

public final net.sf.jasperreports.engine.JRAbstractExporter newExporter()
Description copied from class: JRResource
Called by getData to obtain an exporter instance.

Specified by:
newExporter in class JRResource
Returns:
an exporter instance
See Also:
JRResource.newExporter()

getExporterData

protected byte[] getExporterData(net.sf.jasperreports.engine.JasperPrint print,
                                 net.sf.jasperreports.engine.JRAbstractExporter exporter)
                          throws net.sf.jasperreports.engine.JRException
Overrides:
getExporterData in class JRResource
Throws:
net.sf.jasperreports.engine.JRException

toImageData

protected byte[] toImageData(BufferedImage image)
Parameters:
image - The image to turn into data
Returns:
The image data for this dynamic image

getContentType

public String getContentType()
Specified by:
getContentType in class JRResource
Returns:
The content type of the reports
See Also:
JRResource.getContentType()

getZoomRatio

public float getZoomRatio()
Gets the zoom ratio.

Returns:
the zoom ratio used for the export. The default value is 1

setZoomRatio

public void setZoomRatio(float ratio)
Sets the zoom ratio.

Parameters:
ratio - the zoom ratio used for the export. The default value is 1

getFormat

public String getFormat()
Gets the image type.

Returns:
the image type. The default value is 'png'

setFormat

public void setFormat(String format)
Sets the image type.

Parameters:
format - the image type. The default value is 'png'

getType

public int getType()
Gets type of image (one of BufferedImage.TYPE_*).

Returns:
type of image

setType

public void setType(int type)
Sets type of image (one of BufferedImage.TYPE_*).

Parameters:
type - type of image

getExtension

public String getExtension()
Description copied from class: JRResource
Returns the extension for the resource's file. This string should not contain the leading "."

Specified by:
getExtension in class JRResource
Returns:
The extension for the resource's file.
See Also:
JRResource.getExtension()


Copyright © 2005-2011 Wicket developers. All Rights Reserved.