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