KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > laures > cewolf > taglib > OverlaidChartDefinition


1 /*
2  * Created on 13.04.2003
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package de.laures.cewolf.taglib;
8
9 import java.io.Serializable JavaDoc;
10 import java.util.ArrayList JavaDoc;
11 import java.util.List JavaDoc;
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 implements Serializable JavaDoc {
27
28     private int xAxisType = 0;
29     private int yAxisType = 0;
30     
31     private List JavaDoc plotDefinitions = new ArrayList JavaDoc();
32     private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier();
33
34     public Object JavaDoc getDataset() throws DatasetProduceException {
35         return ((PlotDefinition)plotDefinitions.get(0)).getDataset();
36     }
37
38     public void addPlot(PlotDefinition pd) {
39         pd.setDrawingSupplier(drawingSupplier);
40         plotDefinitions.add(pd);
41     }
42
43     protected JFreeChart produceChart() throws DatasetProduceException, ChartValidationException {
44         log.debug("xAxisType = " + xAxisType);
45         return CewolfChartFactory.getOverlaidChartInstance(type, title, xAxisLabel, yAxisLabel, xAxisType, yAxisType, plotDefinitions);
46     }
47
48     /**
49      * Sets the xAxisType.
50      * @param xAxisType The xAxisType to set
51      */

52     public void setXAxisType(int xAxisType) {
53         this.xAxisType = xAxisType;
54     }
55
56     /**
57      * Sets the yAxisType.
58      * @param yAxisType The yAxisType to set
59      */

60     public void setYAxisType(int yAxisType) {
61         this.yAxisType = yAxisType;
62     }
63
64 }
65
Popular Tags