1 28 package net.sf.jasperreports.charts.base; 29 30 import java.awt.Color ; 31 32 import net.sf.jasperreports.charts.JRBarPlot; 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 42 46 public class JRBaseBarPlot extends JRBaseChartPlot implements JRBarPlot 47 { 48 49 50 53 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 54 55 protected JRExpression categoryAxisLabelExpression = null; 56 protected JRFont categoryAxisLabelFont = null; 57 protected Color categoryAxisLabelColor = null; 58 protected JRFont categoryAxisTickLabelFont = null; 59 protected Color categoryAxisTickLabelColor = null; 60 protected String categoryAxisTickLabelMask = null; 61 protected Color categoryAxisLineColor = null; 62 63 protected JRExpression valueAxisLabelExpression = null; 64 protected JRFont valueAxisLabelFont = null; 65 protected Color valueAxisLabelColor = null; 66 protected JRFont valueAxisTickLabelFont = null; 67 protected Color valueAxisTickLabelColor = null; 68 protected String valueAxisTickLabelMask = null; 69 protected Color valueAxisLineColor = null; 70 71 protected boolean isShowTickMarks = false; 72 protected boolean isShowTickLabels = false; 73 protected boolean isShowLabels = false; 74 75 76 79 public JRBaseBarPlot(JRChartPlot barPlot) 80 { 81 super(barPlot); 82 } 83 84 87 public JRBaseBarPlot(JRBarPlot barPlot, JRBaseObjectFactory factory) 88 { 89 super(barPlot, factory); 90 91 isShowTickMarks = barPlot.isShowTickMarks(); 92 isShowTickLabels = barPlot.isShowTickLabels(); 93 isShowLabels = barPlot.isShowLabels(); 94 95 categoryAxisLabelExpression = factory.getExpression( barPlot.getCategoryAxisLabelExpression() ); 96 categoryAxisLabelFont = factory.getFont(barPlot.getCategoryAxisLabelFont()); 97 categoryAxisLabelColor = barPlot.getCategoryAxisLabelColor(); 98 categoryAxisTickLabelFont = factory.getFont(barPlot.getCategoryAxisTickLabelFont()); 99 categoryAxisTickLabelColor = barPlot.getCategoryAxisTickLabelColor(); 100 categoryAxisTickLabelMask = barPlot.getCategoryAxisTickLabelMask(); 101 categoryAxisLineColor = barPlot.getCategoryAxisLineColor(); 102 103 valueAxisLabelExpression = factory.getExpression( barPlot.getValueAxisLabelExpression() ); 104 valueAxisLabelFont = factory.getFont(barPlot.getValueAxisLabelFont()); 105 valueAxisLabelColor = barPlot.getValueAxisLabelColor(); 106 valueAxisTickLabelFont = factory.getFont(barPlot.getValueAxisTickLabelFont()); 107 valueAxisTickLabelColor = barPlot.getValueAxisTickLabelColor(); 108 valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask(); 109 valueAxisLineColor = barPlot.getValueAxisLineColor(); 110 } 111 112 115 public JRExpression getCategoryAxisLabelExpression(){ 116 return categoryAxisLabelExpression; 117 } 118 119 122 public JRFont getCategoryAxisLabelFont() 123 { 124 return categoryAxisLabelFont; 125 } 126 127 130 public Color getCategoryAxisLabelColor() 131 { 132 return categoryAxisLabelColor; 133 } 134 135 138 public JRFont getCategoryAxisTickLabelFont() 139 { 140 return categoryAxisTickLabelFont; 141 } 142 143 146 public Color getCategoryAxisTickLabelColor() 147 { 148 return categoryAxisTickLabelColor; 149 } 150 151 154 public String getCategoryAxisTickLabelMask() 155 { 156 return categoryAxisTickLabelMask; 157 } 158 159 162 public Color getCategoryAxisLineColor() 163 { 164 return categoryAxisLineColor; 165 } 166 167 170 public JRExpression getValueAxisLabelExpression(){ 171 return valueAxisLabelExpression; 172 } 173 174 177 public JRFont getValueAxisLabelFont() 178 { 179 return valueAxisLabelFont; 180 } 181 182 185 public Color getValueAxisLabelColor() 186 { 187 return valueAxisLabelColor; 188 } 189 190 191 194 public JRFont getValueAxisTickLabelFont() 195 { 196 return valueAxisTickLabelFont; 197 } 198 199 202 public Color getValueAxisTickLabelColor() 203 { 204 return valueAxisTickLabelColor; 205 } 206 207 210 public String getValueAxisTickLabelMask() 211 { 212 return valueAxisTickLabelMask; 213 } 214 215 218 public Color getValueAxisLineColor() 219 { 220 return valueAxisLineColor; 221 } 222 225 public boolean isShowTickMarks() 226 { 227 return isShowTickMarks; 228 } 229 230 233 public void setShowTickMarks(boolean isShowTickMarks) 234 { 235 this.isShowTickMarks = isShowTickMarks; 236 } 237 238 241 public boolean isShowTickLabels() 242 { 243 return isShowTickLabels; 244 } 245 246 249 public void setShowTickLabels(boolean isShowTickLabels) 250 { 251 this.isShowTickLabels = isShowTickLabels; 252 } 253 254 257 public boolean isShowLabels(){ 258 return isShowLabels; 259 } 260 261 264 public void setShowLabels( boolean isShowLabels ){ 265 this.isShowLabels = isShowLabels; 266 } 267 268 271 public void collectExpressions(JRExpressionCollector collector) 272 { 273 collector.collect(this); 274 } 275 276 } 277 | Popular Tags |