com.nordija.tapestry.bayeux.stream.jfreechart
Class JFreeChartResource

java.lang.Object
  extended by com.nordija.tapestry.bayeux.stream.jfreechart.JFreeChartResource
All Implemented Interfaces:
StreamResource
Direct Known Subclasses:
SimpleJFreeChartResource

public abstract class JFreeChartResource
extends java.lang.Object
implements StreamResource

This abstract class implements the writeTo(java.io.OutputStream) method so you don't have to concentrate on how to stream the actual chart. Use this if you are about to stream a JFreeChart.

Author:
Jacob von Eyben - Nordija A/S

Constructor Summary
JFreeChartResource(org.jfree.chart.JFreeChart chart)
           
 
Method Summary
 java.lang.String getContentType()
          Returns the content type matching the defined image format returned by getImageFormat()
abstract  int getHeight()
          The height of the streamed chart
abstract  java.lang.String getImageFormat()
          The image format of the chart.
abstract  int getWidth()
          The width of the streamed chart
 void writeTo(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.nordija.tapestry.bayeux.stream.StreamResource
getContentDisposition
 

Constructor Detail

JFreeChartResource

public JFreeChartResource(org.jfree.chart.JFreeChart chart)
Method Detail

getImageFormat

public abstract java.lang.String getImageFormat()

The image format of the chart. Can be one of the following:
ImageFormat.JPEG or ImageFormat.PNG

Returns:
a image format for the chart

getWidth

public abstract int getWidth()
The width of the streamed chart

Returns:
the width

getHeight

public abstract int getHeight()
The height of the streamed chart

Returns:
the height

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Specified by:
writeTo in interface StreamResource
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Returns the content type matching the defined image format returned by getImageFormat()

Specified by:
getContentType in interface StreamResource
Returns:
the content type for the jfree chart


Copyright © 2004-2007 Nordija A/S. All Rights Reserved.