1 28 package net.sf.jasperreports.charts.base; 29 30 import java.awt.Color ; 31 32 import net.sf.jasperreports.charts.JRLinePlot; 33 import net.sf.jasperreports.engine.JRChartPlot; 34 import net.sf.jasperreports.engine.JRConstants; 35 import net.sf.jasperreports.engine.JRExpression; 36 import net.sf.jasperreports.engine.JRExpressionCollector; 37 import net.sf.jasperreports.engine.JRFont; 38 import net.sf.jasperreports.engine.base.JRBaseChartPlot; 39 import net.sf.jasperreports.engine.base.JRBaseObjectFactory; 40 41 45 public class JRBaseLinePlot extends JRBaseChartPlot implements JRLinePlot { 46 47 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 48 49 protected JRExpression categoryAxisLabelExpression = null; 50 protected JRFont categoryAxisLabelFont = null; 51 protected Color categoryAxisLabelColor = null; 52 protected JRFont categoryAxisTickLabelFont = null; 53 protected Color categoryAxisTickLabelColor = null; 54 protected String categoryAxisTickLabelMask = null; 55 protected Color categoryAxisLineColor = null; 56 57 protected JRExpression valueAxisLabelExpression = null; 58 protected JRFont valueAxisLabelFont = null; 59 protected Color valueAxisLabelColor = null; 60 protected JRFont valueAxisTickLabelFont = null; 61 protected Color valueAxisTickLabelColor = null; 62 protected String valueAxisTickLabelMask = null; 63 protected Color valueAxisLineColor = null; 64 65 boolean isShowShapes = true; 66 boolean isShowLines = true; 67 68 69 72 public JRBaseLinePlot( JRChartPlot linePlot){ 73 super( linePlot); 74 } 75 76 79 public JRBaseLinePlot( JRLinePlot linePlot, JRBaseObjectFactory factory ){ 80 super( linePlot, factory ); 81 82 isShowShapes = linePlot.isShowShapes(); 83 isShowLines = linePlot.isShowLines(); 84 85 categoryAxisLabelExpression = factory.getExpression( linePlot.getCategoryAxisLabelExpression() ); 86 categoryAxisLabelFont = factory.getFont(linePlot.getCategoryAxisLabelFont()); 87 categoryAxisLabelColor = linePlot.getCategoryAxisLabelColor(); 88 categoryAxisTickLabelFont = factory.getFont(linePlot.getCategoryAxisTickLabelFont()); 89 categoryAxisTickLabelColor = linePlot.getCategoryAxisTickLabelColor(); 90 categoryAxisTickLabelMask = linePlot.getCategoryAxisTickLabelMask(); 91 categoryAxisLineColor = linePlot.getCategoryAxisLineColor(); 92 93 valueAxisLabelExpression = factory.getExpression( linePlot.getValueAxisLabelExpression() ); 94 valueAxisLabelFont = factory.getFont(linePlot.getValueAxisLabelFont()); 95 valueAxisLabelColor = linePlot.getValueAxisLabelColor(); 96 valueAxisTickLabelFont = factory.getFont(linePlot.getValueAxisTickLabelFont()); 97 valueAxisTickLabelColor = linePlot.getValueAxisTickLabelColor(); 98 valueAxisTickLabelMask = linePlot.getValueAxisTickLabelMask(); 99 valueAxisLineColor = linePlot.getValueAxisLineColor(); 100 } 101 102 105 public JRExpression getCategoryAxisLabelExpression(){ 106 return categoryAxisLabelExpression; 107 } 108 109 112 public JRFont getCategoryAxisLabelFont() 113 { 114 return categoryAxisLabelFont; 115 } 116 117 120 public Color getCategoryAxisLabelColor() 121 { 122 return categoryAxisLabelColor; 123 } 124 125 126 129 public JRFont getCategoryAxisTickLabelFont() 130 { 131 return categoryAxisTickLabelFont; 132 } 133 134 137 public Color getCategoryAxisTickLabelColor() 138 { 139 return categoryAxisTickLabelColor; 140 } 141 142 145 public String getCategoryAxisTickLabelMask() 146 { 147 return categoryAxisTickLabelMask; 148 } 149 150 153 public Color getCategoryAxisLineColor() 154 { 155 return categoryAxisLineColor; 156 } 157 158 161 public JRExpression getValueAxisLabelExpression(){ 162 return valueAxisLabelExpression; 163 } 164 165 168 public JRFont getValueAxisLabelFont() 169 { 170 return valueAxisLabelFont; 171 } 172 173 176 public Color getValueAxisLabelColor() 177 { 178 return valueAxisLabelColor; 179 } 180 181 182 185 public JRFont getValueAxisTickLabelFont() 186 { 187 return valueAxisTickLabelFont; 188 } 189 190 193 public Color getValueAxisTickLabelColor() 194 { 195 return valueAxisTickLabelColor; 196 } 197 198 201 public String getValueAxisTickLabelMask() 202 { 203 return valueAxisTickLabelMask; 204 } 205 206 209 public Color getValueAxisLineColor() 210 { 211 return valueAxisLineColor; 212 } 213 214 217 public boolean isShowShapes(){ 218 return isShowShapes; 219 } 220 221 224 public boolean isShowLines(){ 225 return isShowLines; 226 } 227 228 231 public void setShowShapes( boolean value ){ 232 this.isShowShapes = value; 233 } 234 235 238 public void setShowLines( boolean value ){ 239 this.isShowLines = value; 240 } 241 242 245 public void collectExpressions(JRExpressionCollector collector) 246 { 247 collector.collect(this); 248 } 249 250 } 251 | Popular Tags |