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.JRBarPlot;
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: /**
045: * @author Teodor Danciu (teodord@users.sourceforge.net)
046: * @version $Id: JRBaseBarPlot.java 1577 2007-02-09 11:25:48Z teodord $
047: */
048: public class JRBaseBarPlot extends JRBaseChartPlot implements JRBarPlot {
049:
050: /**
051: *
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 boolean isShowTickMarks = false;
072: protected boolean isShowTickLabels = false;
073: protected boolean isShowLabels = false;
074:
075: /**
076: *
077: */
078: public JRBaseBarPlot(JRChartPlot barPlot, JRChart chart) {
079: super (barPlot, chart);
080: }
081:
082: /**
083: *
084: */
085: public JRBaseBarPlot(JRBarPlot barPlot, JRBaseObjectFactory factory) {
086: super (barPlot, factory);
087:
088: isShowTickMarks = barPlot.isShowTickMarks();
089: isShowTickLabels = barPlot.isShowTickLabels();
090: isShowLabels = barPlot.isShowLabels();
091:
092: categoryAxisLabelExpression = factory.getExpression(barPlot
093: .getCategoryAxisLabelExpression());
094: categoryAxisLabelFont = new JRBaseFont(null, null, barPlot
095: .getChart(), barPlot.getCategoryAxisLabelFont());
096: categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor();
097: categoryAxisTickLabelFont = new JRBaseFont(null, null, barPlot
098: .getChart(), barPlot.getCategoryAxisTickLabelFont());
099: categoryAxisTickLabelColor = barPlot
100: .getOwnCategoryAxisTickLabelColor();
101: categoryAxisTickLabelMask = barPlot
102: .getCategoryAxisTickLabelMask();
103: categoryAxisLineColor = barPlot.getCategoryAxisLineColor();
104:
105: valueAxisLabelExpression = factory.getExpression(barPlot
106: .getValueAxisLabelExpression());
107: valueAxisLabelFont = new JRBaseFont(null, null, barPlot
108: .getChart(), barPlot.getValueAxisLabelFont());
109: valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor();
110: valueAxisTickLabelFont = new JRBaseFont(null, null, barPlot
111: .getChart(), barPlot.getValueAxisTickLabelFont());
112: valueAxisTickLabelColor = barPlot
113: .getOwnValueAxisTickLabelColor();
114: valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask();
115: valueAxisLineColor = barPlot.getValueAxisLineColor();
116: }
117:
118: /**
119: *
120: */
121: public JRExpression getCategoryAxisLabelExpression() {
122: return categoryAxisLabelExpression;
123: }
124:
125: /**
126: *
127: */
128: public JRFont getCategoryAxisLabelFont() {
129: return categoryAxisLabelFont;
130: }
131:
132: /**
133: *
134: */
135: public Color getCategoryAxisLabelColor() {
136: return JRStyleResolver.getCategoryAxisLabelColor(this , this );
137: }
138:
139: /**
140: *
141: */
142: public Color getOwnCategoryAxisLabelColor() {
143: return categoryAxisLabelColor;
144: }
145:
146: /**
147: *
148: */
149: public JRFont getCategoryAxisTickLabelFont() {
150: return categoryAxisTickLabelFont;
151: }
152:
153: /**
154: *
155: */
156: public Color getCategoryAxisTickLabelColor() {
157: return JRStyleResolver
158: .getCategoryAxisTickLabelColor(this , this );
159: }
160:
161: /**
162: *
163: */
164: public Color getOwnCategoryAxisTickLabelColor() {
165: return categoryAxisTickLabelColor;
166: }
167:
168: /**
169: *
170: */
171: public String getCategoryAxisTickLabelMask() {
172: return categoryAxisTickLabelMask;
173: }
174:
175: /**
176: *
177: */
178: public Color getCategoryAxisLineColor() {
179: return JRStyleResolver.getCategoryAxisLineColor(this , this );
180: }
181:
182: /**
183: *
184: */
185: public Color getOwnCategoryAxisLineColor() {
186: return categoryAxisLineColor;
187: }
188:
189: /**
190: *
191: */
192: public JRExpression getValueAxisLabelExpression() {
193: return valueAxisLabelExpression;
194: }
195:
196: /**
197: *
198: */
199: public JRFont getValueAxisLabelFont() {
200: return valueAxisLabelFont;
201: }
202:
203: /**
204: *
205: */
206: public Color getValueAxisLabelColor() {
207: return JRStyleResolver.getValueAxisLabelColor(this , this );
208: }
209:
210: /**
211: *
212: */
213: public Color getOwnValueAxisLabelColor() {
214: return valueAxisLabelColor;
215: }
216:
217: /**
218: *
219: */
220: public JRFont getValueAxisTickLabelFont() {
221: return valueAxisTickLabelFont;
222: }
223:
224: /**
225: *
226: */
227: public Color getValueAxisTickLabelColor() {
228: return JRStyleResolver.getValueAxisTickLabelColor(this , this );
229: }
230:
231: /**
232: *
233: */
234: public Color getOwnValueAxisTickLabelColor() {
235: return valueAxisTickLabelColor;
236: }
237:
238: /**
239: *
240: */
241: public String getValueAxisTickLabelMask() {
242: return valueAxisTickLabelMask;
243: }
244:
245: /**
246: *
247: */
248: public Color getValueAxisLineColor() {
249: return JRStyleResolver.getValueAxisLineColor(this , this );
250: }
251:
252: /**
253: *
254: */
255: public Color getOwnValueAxisLineColor() {
256: return valueAxisLineColor;
257: }
258:
259: /**
260: *
261: */
262: public boolean isShowTickMarks() {
263: return isShowTickMarks;
264: }
265:
266: /**
267: *
268: */
269: public void setShowTickMarks(boolean isShowTickMarks) {
270: this .isShowTickMarks = isShowTickMarks;
271: }
272:
273: /**
274: *
275: */
276: public boolean isShowTickLabels() {
277: return isShowTickLabels;
278: }
279:
280: /**
281: *
282: */
283: public void setShowTickLabels(boolean isShowTickLabels) {
284: this .isShowTickLabels = isShowTickLabels;
285: }
286:
287: /**
288: *
289: */
290: public boolean isShowLabels() {
291: return isShowLabels;
292: }
293:
294: /**
295: *
296: */
297: public void setShowLabels(boolean isShowLabels) {
298: this .isShowLabels = isShowLabels;
299: }
300:
301: /**
302: *
303: */
304: public void collectExpressions(JRExpressionCollector collector) {
305: collector.collect(this);
306: }
307:
308: }
|