org.codehaus.mojo.dashboard.report.plugin.chart
Class AbstractChartRenderer

java.lang.Object
  extended by org.codehaus.mojo.dashboard.report.plugin.chart.AbstractChartRenderer
Direct Known Subclasses:
BarChartRenderer, PieChart3DRenderer, PieChartRenderer, StackedBarChartRenderer, TimeChartRenderer

public abstract class AbstractChartRenderer
extends java.lang.Object

Author:
David Vicente

Field Summary
protected  IChartStrategy datasetStrategy
           
protected  org.jfree.chart.JFreeChart report
          Wrapped chart.
 
Constructor Summary
AbstractChartRenderer(IChartStrategy strategy)
           
AbstractChartRenderer(IChartStrategy strategy, int width, int height)
           
 
Method Summary
 java.awt.image.BufferedImage createBufferedImage(int imageWidth, int imageHeight)
          Create an image from the report as a BufferedImage.
protected abstract  void createChart()
          create the chart with the IChartStrategy
 java.lang.String getFileExtension()
          Return the file extension of the document : png.
 java.lang.String getMimeType()
          Return the mime type of the document.
 boolean isEmpty()
           
 void saveToFile(java.lang.String filename)
          Save the report with the specified filename.
 void setHeight(int _height)
          set the height of the image saved as file
 void setWidth(int _width)
          set the width of the image saved as file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

report

protected org.jfree.chart.JFreeChart report
Wrapped chart.


datasetStrategy

protected IChartStrategy datasetStrategy
Constructor Detail

AbstractChartRenderer

public AbstractChartRenderer(IChartStrategy strategy)
Parameters:
strategy -

AbstractChartRenderer

public AbstractChartRenderer(IChartStrategy strategy,
                             int width,
                             int height)
Parameters:
strategy -
width -
height -
Method Detail

createChart

protected abstract void createChart()
create the chart with the IChartStrategy


isEmpty

public boolean isEmpty()

getFileExtension

public java.lang.String getFileExtension()
Return the file extension of the document : png.

Returns:

getMimeType

public java.lang.String getMimeType()
Return the mime type of the document.

Returns:

saveToFile

public void saveToFile(java.lang.String filename)
                throws java.io.IOException
Save the report with the specified filename. The filename can contain a relative or absolute path.

If the file exists, it is overwritten.

Parameters:
filename - Name of the output file.
Throws:
java.io.IOException - If an I/O exception occurs.
See Also:
net.logAnalyzer.reports.LAReport#saveToFile(java.lang.String)

createBufferedImage

public java.awt.image.BufferedImage createBufferedImage(int imageWidth,
                                                        int imageHeight)
Create an image from the report as a BufferedImage.

Parameters:
imageWidth - Image width.
imageHeight - Image height.
Returns:
Image from the report; null if unsupported feature.
See Also:
JFreeChart.createBufferedImage(int, int)

setHeight

public void setHeight(int _height)
set the height of the image saved as file

Parameters:
_height -

setWidth

public void setWidth(int _width)
set the width of the image saved as file

Parameters:
_width -


Copyright © 2006-2010 CodeHaus. All Rights Reserved.