1 package org.codehaus.mojo.dashboard.report.plugin.chart;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.awt.image.BufferedImage;
20 import java.io.IOException;
21 import java.util.List;
22
23 import org.jfree.chart.JFreeChart;
24
25 public abstract class AbstractChartDecorator implements IChartRenderer{
26
27 protected IChartRenderer decoratedChart;
28 protected List results;
29
30
31
32 protected JFreeChart report = null;
33
34 public AbstractChartDecorator(IChartRenderer chartToDecorate, List markersToPlot) {
35 super();
36 this.decoratedChart = chartToDecorate;
37 this.results = markersToPlot;
38
39 this.report = this.decoratedChart.getChart();
40 createChart();
41 }
42 public abstract void createChart();
43
44 public BufferedImage createBufferedImage(int imageWidth, int imageHeight) {
45 return this.decoratedChart.createBufferedImage(imageWidth, imageHeight);
46 }
47
48 public String getFileExtension() {
49 return this.decoratedChart.getFileExtension();
50 }
51
52 public String getMimeType() {
53 return this.decoratedChart.getMimeType();
54 }
55
56 public boolean isEmpty() {
57 return this.decoratedChart.isEmpty();
58 }
59
60 public void saveToFile(String filename) throws IOException {
61 this.decoratedChart.saveToFile(filename);
62 }
63
64 public void setHeight(int _height) {
65 this.decoratedChart.setHeight(_height);
66 }
67
68 public void setWidth(int _width) {
69 this.decoratedChart.setWidth(_width);
70 }
71
72 public JFreeChart getChart() {
73 return this.report;
74 }
75
76 }