View Javadoc

1   package org.codehaus.mojo.dashboard.report.plugin.chart;
2   
3   import java.awt.Color;
4   import java.awt.image.BufferedImage;
5   import java.io.IOException;
6   
7   import org.jfree.chart.JFreeChart;
8   
9   public interface IChartRenderer {
10  
11  	public boolean isEmpty();
12  
13  	/**
14  	 * Return the file extension of the document : <tt>png</tt>.
15  	 * @return
16  	 */
17  	public String getFileExtension();
18  
19  	/**
20  	 * Return the mime type of the document.
21  	 * @return
22  	 */
23  	public String getMimeType();
24  
25  	/**
26  	 * Save the report with the specified filename. The filename can contain a relative or absolute path.
27  	 * <p>
28  	 * If the file exists, it is overwritten.
29  	 * </p>
30  	 *
31  	 * @param filename
32  	 *            Name of the output file.
33  	 * @throws IOException
34  	 *             If an I/O exception occurs.
35  	 * @see net.logAnalyzer.reports.LAReport#saveToFile(java.lang.String)
36  	 */
37  	public void saveToFile(String filename) throws IOException;
38  
39  	/**
40  	 * Create an image from the report as a {@link BufferedImage}.
41  	 *
42  	 * @param imageWidth
43  	 *            Image width.
44  	 * @param imageHeight
45  	 *            Image height.
46  	 * @return Image from the report; <tt>null</tt> if unsupported feature.
47  	 * @see JFreeChart#createBufferedImage(int, int)
48  	 */
49  	public BufferedImage createBufferedImage(int imageWidth, int imageHeight);
50  
51  	/**
52  	 * set the height of the image saved as file
53  	 * @param _height
54  	 */
55  	public void setHeight(int _height);
56  
57  	/**
58  	 * set the width of the image saved as file
59  	 * @param _width
60  	 */
61  	public void setWidth(int _width);
62  
63  	public abstract void createChart();
64  
65  	public abstract JFreeChart getChart();
66  
67  	public Color getBackgroundColor();
68  
69  }