1 28 package net.sf.jasperreports.charts.design; 29 30 import java.util.ArrayList ; 31 import java.util.List ; 32 33 import net.sf.jasperreports.charts.JRTimePeriodDataset; 34 import net.sf.jasperreports.charts.JRTimePeriodSeries; 35 import net.sf.jasperreports.engine.JRChartDataset; 36 import net.sf.jasperreports.engine.JRConstants; 37 import net.sf.jasperreports.engine.JRExpressionCollector; 38 import net.sf.jasperreports.engine.design.JRDesignChartDataset; 39 import net.sf.jasperreports.engine.design.JRVerifier; 40 41 45 public class JRDesignTimePeriodDataset extends JRDesignChartDataset implements JRTimePeriodDataset { 46 47 50 public static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 51 52 private List timePeriodSeriesList = new ArrayList (); 53 54 55 58 public JRDesignTimePeriodDataset(JRChartDataset dataset) 59 { 60 super( dataset ); 61 } 62 63 66 public JRTimePeriodSeries[] getSeries() 67 { 68 JRTimePeriodSeries[] timePeriodSeriesArray = new JRTimePeriodSeries[timePeriodSeriesList.size()]; 69 timePeriodSeriesList.toArray(timePeriodSeriesArray); 70 71 return timePeriodSeriesArray; 72 } 73 74 77 public List getSeriesList() 78 { 79 return timePeriodSeriesList; 80 } 81 82 85 public void addTimePeriodSeries( JRTimePeriodSeries timePeriodSeries ) 86 { 87 timePeriodSeriesList.add(timePeriodSeries); 88 } 89 90 93 public JRTimePeriodSeries removeTimePeriodSeries(JRTimePeriodSeries timePeriodSeries) 94 { 95 if( timePeriodSeries != null && timePeriodSeriesList.contains( timePeriodSeries )) 96 { 97 timePeriodSeriesList.remove( timePeriodSeries ); 98 } 99 100 return timePeriodSeries; 101 } 102 103 106 public byte getDatasetType() 107 { 108 return JRChartDataset.TIMEPERIOD_DATASET; 109 } 110 111 114 public void collectExpressions(JRExpressionCollector collector) 115 { 116 collector.collect(this); 117 } 118 119 120 public void validate(JRVerifier verifier) 121 { 122 verifier.verify(this); 123 } 124 125 } 126 | Popular Tags |