01: /*
02: * Created on 13.04.2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package de.laures.cewolf.taglib;
08:
09: import java.io.Serializable;
10: import java.util.Map;
11:
12: import org.jfree.chart.JFreeChart;
13: import org.jfree.data.general.Dataset;
14:
15: import de.laures.cewolf.ChartValidationException;
16: import de.laures.cewolf.DatasetProduceException;
17: import de.laures.cewolf.DatasetProducer;
18:
19: /**
20: * @author guido
21: *
22: * To change the template for this generated type comment go to
23: * Window>Preferences>Java>Code Generation>Code and Comments
24: */
25: public class SimpleChartDefinition extends AbstractChartDefinition
26: implements DataAware, Serializable {
27:
28: private DataContainer dataAware = new DataContainer();
29:
30: protected JFreeChart produceChart() throws DatasetProduceException,
31: ChartValidationException {
32: return CewolfChartFactory.getChartInstance(type, title,
33: xAxisLabel, yAxisLabel, (Dataset) getDataset());
34: }
35:
36: public Object getDataset() throws DatasetProduceException {
37: return dataAware.getDataset();
38: }
39:
40: public void setDataProductionConfig(DatasetProducer dsp,
41: Map params, boolean useCache) {
42: dataAware.setDataProductionConfig(dsp, params, useCache);
43: }
44:
45: }
|