java/cewolf-1.0/src/main/java/de/laures/cewolf/taglib/OverlaidChartDefinition.java
author František Kučera <franta-hg@frantovo.cz>
Sat, 28 Feb 2009 21:31:02 +0100
changeset 1 639991d0808a
permissions -rw-r--r--
Rozbalená knihovna verze 1.0
     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;
    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 implements Serializable {
    27 
    28 	private int xAxisType = 0;
    29 	private int yAxisType = 0;
    30 	
    31     private List plotDefinitions = new ArrayList();
    32     private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier();
    33 
    34     public Object 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 }