KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > charts > base > JRBaseTimeSeriesPlot


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.charts.base;
29
30 import java.awt.Color JavaDoc;
31
32 import net.sf.jasperreports.charts.JRTimeSeriesPlot;
33 import net.sf.jasperreports.engine.JRChartPlot;
34 import net.sf.jasperreports.engine.JRConstants;
35 import net.sf.jasperreports.engine.JRExpression;
36 import net.sf.jasperreports.engine.JRExpressionCollector;
37 import net.sf.jasperreports.engine.JRFont;
38 import net.sf.jasperreports.engine.base.JRBaseChartPlot;
39 import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
40
41 /**
42  * @author Flavius Sana (flavius_sana@users.sourceforge.net)
43  * @version $Id: JRBaseTimeSeriesPlot.java 1386 2006-09-06 00:33:02 +0300 (Wed, 06 Sep 2006) bklawans $
44  */

45 public class JRBaseTimeSeriesPlot extends JRBaseChartPlot implements JRTimeSeriesPlot {
46
47     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
48     
49     protected JRExpression timeAxisLabelExpression = null;
50     protected JRFont timeAxisLabelFont = null;
51     protected Color JavaDoc timeAxisLabelColor = null;
52     protected JRFont timeAxisTickLabelFont = null;
53     protected Color JavaDoc timeAxisTickLabelColor = null;
54     protected String JavaDoc timeAxisTickLabelMask = null;
55     protected Color JavaDoc timeAxisLineColor = null;
56
57     protected JRExpression valueAxisLabelExpression = null;
58     protected JRFont valueAxisLabelFont = null;
59     protected Color JavaDoc valueAxisLabelColor = null;
60     protected JRFont valueAxisTickLabelFont = null;
61     protected Color JavaDoc valueAxisTickLabelColor = null;
62     protected String JavaDoc valueAxisTickLabelMask = null;
63     protected Color JavaDoc valueAxisLineColor = null;
64     
65     boolean isShowShapes = true;
66     boolean isShowLines = true;
67     
68     /**
69      *
70      */

71     protected JRBaseTimeSeriesPlot( JRChartPlot plot ){
72         super( plot );
73     }
74     
75     /**
76      *
77      */

78     public JRBaseTimeSeriesPlot( JRTimeSeriesPlot plot, JRBaseObjectFactory factory ){
79         super( plot, factory );
80         
81         isShowLines = plot.isShowLines();
82         isShowShapes = plot.isShowShapes();
83         
84         timeAxisLabelExpression = factory.getExpression( plot.getTimeAxisLabelExpression() );
85         timeAxisLabelFont = factory.getFont(plot.getTimeAxisLabelFont());
86         timeAxisLabelColor = plot.getTimeAxisLabelColor();
87         timeAxisTickLabelFont = factory.getFont(plot.getTimeAxisTickLabelFont());
88         timeAxisTickLabelColor = plot.getTimeAxisTickLabelColor();
89         timeAxisTickLabelMask = plot.getTimeAxisTickLabelMask();
90         timeAxisLineColor = plot.getTimeAxisLineColor();
91         
92         valueAxisLabelExpression = factory.getExpression( plot.getValueAxisLabelExpression() );
93         valueAxisLabelFont = factory.getFont(plot.getValueAxisLabelFont());
94         valueAxisLabelColor = plot.getValueAxisLabelColor();
95         valueAxisTickLabelFont = factory.getFont(plot.getValueAxisTickLabelFont());
96         valueAxisTickLabelColor = plot.getValueAxisTickLabelColor();
97         valueAxisTickLabelMask = plot.getValueAxisTickLabelMask();
98         valueAxisLineColor = plot.getValueAxisTickLabelColor();
99     }
100     
101     /**
102      *
103      */

104     public JRExpression getTimeAxisLabelExpression(){
105         return timeAxisLabelExpression;
106     }
107     
108     /**
109      *
110      */

111     public JRFont getTimeAxisLabelFont()
112     {
113         return timeAxisLabelFont;
114     }
115     
116     /**
117      *
118      */

119     public Color JavaDoc getTimeAxisLabelColor()
120     {
121         return timeAxisLabelColor;
122     }
123     
124     /**
125      *
126      */

127     public JRFont getTimeAxisTickLabelFont()
128     {
129         return timeAxisTickLabelFont;
130     }
131     
132     /**
133      *
134      */

135     public Color JavaDoc getTimeAxisTickLabelColor()
136     {
137         return timeAxisTickLabelColor;
138     }
139
140     /**
141      *
142      */

143     public String JavaDoc getTimeAxisTickLabelMask()
144     {
145         return timeAxisTickLabelMask;
146     }
147
148     /**
149      *
150      */

151     public Color JavaDoc getTimeAxisLineColor()
152     {
153         return timeAxisLineColor;
154     }
155     
156     /**
157      *
158      */

159     public JRExpression getValueAxisLabelExpression(){
160         return valueAxisLabelExpression;
161     }
162
163     /**
164      *
165      */

166     public JRFont getValueAxisLabelFont()
167     {
168         return valueAxisLabelFont;
169     }
170     
171     /**
172      *
173      */

174     public Color JavaDoc getValueAxisLabelColor()
175     {
176         return valueAxisLabelColor;
177     }
178         
179     /**
180      *
181      */

182     public JRFont getValueAxisTickLabelFont()
183     {
184         return valueAxisTickLabelFont;
185     }
186     
187     /**
188      *
189      */

190     public Color JavaDoc getValueAxisTickLabelColor()
191     {
192         return valueAxisTickLabelColor;
193     }
194
195     /**
196      *
197      */

198     public String JavaDoc getValueAxisTickLabelMask()
199     {
200         return valueAxisTickLabelMask;
201     }
202
203     /**
204      *
205      */

206     public Color JavaDoc getValueAxisLineColor()
207     {
208         return valueAxisLineColor;
209     }
210
211     /**
212      *
213      */

214     public boolean isShowLines(){
215         return isShowLines;
216     }
217     
218     /**
219      *
220      */

221     public boolean isShowShapes(){
222         return isShowShapes;
223     }
224     
225     /**
226      *
227      */

228     public void setShowLines( boolean val ){
229         this.isShowLines = val;
230     }
231     
232     /**
233      *
234      */

235     public void setShowShapes( boolean val ){
236         this.isShowShapes = val;
237     }
238
239     /**
240      *
241      */

242     public void collectExpressions(JRExpressionCollector collector)
243     {
244         collector.collect(this);
245     }
246
247 }
248
Popular Tags