001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.charts.base;
029:
030: import java.awt.Color;
031:
032: import net.sf.jasperreports.charts.JRBar3DPlot;
033: import net.sf.jasperreports.engine.JRChart;
034: import net.sf.jasperreports.engine.JRChartPlot;
035: import net.sf.jasperreports.engine.JRConstants;
036: import net.sf.jasperreports.engine.JRExpression;
037: import net.sf.jasperreports.engine.JRExpressionCollector;
038: import net.sf.jasperreports.engine.JRFont;
039: import net.sf.jasperreports.engine.base.JRBaseChartPlot;
040: import net.sf.jasperreports.engine.base.JRBaseFont;
041: import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
042: import net.sf.jasperreports.engine.util.JRStyleResolver;
043:
044: import org.jfree.chart.renderer.category.BarRenderer3D;
045:
046: /**
047: * @author Flavius Sana (flavius_sana@users.sourceforge.net)
048: * @version $Id: JRBaseBar3DPlot.java 1577 2007-02-09 11:25:48Z teodord $
049: */
050: public class JRBaseBar3DPlot extends JRBaseChartPlot implements
051: JRBar3DPlot {
052:
053: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
054:
055: protected JRExpression categoryAxisLabelExpression = null;
056: protected JRFont categoryAxisLabelFont = null;
057: protected Color categoryAxisLabelColor = null;
058: protected JRFont categoryAxisTickLabelFont = null;
059: protected Color categoryAxisTickLabelColor = null;
060: protected String categoryAxisTickLabelMask = null;
061: protected Color categoryAxisLineColor = null;
062:
063: protected JRExpression valueAxisLabelExpression = null;
064: protected JRFont valueAxisLabelFont = null;
065: protected Color valueAxisLabelColor = null;
066: protected JRFont valueAxisTickLabelFont = null;
067: protected Color valueAxisTickLabelColor = null;
068: protected String valueAxisTickLabelMask = null;
069: protected Color valueAxisLineColor = null;
070:
071: protected double xOffset = BarRenderer3D.DEFAULT_X_OFFSET;
072: protected double yOffset = BarRenderer3D.DEFAULT_Y_OFFSET;
073: protected boolean isShowLabels = false;
074:
075: /**
076: *
077: */
078: public JRBaseBar3DPlot(JRChartPlot barPlot, JRChart chart) {
079: super (barPlot, chart);
080: }
081:
082: /**
083: *
084: */
085: public JRBaseBar3DPlot(JRBar3DPlot barPlot,
086: JRBaseObjectFactory factory) {
087: super (barPlot, factory);
088:
089: xOffset = barPlot.getXOffset();
090: yOffset = barPlot.getYOffset();
091: isShowLabels = barPlot.isShowLabels();
092:
093: categoryAxisLabelExpression = factory.getExpression(barPlot
094: .getCategoryAxisLabelExpression());
095: categoryAxisLabelFont = new JRBaseFont(null, null, barPlot
096: .getChart(), barPlot.getCategoryAxisLabelFont());
097: categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor();
098: categoryAxisTickLabelFont = new JRBaseFont(null, null, barPlot
099: .getChart(), barPlot.getCategoryAxisTickLabelFont());
100: categoryAxisTickLabelColor = barPlot
101: .getOwnCategoryAxisTickLabelColor();
102: categoryAxisTickLabelMask = barPlot
103: .getCategoryAxisTickLabelMask();
104: categoryAxisLineColor = barPlot.getCategoryAxisLineColor();
105:
106: valueAxisLabelExpression = factory.getExpression(barPlot
107: .getValueAxisLabelExpression());
108: valueAxisLabelFont = new JRBaseFont(null, null, barPlot
109: .getChart(), barPlot.getValueAxisLabelFont());
110: valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor();
111: valueAxisTickLabelFont = new JRBaseFont(null, null, barPlot
112: .getChart(), barPlot.getValueAxisTickLabelFont());
113: valueAxisTickLabelColor = barPlot
114: .getOwnValueAxisTickLabelColor();
115: valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask();
116: valueAxisLineColor = barPlot.getValueAxisLineColor();
117: }
118:
119: /**
120: *
121: */
122: public JRExpression getCategoryAxisLabelExpression() {
123: return categoryAxisLabelExpression;
124: }
125:
126: /**
127: *
128: */
129: public JRFont getCategoryAxisLabelFont() {
130: return categoryAxisLabelFont;
131: }
132:
133: /**
134: *
135: */
136: public Color getCategoryAxisLabelColor() {
137: return JRStyleResolver.getCategoryAxisLabelColor(this , this );
138: }
139:
140: /**
141: *
142: */
143: public Color getOwnCategoryAxisLabelColor() {
144: return categoryAxisLabelColor;
145: }
146:
147: /**
148: *
149: */
150: public JRFont getCategoryAxisTickLabelFont() {
151: return categoryAxisTickLabelFont;
152: }
153:
154: /**
155: *
156: */
157: public Color getCategoryAxisTickLabelColor() {
158: return JRStyleResolver
159: .getCategoryAxisTickLabelColor(this , this );
160: }
161:
162: /**
163: *
164: */
165: public Color getOwnCategoryAxisTickLabelColor() {
166: return categoryAxisTickLabelColor;
167: }
168:
169: /**
170: *
171: */
172: public String getCategoryAxisTickLabelMask() {
173: return categoryAxisTickLabelMask;
174: }
175:
176: /**
177: *
178: */
179: public Color getCategoryAxisLineColor() {
180: return JRStyleResolver.getCategoryAxisLineColor(this , this );
181: }
182:
183: /**
184: *
185: */
186: public Color getOwnCategoryAxisLineColor() {
187: return categoryAxisLineColor;
188: }
189:
190: /**
191: *
192: */
193: public JRExpression getValueAxisLabelExpression() {
194: return valueAxisLabelExpression;
195: }
196:
197: /**
198: *
199: */
200: public JRFont getValueAxisLabelFont() {
201: return valueAxisLabelFont;
202: }
203:
204: /**
205: *
206: */
207: public Color getValueAxisLabelColor() {
208: return JRStyleResolver.getValueAxisLabelColor(this , this );
209: }
210:
211: /**
212: *
213: */
214: public Color getOwnValueAxisLabelColor() {
215: return valueAxisLabelColor;
216: }
217:
218: /**
219: *
220: */
221: public JRFont getValueAxisTickLabelFont() {
222: return valueAxisTickLabelFont;
223: }
224:
225: /**
226: *
227: */
228: public Color getValueAxisTickLabelColor() {
229: return JRStyleResolver.getValueAxisTickLabelColor(this , this );
230: }
231:
232: /**
233: *
234: */
235: public Color getOwnValueAxisTickLabelColor() {
236: return valueAxisTickLabelColor;
237: }
238:
239: /**
240: *
241: */
242: public String getValueAxisTickLabelMask() {
243: return valueAxisTickLabelMask;
244: }
245:
246: /**
247: *
248: */
249: public Color getValueAxisLineColor() {
250: return JRStyleResolver.getValueAxisLineColor(this , this );
251: }
252:
253: /**
254: *
255: */
256: public Color getOwnValueAxisLineColor() {
257: return valueAxisLineColor;
258: }
259:
260: /**
261: *
262: */
263: public double getXOffset() {
264: return xOffset;
265: }
266:
267: /**
268: *
269: */
270: public void setXOffset(double xOffset) {
271: this .xOffset = xOffset;
272: }
273:
274: /**
275: *
276: */
277: public double getYOffset() {
278: return yOffset;
279: }
280:
281: /**
282: *
283: */
284: public void setYOffset(double yOffset) {
285: this .yOffset = yOffset;
286: }
287:
288: /**
289: *
290: */
291: public boolean isShowLabels() {
292: return isShowLabels;
293: }
294:
295: /**
296: *
297: */
298: public void setShowLabels(boolean isShowLabels) {
299: this .isShowLabels = isShowLabels;
300: }
301:
302: /**
303: *
304: */
305: public void collectExpressions(JRExpressionCollector collector) {
306: collector.collect(this);
307: }
308:
309: }
|