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