com.ge.research.acuity.ui.renderers
Class JFreeRenderer

java.lang.Object
  extended bycom.ge.research.acuity.ui.renderers.JFreeRenderer
All Implemented Interfaces:
GraphRenderer, Renderer

public class JFreeRenderer
extends java.lang.Object
implements GraphRenderer

A GraphRenderer implementation for the JFreeChart 0.9.8 API and library

Version:
$Revision: 1.1 $ $Date: 2006/08/11 00:17:51 $
Author:
garbiras

Field Summary
 
Fields inherited from interface com.ge.research.acuity.ui.renderers.GraphRenderer
bundle
 
Constructor Summary
JFreeRenderer()
           
 
Method Summary
 java.lang.String createChartImage(java.lang.Object chart, int width, int height)
          Takes a 3rd party graphing library chart object, and size dimensions, and passes to a graphing servlet to create an image of the chart, and store in the session
 int getChartImageHeightOffset()
          Returns the pixel offset of the chart image height, produced by the renderer.
 int getChartImageWidthOffset()
          Returns the pixel offset of the chart image width, produced by the renderer.
 java.lang.String getImageMap(java.lang.Object chart, java.lang.String identifier)
          Takes a 3rd party graphing library chart object, and its image identifier and retrieves/creates any image map information for the chart.
 java.lang.String getRenderServlet()
          Returns the graphing server servlet context path, so that the chart can be rendered within an HTML session and available to a browser.
 java.lang.Object render(GraphPO po)
          Converts a GraphPO presentation object into a 3rd party graphing library chart object
 java.lang.Object render(PresentationObject po)
          Converts a PresentationObject into a media displayable representation
protected  void setupAxes(org.jfree.chart.plot.CategoryPlot plot, GraphPO po, boolean xAsCategory)
          Sets up the axes properties of the chart (x/y axis titles, rotation, labels, etc.)
protected  void setupAxes(org.jfree.chart.plot.XYPlot plot, GraphPO po)
          Sets up the axes properties of the chart (x/y axis titles, rotation, labels, etc.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFreeRenderer

public JFreeRenderer()
Method Detail

createChartImage

public java.lang.String createChartImage(java.lang.Object chart,
                                         int width,
                                         int height)
Description copied from interface: GraphRenderer
Takes a 3rd party graphing library chart object, and size dimensions, and passes to a graphing servlet to create an image of the chart, and store in the session

Specified by:
createChartImage in interface GraphRenderer
Parameters:
chart - the 3rd party graphing library chart object
width - the width of the chart image
height - the height of the chart image
Returns:
An identifier by which to retrieve the cached chart from the session via a graphing servlet

getChartImageHeightOffset

public final int getChartImageHeightOffset()
Description copied from interface: GraphRenderer
Returns the pixel offset of the chart image height, produced by the renderer. The renderer produces an chart of size equivalent to that of the presentation object it represents. The offset values allow the image of the chart to be properly rendered as a presentation object (to allow for presentation object borders and headers)

Specified by:
getChartImageHeightOffset in interface GraphRenderer
Returns:
The height offset (in pixels) for the chart image

getChartImageWidthOffset

public final int getChartImageWidthOffset()
Description copied from interface: GraphRenderer
Returns the pixel offset of the chart image width, produced by the renderer. The renderer produces an chart of size equivalent to that of the presentation object it represents. The offset values allow the image of the chart to be properly rendered as a presentation object (to allow for presentation object borders and headers)

Specified by:
getChartImageWidthOffset in interface GraphRenderer
Returns:
The width offset (in pixels) for the chart image

getImageMap

public java.lang.String getImageMap(java.lang.Object chart,
                                    java.lang.String identifier)
Description copied from interface: GraphRenderer
Takes a 3rd party graphing library chart object, and its image identifier and retrieves/creates any image map information for the chart.

Specified by:
getImageMap in interface GraphRenderer
Parameters:
chart - the 3rd party graphing library chart object
identifier - the identifier of the chart image in the session, to get the image map information for
Returns:
An image map HTML tag for the chart image identified by identifier

getRenderServlet

public final java.lang.String getRenderServlet()
Description copied from interface: GraphRenderer
Returns the graphing server servlet context path, so that the chart can be rendered within an HTML session and available to a browser.

Specified by:
getRenderServlet in interface GraphRenderer
Returns:
The servlet context path for the graphing engine to use to render the chart within an HTML session

render

public java.lang.Object render(GraphPO po)
Description copied from interface: GraphRenderer
Converts a GraphPO presentation object into a 3rd party graphing library chart object

Specified by:
render in interface GraphRenderer
Parameters:
po - the graph presentation object to convert into 3rd party library object
Returns:
The 3rd party graphing library graph object

render

public final java.lang.Object render(PresentationObject po)
Description copied from interface: Renderer
Converts a PresentationObject into a media displayable representation

Specified by:
render in interface Renderer
Parameters:
po - the presentation object to convert
Returns:
The converted representation of the presentation object

setupAxes

protected void setupAxes(org.jfree.chart.plot.XYPlot plot,
                         GraphPO po)
Sets up the axes properties of the chart (x/y axis titles, rotation, labels, etc.) from the GraphPO properties

Parameters:
plot - the graph chart plot being created
po - the graph presentation object being converted

setupAxes

protected void setupAxes(org.jfree.chart.plot.CategoryPlot plot,
                         GraphPO po,
                         boolean xAsCategory)
Sets up the axes properties of the chart (x/y axis titles, rotation, labels, etc.) from the GraphPO properties

Parameters:
plot - the graph chart plot being created
po - the graph presentation object being converted