com.opensymphony.webwork.dispatcher
Class ChartResult

java.lang.Object
  extended bycom.opensymphony.webwork.dispatcher.ChartResult
All Implemented Interfaces:
com.opensymphony.xwork.Result, Serializable

public class ChartResult
extends Object
implements com.opensymphony.xwork.Result

A custom Result type for chart data. Built on top of JFreeChart. When executed this Result will write the given chart as a PNG to the servlet output stream.

Author:
Bernard Choi
See Also:
Serialized Form

Constructor Summary
ChartResult()
           
 
Method Summary
 void execute(com.opensymphony.xwork.ActionInvocation invocation)
          Executes the result.
 void setChart(org.jfree.chart.JFreeChart chart)
          Sets the JFreeChart to use.
 void setHeight(int height)
          Sets the chart height.
 void setWidth(int width)
          Sets the chart width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartResult

public ChartResult()
Method Detail

setChart

public void setChart(org.jfree.chart.JFreeChart chart)
Sets the JFreeChart to use.

Parameters:
chart - a JFreeChart object.

setHeight

public void setHeight(int height)
Sets the chart height.

Parameters:
height - the height of the chart in pixels.

setWidth

public void setWidth(int width)
Sets the chart width.

Parameters:
width - the width of the chart in pixels.

execute

public void execute(com.opensymphony.xwork.ActionInvocation invocation)
             throws Exception
Executes the result. Writes the given chart as a PNG to the servlet output stream.

Specified by:
execute in interface com.opensymphony.xwork.Result
Parameters:
invocation - an encapsulation of the action execution state.
Throws:
Exception - if an error occurs when creating or writing the chart to the servlet output stream.

WebWork Project Page