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