java/cewolf-1.0/src/main/java/de/laures/cewolf/taglib/OverlaidChartDefinition.java
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/cewolf-1.0/src/main/java/de/laures/cewolf/taglib/OverlaidChartDefinition.java Sat Feb 28 21:31:02 2009 +0100
1.3 @@ -0,0 +1,64 @@
1.4 +/*
1.5 + * Created on 13.04.2003
1.6 + *
1.7 + * To change the template for this generated file go to
1.8 + * Window>Preferences>Java>Code Generation>Code and Comments
1.9 + */
1.10 +package de.laures.cewolf.taglib;
1.11 +
1.12 +import java.io.Serializable;
1.13 +import java.util.ArrayList;
1.14 +import java.util.List;
1.15 +
1.16 +import org.jfree.chart.JFreeChart;
1.17 +import org.jfree.chart.plot.DefaultDrawingSupplier;
1.18 +import org.jfree.chart.plot.DrawingSupplier;
1.19 +
1.20 +import de.laures.cewolf.ChartValidationException;
1.21 +import de.laures.cewolf.DatasetProduceException;
1.22 +
1.23 +/**
1.24 + * @author guido
1.25 + *
1.26 + * To change the template for this generated type comment go to
1.27 + * Window>Preferences>Java>Code Generation>Code and Comments
1.28 + */
1.29 +public class OverlaidChartDefinition extends AbstractChartDefinition implements Serializable {
1.30 +
1.31 + private int xAxisType = 0;
1.32 + private int yAxisType = 0;
1.33 +
1.34 + private List plotDefinitions = new ArrayList();
1.35 + private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier();
1.36 +
1.37 + public Object getDataset() throws DatasetProduceException {
1.38 + return ((PlotDefinition)plotDefinitions.get(0)).getDataset();
1.39 + }
1.40 +
1.41 + public void addPlot(PlotDefinition pd) {
1.42 + pd.setDrawingSupplier(drawingSupplier);
1.43 + plotDefinitions.add(pd);
1.44 + }
1.45 +
1.46 + protected JFreeChart produceChart() throws DatasetProduceException, ChartValidationException {
1.47 + log.debug("xAxisType = " + xAxisType);
1.48 + return CewolfChartFactory.getOverlaidChartInstance(type, title, xAxisLabel, yAxisLabel, xAxisType, yAxisType, plotDefinitions);
1.49 + }
1.50 +
1.51 + /**
1.52 + * Sets the xAxisType.
1.53 + * @param xAxisType The xAxisType to set
1.54 + */
1.55 + public void setXAxisType(int xAxisType) {
1.56 + this.xAxisType = xAxisType;
1.57 + }
1.58 +
1.59 + /**
1.60 + * Sets the yAxisType.
1.61 + * @param yAxisType The yAxisType to set
1.62 + */
1.63 + public void setYAxisType(int yAxisType) {
1.64 + this.yAxisType = yAxisType;
1.65 + }
1.66 +
1.67 +}