KickJava   Java API By Example, From Geeks To Geeks.

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


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.JRLinePlot;
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: JRBaseLinePlot.java 1386 2006-09-06 00:33:02 +0300 (Wed, 06 Sep 2006) bklawans $
44  */

45 public class JRBaseLinePlot extends JRBaseChartPlot implements JRLinePlot {
46     
47     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
48     
49     protected JRExpression categoryAxisLabelExpression = null;
50     protected JRFont categoryAxisLabelFont = null;
51     protected Color JavaDoc categoryAxisLabelColor = null;
52     protected JRFont categoryAxisTickLabelFont = null;
53     protected Color JavaDoc categoryAxisTickLabelColor = null;
54     protected String JavaDoc categoryAxisTickLabelMask = null;
55     protected Color JavaDoc categoryAxisLineColor = 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      */

72     public JRBaseLinePlot( JRChartPlot linePlot){
73         super( linePlot);
74     }
75     
76     /**
77      *
78      */

79     public JRBaseLinePlot( JRLinePlot linePlot, JRBaseObjectFactory factory ){
80         super( linePlot, factory );
81         
82         isShowShapes = linePlot.isShowShapes();
83         isShowLines = linePlot.isShowLines();
84         
85         categoryAxisLabelExpression = factory.getExpression( linePlot.getCategoryAxisLabelExpression() );
86         categoryAxisLabelFont = factory.getFont(linePlot.getCategoryAxisLabelFont());
87         categoryAxisLabelColor = linePlot.getCategoryAxisLabelColor();
88         categoryAxisTickLabelFont = factory.getFont(linePlot.getCategoryAxisTickLabelFont());
89         categoryAxisTickLabelColor = linePlot.getCategoryAxisTickLabelColor();
90         categoryAxisTickLabelMask = linePlot.getCategoryAxisTickLabelMask();
91         categoryAxisLineColor = linePlot.getCategoryAxisLineColor();
92         
93         valueAxisLabelExpression = factory.getExpression( linePlot.getValueAxisLabelExpression() );
94         valueAxisLabelFont = factory.getFont(linePlot.getValueAxisLabelFont());
95         valueAxisLabelColor = linePlot.getValueAxisLabelColor();
96         valueAxisTickLabelFont = factory.getFont(linePlot.getValueAxisTickLabelFont());
97         valueAxisTickLabelColor = linePlot.getValueAxisTickLabelColor();
98         valueAxisTickLabelMask = linePlot.getValueAxisTickLabelMask();
99         valueAxisLineColor = linePlot.getValueAxisLineColor();
100     }
101     
102     /**
103      *
104      */

105     public JRExpression getCategoryAxisLabelExpression(){
106         return categoryAxisLabelExpression;
107     }
108     
109     /**
110      *
111      */

112     public JRFont getCategoryAxisLabelFont()
113     {
114         return categoryAxisLabelFont;
115     }
116     
117     /**
118      *
119      */

120     public Color JavaDoc getCategoryAxisLabelColor()
121     {
122         return categoryAxisLabelColor;
123     }
124     
125     
126     /**
127      *
128      */

129     public JRFont getCategoryAxisTickLabelFont()
130     {
131         return categoryAxisTickLabelFont;
132     }
133     
134     /**
135      *
136      */

137     public Color JavaDoc getCategoryAxisTickLabelColor()
138     {
139         return categoryAxisTickLabelColor;
140     }
141
142     /**
143      *
144      */

145     public String JavaDoc getCategoryAxisTickLabelMask()
146     {
147         return categoryAxisTickLabelMask;
148     }
149
150     /**
151      *
152      */

153     public Color JavaDoc getCategoryAxisLineColor()
154     {
155         return categoryAxisLineColor;
156     }
157     
158     /**
159      *
160      */

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

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

176     public Color JavaDoc getValueAxisLabelColor()
177     {
178         return valueAxisLabelColor;
179     }
180         
181     
182     /**
183      *
184      */

185     public JRFont getValueAxisTickLabelFont()
186     {
187         return valueAxisTickLabelFont;
188     }
189     
190     /**
191      *
192      */

193     public Color JavaDoc getValueAxisTickLabelColor()
194     {
195         return valueAxisTickLabelColor;
196     }
197
198     /**
199      *
200      */

201     public String JavaDoc getValueAxisTickLabelMask()
202     {
203         return valueAxisTickLabelMask;
204     }
205
206     /**
207      *
208      */

209     public Color JavaDoc getValueAxisLineColor()
210     {
211         return valueAxisLineColor;
212     }
213
214     /**
215      *
216      */

217     public boolean isShowShapes(){
218         return isShowShapes;
219     }
220     
221     /**
222      *
223      */

224     public boolean isShowLines(){
225         return isShowLines;
226     }
227     
228     /**
229      *
230      */

231     public void setShowShapes( boolean value ){
232         this.isShowShapes = value;
233     }
234     
235     /**
236      *
237      */

238     public void setShowLines( boolean value ){
239         this.isShowLines = value;
240     }
241
242     /**
243      *
244      */

245     public void collectExpressions(JRExpressionCollector collector)
246     {
247         collector.collect(this);
248     }
249
250 }
251
Popular Tags