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.JRCategoryDataset; 34 import net.sf.jasperreports.charts.JRCategorySeries; 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 42 43 47 public class JRDesignCategoryDataset extends JRDesignChartDataset implements JRCategoryDataset 48 { 49 50 51 54 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 55 56 private List categorySeriesList = new ArrayList (); 57 58 59 62 public JRDesignCategoryDataset(JRChartDataset dataset) 63 { 64 super(dataset); 65 } 66 67 68 71 public JRCategorySeries[] getSeries() 72 { 73 JRCategorySeries[] categorySeriesArray = new JRCategorySeries[categorySeriesList.size()]; 74 75 categorySeriesList.toArray(categorySeriesArray); 76 77 return categorySeriesArray; 78 } 79 80 81 84 public List getSeriesList() 85 { 86 return categorySeriesList; 87 } 88 89 90 93 public void addCategorySeries(JRCategorySeries categorySeries) 94 { 95 categorySeriesList.add(categorySeries); 96 } 97 98 99 102 public JRCategorySeries removeCategorySeries(JRCategorySeries categorySeries) 103 { 104 if (categorySeries != null) 105 { 106 categorySeriesList.remove(categorySeries); 107 } 108 109 return categorySeries; 110 } 111 112 113 116 public byte getDatasetType() { 117 return JRChartDataset.CATEGORY_DATASET; 118 } 119 120 121 124 public void collectExpressions(JRExpressionCollector collector) 125 { 126 collector.collect(this); 127 } 128 129 130 public void validate(JRVerifier verifier) 131 { 132 verifier.verify(this); 133 } 134 135 136 } 137 | Popular Tags |