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.JRTimeSeriesPlot;
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: JRBaseTimeSeriesPlot.java 1577 2007-02-09 11:25:48Z teodord $
047: */
048: public class JRBaseTimeSeriesPlot extends JRBaseChartPlot implements
049: JRTimeSeriesPlot {
050:
051: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
052:
053: protected JRExpression timeAxisLabelExpression = null;
054: protected JRFont timeAxisLabelFont = null;
055: protected Color timeAxisLabelColor = null;
056: protected JRFont timeAxisTickLabelFont = null;
057: protected Color timeAxisTickLabelColor = null;
058: protected String timeAxisTickLabelMask = null;
059: protected Color timeAxisLineColor = 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: boolean isShowShapes = true;
070: boolean isShowLines = true;
071:
072: /**
073: *
074: */
075: protected JRBaseTimeSeriesPlot(JRChartPlot plot, JRChart chart) {
076: super (plot, chart);
077: }
078:
079: /**
080: *
081: */
082: public JRBaseTimeSeriesPlot(JRTimeSeriesPlot plot,
083: JRBaseObjectFactory factory) {
084: super (plot, factory);
085:
086: isShowLines = plot.isShowLines();
087: isShowShapes = plot.isShowShapes();
088:
089: timeAxisLabelExpression = factory.getExpression(plot
090: .getTimeAxisLabelExpression());
091: timeAxisLabelFont = new JRBaseFont(null, null, plot.getChart(),
092: plot.getTimeAxisLabelFont());
093: timeAxisLabelColor = plot.getOwnTimeAxisLabelColor();
094: timeAxisTickLabelFont = new JRBaseFont(null, null, plot
095: .getChart(), plot.getTimeAxisTickLabelFont());
096: timeAxisTickLabelColor = plot.getOwnTimeAxisTickLabelColor();
097: timeAxisTickLabelMask = plot.getTimeAxisTickLabelMask();
098: timeAxisLineColor = plot.getTimeAxisLineColor();
099:
100: valueAxisLabelExpression = factory.getExpression(plot
101: .getValueAxisLabelExpression());
102: valueAxisLabelFont = new JRBaseFont(null, null,
103: plot.getChart(), plot.getValueAxisLabelFont());
104: valueAxisLabelColor = plot.getOwnValueAxisLabelColor();
105: valueAxisTickLabelFont = new JRBaseFont(null, null, plot
106: .getChart(), plot.getValueAxisTickLabelFont());
107: valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor();
108: valueAxisTickLabelMask = plot.getValueAxisTickLabelMask();
109: valueAxisLineColor = plot.getValueAxisTickLabelColor();
110: }
111:
112: /**
113: *
114: */
115: public JRExpression getTimeAxisLabelExpression() {
116: return timeAxisLabelExpression;
117: }
118:
119: /**
120: *
121: */
122: public JRFont getTimeAxisLabelFont() {
123: return timeAxisLabelFont;
124: }
125:
126: /**
127: *
128: */
129: public Color getTimeAxisLabelColor() {
130: return JRStyleResolver.getTimeAxisLabelColor(this , this );
131: }
132:
133: /**
134: *
135: */
136: public Color getOwnTimeAxisLabelColor() {
137: return timeAxisLabelColor;
138: }
139:
140: /**
141: *
142: */
143: public JRFont getTimeAxisTickLabelFont() {
144: return timeAxisTickLabelFont;
145: }
146:
147: /**
148: *
149: */
150: public Color getTimeAxisTickLabelColor() {
151: return JRStyleResolver.getTimeAxisTickLabelColor(this , this );
152: }
153:
154: /**
155: *
156: */
157: public Color getOwnTimeAxisTickLabelColor() {
158: return timeAxisTickLabelColor;
159: }
160:
161: /**
162: *
163: */
164: public String getTimeAxisTickLabelMask() {
165: return timeAxisTickLabelMask;
166: }
167:
168: /**
169: *
170: */
171: public Color getTimeAxisLineColor() {
172: return JRStyleResolver.getTimeAxisLineColor(this , this );
173: }
174:
175: /**
176: *
177: */
178: public Color getOwnTimeAxisLineColor() {
179: return timeAxisLineColor;
180: }
181:
182: /**
183: *
184: */
185: public JRExpression getValueAxisLabelExpression() {
186: return valueAxisLabelExpression;
187: }
188:
189: /**
190: *
191: */
192: public JRFont getValueAxisLabelFont() {
193: return valueAxisLabelFont;
194: }
195:
196: /**
197: *
198: */
199: public Color getValueAxisLabelColor() {
200: return JRStyleResolver.getValueAxisLabelColor(this , this );
201: }
202:
203: /**
204: *
205: */
206: public Color getOwnValueAxisLabelColor() {
207: return valueAxisLabelColor;
208: }
209:
210: /**
211: *
212: */
213: public JRFont getValueAxisTickLabelFont() {
214: return valueAxisTickLabelFont;
215: }
216:
217: /**
218: *
219: */
220: public Color getValueAxisTickLabelColor() {
221: return JRStyleResolver.getValueAxisTickLabelColor(this , this );
222: }
223:
224: /**
225: *
226: */
227: public Color getOwnValueAxisTickLabelColor() {
228: return valueAxisTickLabelColor;
229: }
230:
231: /**
232: *
233: */
234: public String getValueAxisTickLabelMask() {
235: return valueAxisTickLabelMask;
236: }
237:
238: /**
239: *
240: */
241: public Color getValueAxisLineColor() {
242: return JRStyleResolver.getValueAxisLineColor(this , this );
243: }
244:
245: /**
246: *
247: */
248: public Color getOwnValueAxisLineColor() {
249: return valueAxisLineColor;
250: }
251:
252: /**
253: *
254: */
255: public boolean isShowLines() {
256: return isShowLines;
257: }
258:
259: /**
260: *
261: */
262: public boolean isShowShapes() {
263: return isShowShapes;
264: }
265:
266: /**
267: *
268: */
269: public void setShowLines(boolean val) {
270: this .isShowLines = val;
271: }
272:
273: /**
274: *
275: */
276: public void setShowShapes(boolean val) {
277: this .isShowShapes = val;
278: }
279:
280: /**
281: *
282: */
283: public void collectExpressions(JRExpressionCollector collector) {
284: collector.collect(this);
285: }
286:
287: }
|