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.ArrayList;
11: import java.util.List;
12:
13: import org.jfree.chart.JFreeChart;
14: import org.jfree.chart.plot.DefaultDrawingSupplier;
15: import org.jfree.chart.plot.DrawingSupplier;
16:
17: import de.laures.cewolf.ChartValidationException;
18: import de.laures.cewolf.DatasetProduceException;
19:
20: /**
21: * @author guido
22: *
23: * To change the template for this generated type comment go to
24: * Window>Preferences>Java>Code Generation>Code and Comments
25: */
26: public class OverlaidChartDefinition extends AbstractChartDefinition
27: implements Serializable {
28:
29: private int xAxisType = 0;
30: private int yAxisType = 0;
31:
32: private List plotDefinitions = new ArrayList();
33: private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier();
34:
35: public Object getDataset() throws DatasetProduceException {
36: return ((PlotDefinition) plotDefinitions.get(0)).getDataset();
37: }
38:
39: public void addPlot(PlotDefinition pd) {
40: pd.setDrawingSupplier(drawingSupplier);
41: plotDefinitions.add(pd);
42: }
43:
44: protected JFreeChart produceChart() throws DatasetProduceException,
45: ChartValidationException {
46: log.debug("xAxisType = " + xAxisType);
47: return CewolfChartFactory.getOverlaidChartInstance(type, title,
48: xAxisLabel, yAxisLabel, xAxisType, yAxisType,
49: plotDefinitions);
50: }
51:
52: /**
53: * Sets the xAxisType.
54: * @param xAxisType The xAxisType to set
55: */
56: public void setXAxisType(int xAxisType) {
57: this .xAxisType = xAxisType;
58: }
59:
60: /**
61: * Sets the yAxisType.
62: * @param yAxisType The yAxisType to set
63: */
64: public void setYAxisType(int yAxisType) {
65: this.yAxisType = yAxisType;
66: }
67:
68: }
|