org.jCharts.encoders
Class ServletEncoderHelper

java.lang.Object
  |
  +--org.jCharts.encoders.ServletEncoderHelper

public class ServletEncoderHelper
extends java.lang.Object


Field Summary
static java.lang.String JPEG_MIME_TYPE
           
static java.lang.String PNG_MIME_TYPE
           
static java.lang.String SVG_MIME_TYPE
           
 
Constructor Summary
ServletEncoderHelper()
           
 
Method Summary
static void encodeJPEG(Chart chart, float quality, javax.servlet.http.HttpServletResponse httpServletResponse)
          Convenience method to call from a Servlet or JSP.
static void encodeJPEG13(Chart chart, float quality, javax.servlet.http.HttpServletResponse httpServletResponse)
          Convenience method to call from a Servlet or JSP.
static void encodePNG(Chart chart, javax.servlet.http.HttpServletResponse httpServletResponse)
          Convenience method to call from a Servlet or JSP.
static void encodeServlet(Chart chart, javax.servlet.http.HttpServletResponse httpServletResponse)
          Convenience method to call from a Servlet or JSP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SVG_MIME_TYPE

public static final java.lang.String SVG_MIME_TYPE
See Also:
Constant Field Values

PNG_MIME_TYPE

public static final java.lang.String PNG_MIME_TYPE
See Also:
Constant Field Values

JPEG_MIME_TYPE

public static final java.lang.String JPEG_MIME_TYPE
See Also:
Constant Field Values
Constructor Detail

ServletEncoderHelper

public ServletEncoderHelper()
Method Detail

encodeServlet

public static final void encodeServlet(Chart chart,
                                       javax.servlet.http.HttpServletResponse httpServletResponse)
                                throws ChartDataException,
                                       PropertyException,
                                       java.io.IOException
Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response. We cannot overload encode(...) as it will create a compile time dependency with the HttpServletResponse Class which will require the J2EE libraries.

Parameters:
chart -
httpServletResponse -
Throws:
ChartDataException
PropertyException
java.io.IOException
Since:
0.7

encodeJPEG13

public static final void encodeJPEG13(Chart chart,
                                      float quality,
                                      javax.servlet.http.HttpServletResponse httpServletResponse)
                               throws ChartDataException,
                                      PropertyException,
                                      java.io.IOException
Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response. We cannot overload encode(...) as it will create a compile time dependency with the HttpServletResponse Class which will require the J2EE libraries.

Parameters:
chart -
quality - float value from 0.0f(worst image quality) - 1.0f(best image quality)
httpServletResponse -
Throws:
ChartDataException
PropertyException
java.io.IOException
Since:
0.7

encodeJPEG

public static final void encodeJPEG(Chart chart,
                                    float quality,
                                    javax.servlet.http.HttpServletResponse httpServletResponse)
                             throws ChartDataException,
                                    PropertyException,
                                    java.io.IOException
Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response.

Parameters:
chart -
quality - float value from 0.0f(worst image quality) - 1.0f(best image quality)
httpServletResponse -
Throws:
ChartDataException
PropertyException
java.io.IOException

encodePNG

public static final void encodePNG(Chart chart,
                                   javax.servlet.http.HttpServletResponse httpServletResponse)
                            throws ChartDataException,
                                   PropertyException,
                                   java.io.IOException
Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response.

Parameters:
chart -
httpServletResponse -
Throws:
ChartDataException
PropertyException
java.io.IOException