package net.sf.jasperreports.charts.base; import java.awt.Color; import net.sf.jasperreports.charts.JRBar3DPlot; import net.sf.jasperreports.charts.JRCategoryAxisFormat; import net.sf.jasperreports.charts.JRValueAxisFormat; import net.sf.jasperreports.engine.JRChart; import net.sf.jasperreports.engine.JRChartPlot; import net.sf.jasperreports.engine.JRExpression; import net.sf.jasperreports.engine.JRExpressionCollector; import net.sf.jasperreports.engine.JRFont; import net.sf.jasperreports.engine.JRStyleContainer; import net.sf.jasperreports.engine.base.JRBaseChartPlot; import net.sf.jasperreports.engine.base.JRBaseFont; import net.sf.jasperreports.engine.base.JRBaseObjectFactory; import net.sf.jasperreports.engine.util.JRStyleResolver; public class JRBaseBar3DPlot extends JRBaseChartPlot implements JRBar3DPlot { private static final long serialVersionUID = 10200L; public static final String PROPERTY_SHOW_LABELS = "showLabels"; public static final String PROPERTY_X_OFFSET = "xOffset"; public static final String PROPERTY_Y_OFFSET = "yOffset"; protected JRExpression categoryAxisLabelExpression = null; protected JRFont categoryAxisLabelFont = null; protected Color categoryAxisLabelColor = null; protected JRFont categoryAxisTickLabelFont = null; protected Color categoryAxisTickLabelColor = null; protected String categoryAxisTickLabelMask = null; protected Color categoryAxisLineColor = null; protected JRExpression valueAxisLabelExpression = null; protected JRFont valueAxisLabelFont = null; protected Color valueAxisLabelColor = null; protected JRFont valueAxisTickLabelFont = null; protected Color valueAxisTickLabelColor = null; protected String valueAxisTickLabelMask = null; protected Color valueAxisLineColor = null; protected double xOffset = 12.0D; protected double yOffset = 8.0D; protected boolean isShowLabels = false; public JRBaseBar3DPlot(JRChartPlot barPlot, JRChart chart) { super(barPlot, chart); } public JRBaseBar3DPlot(JRBar3DPlot barPlot, JRBaseObjectFactory factory) { super((JRChartPlot)barPlot, factory); this.xOffset = barPlot.getXOffset(); this.yOffset = barPlot.getYOffset(); this.isShowLabels = barPlot.isShowLabels(); this.categoryAxisLabelExpression = factory.getExpression(barPlot.getCategoryAxisLabelExpression()); this.categoryAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getCategoryAxisLabelFont()); this.categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor(); this.categoryAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getCategoryAxisTickLabelFont()); this.categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor(); this.categoryAxisTickLabelMask = barPlot.getCategoryAxisTickLabelMask(); this.categoryAxisLineColor = barPlot.getCategoryAxisLineColor(); this.valueAxisLabelExpression = factory.getExpression(barPlot.getValueAxisLabelExpression()); this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getValueAxisLabelFont()); this.valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor(); this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getValueAxisTickLabelFont()); this.valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor(); this.valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask(); this.valueAxisLineColor = barPlot.getValueAxisLineColor(); } public JRExpression getCategoryAxisLabelExpression() { return this.categoryAxisLabelExpression; } public JRFont getCategoryAxisLabelFont() { return this.categoryAxisLabelFont; } public Color getCategoryAxisLabelColor() { return JRStyleResolver.getCategoryAxisLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this); } public Color getOwnCategoryAxisLabelColor() { return this.categoryAxisLabelColor; } public JRFont getCategoryAxisTickLabelFont() { return this.categoryAxisTickLabelFont; } public Color getCategoryAxisTickLabelColor() { return JRStyleResolver.getCategoryAxisTickLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this); } public Color getOwnCategoryAxisTickLabelColor() { return this.categoryAxisTickLabelColor; } public String getCategoryAxisTickLabelMask() { return this.categoryAxisTickLabelMask; } public Color getCategoryAxisLineColor() { return JRStyleResolver.getCategoryAxisLineColor((JRCategoryAxisFormat)this, (JRChartPlot)this); } public Color getOwnCategoryAxisLineColor() { return this.categoryAxisLineColor; } public JRExpression getValueAxisLabelExpression() { return this.valueAxisLabelExpression; } public JRFont getValueAxisLabelFont() { return this.valueAxisLabelFont; } public Color getValueAxisLabelColor() { return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this); } public Color getOwnValueAxisLabelColor() { return this.valueAxisLabelColor; } public JRFont getValueAxisTickLabelFont() { return this.valueAxisTickLabelFont; } public Color getValueAxisTickLabelColor() { return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this); } public Color getOwnValueAxisTickLabelColor() { return this.valueAxisTickLabelColor; } public String getValueAxisTickLabelMask() { return this.valueAxisTickLabelMask; } public Color getValueAxisLineColor() { return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this); } public Color getOwnValueAxisLineColor() { return this.valueAxisLineColor; } public double getXOffset() { return this.xOffset; } public void setXOffset(double xOffset) { double old = this.xOffset; this.xOffset = xOffset; getEventSupport().firePropertyChange("xOffset", old, this.xOffset); } public double getYOffset() { return this.yOffset; } public void setYOffset(double yOffset) { double old = this.yOffset; this.yOffset = yOffset; getEventSupport().firePropertyChange("yOffset", old, this.yOffset); } public boolean isShowLabels() { return this.isShowLabels; } public void setShowLabels(boolean isShowLabels) { boolean old = this.isShowLabels; this.isShowLabels = isShowLabels; getEventSupport().firePropertyChange("showLabels", old, this.isShowLabels); } public void collectExpressions(JRExpressionCollector collector) { collector.collect(this); } public Object clone(JRChart parentChart) { JRBaseBar3DPlot clone = (JRBaseBar3DPlot)super.clone(parentChart); if (this.categoryAxisLabelExpression != null) clone.categoryAxisLabelExpression = (JRExpression)this.categoryAxisLabelExpression.clone(); if (this.valueAxisLabelExpression != null) clone.valueAxisLabelExpression = (JRExpression)this.valueAxisLabelExpression.clone(); return clone; } }