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.JRAreaPlot;
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 Flavius Sana (flavius_sana@users.sourceforge.net)
046: * @version $Id: JRBaseAreaPlot.java 1577 2007-02-09 11:25:48Z teodord $
047: */
048: public class JRBaseAreaPlot extends JRBaseChartPlot implements
049: JRAreaPlot {
050:
051: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
052:
053: protected JRExpression categoryAxisLabelExpression = null;
054: protected JRFont categoryAxisLabelFont = null;
055: protected Color categoryAxisLabelColor = null;
056: protected JRFont categoryAxisTickLabelFont = null;
057: protected Color categoryAxisTickLabelColor = null;
058: protected String categoryAxisTickLabelMask = null;
059: protected Color categoryAxisLineColor = null;
060:
061: protected JRExpression valueAxisLabelExpression = null;
062: protected JRFont valueAxisLabelFont = null;
063: protected Color valueAxisLabelColor = null;
064: protected JRFont valueAxisTickLabelFont = null;
065: protected Color valueAxisTickLabelColor = null;
066: protected String valueAxisTickLabelMask = null;
067: protected Color valueAxisLineColor = null;
068:
069: /**
070: *
071: */
072: public JRBaseAreaPlot(JRChartPlot areaPlot, JRChart chart) {
073: super (areaPlot, chart);
074: }
075:
076: /**
077: *
078: */
079: public JRBaseAreaPlot(JRAreaPlot areaPlot,
080: JRBaseObjectFactory factory) {
081: super (areaPlot, factory);
082:
083: categoryAxisLabelExpression = factory.getExpression(areaPlot
084: .getCategoryAxisLabelExpression());
085: categoryAxisLabelFont = new JRBaseFont(null, null, areaPlot
086: .getChart(), areaPlot.getCategoryAxisLabelFont());
087: categoryAxisLabelColor = areaPlot
088: .getOwnCategoryAxisLabelColor();
089: categoryAxisTickLabelFont = new JRBaseFont(null, null, areaPlot
090: .getChart(), areaPlot.getCategoryAxisTickLabelFont());
091: categoryAxisTickLabelColor = areaPlot
092: .getOwnCategoryAxisTickLabelColor();
093: categoryAxisTickLabelMask = areaPlot
094: .getCategoryAxisTickLabelMask();
095: categoryAxisLineColor = areaPlot.getOwnCategoryAxisLineColor();
096:
097: valueAxisLabelExpression = factory.getExpression(areaPlot
098: .getValueAxisLabelExpression());
099: valueAxisLabelFont = new JRBaseFont(null, null, areaPlot
100: .getChart(), areaPlot.getValueAxisLabelFont());
101: valueAxisLabelColor = areaPlot.getOwnValueAxisLabelColor();
102: valueAxisTickLabelFont = new JRBaseFont(null, null, areaPlot
103: .getChart(), areaPlot.getValueAxisTickLabelFont());
104: valueAxisTickLabelColor = areaPlot
105: .getOwnValueAxisTickLabelColor();
106: valueAxisTickLabelMask = areaPlot.getValueAxisTickLabelMask();
107: valueAxisLineColor = areaPlot.getOwnValueAxisLineColor();
108: }
109:
110: /**
111: *
112: */
113: public JRExpression getCategoryAxisLabelExpression() {
114: return categoryAxisLabelExpression;
115: }
116:
117: /**
118: *
119: */
120: public JRFont getCategoryAxisLabelFont() {
121: return categoryAxisLabelFont;
122: }
123:
124: /**
125: *
126: */
127: public Color getCategoryAxisLabelColor() {
128: return JRStyleResolver.getCategoryAxisLabelColor(this , this );
129: }
130:
131: /**
132: *
133: */
134: public Color getOwnCategoryAxisLabelColor() {
135: return categoryAxisLabelColor;
136: }
137:
138: /**
139: *
140: */
141: public JRFont getCategoryAxisTickLabelFont() {
142: return categoryAxisTickLabelFont;
143: }
144:
145: /**
146: *
147: */
148: public Color getCategoryAxisTickLabelColor() {
149: return JRStyleResolver
150: .getCategoryAxisTickLabelColor(this , this );
151: }
152:
153: /**
154: *
155: */
156: public Color getOwnCategoryAxisTickLabelColor() {
157: return categoryAxisTickLabelColor;
158: }
159:
160: /**
161: *
162: */
163: public String getCategoryAxisTickLabelMask() {
164: return categoryAxisTickLabelMask;
165: }
166:
167: /**
168: *
169: */
170: public Color getCategoryAxisLineColor() {
171: return JRStyleResolver.getCategoryAxisLineColor(this , this );
172: }
173:
174: /**
175: *
176: */
177: public Color getOwnCategoryAxisLineColor() {
178: return categoryAxisLineColor;
179: }
180:
181: /**
182: *
183: */
184: public JRExpression getValueAxisLabelExpression() {
185: return valueAxisLabelExpression;
186: }
187:
188: /**
189: *
190: */
191: public JRFont getValueAxisLabelFont() {
192: return valueAxisLabelFont;
193: }
194:
195: /**
196: *
197: */
198: public Color getValueAxisLabelColor() {
199: return JRStyleResolver.getValueAxisLabelColor(this , this );
200: }
201:
202: /**
203: *
204: */
205: public Color getOwnValueAxisLabelColor() {
206: return valueAxisLabelColor;
207: }
208:
209: /**
210: *
211: */
212: public JRFont getValueAxisTickLabelFont() {
213: return valueAxisTickLabelFont;
214: }
215:
216: /**
217: *
218: */
219: public Color getValueAxisTickLabelColor() {
220: return JRStyleResolver.getValueAxisTickLabelColor(this , this );
221: }
222:
223: /**
224: *
225: */
226: public Color getOwnValueAxisTickLabelColor() {
227: return valueAxisTickLabelColor;
228: }
229:
230: /**
231: *
232: */
233: public String getValueAxisTickLabelMask() {
234: return valueAxisTickLabelMask;
235: }
236:
237: /**
238: *
239: */
240: public Color getValueAxisLineColor() {
241: return JRStyleResolver.getValueAxisLineColor(this , this );
242: }
243:
244: /**
245: *
246: */
247: public Color getOwnValueAxisLineColor() {
248: return valueAxisLineColor;
249: }
250:
251: /**
252: *
253: */
254: public void collectExpressions(JRExpressionCollector collector) {
255: collector.collect(this);
256: }
257:
258: }
|