KickJava   Java API By Example, From Geeks To Geeks.

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


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.JRBarPlot;
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 /**
43  * @author Teodor Danciu (teodord@users.sourceforge.net)
44  * @version $Id: JRBaseBarPlot.java 1386 2006-09-06 00:33:02 +0300 (Wed, 06 Sep 2006) bklawans $
45  */

46 public class JRBaseBarPlot extends JRBaseChartPlot implements JRBarPlot
47 {
48
49
50     /**
51      *
52      */

53     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
54
55     protected JRExpression categoryAxisLabelExpression = null;
56     protected JRFont categoryAxisLabelFont = null;
57     protected Color JavaDoc categoryAxisLabelColor = null;
58     protected JRFont categoryAxisTickLabelFont = null;
59     protected Color JavaDoc categoryAxisTickLabelColor = null;
60     protected String JavaDoc categoryAxisTickLabelMask = null;
61     protected Color JavaDoc categoryAxisLineColor = null;
62
63     protected JRExpression valueAxisLabelExpression = null;
64     protected JRFont valueAxisLabelFont = null;
65     protected Color JavaDoc valueAxisLabelColor = null;
66     protected JRFont valueAxisTickLabelFont = null;
67     protected Color JavaDoc valueAxisTickLabelColor = null;
68     protected String JavaDoc valueAxisTickLabelMask = null;
69     protected Color JavaDoc valueAxisLineColor = null;
70     
71     protected boolean isShowTickMarks = false;
72     protected boolean isShowTickLabels = false;
73     protected boolean isShowLabels = false;
74
75     
76     /**
77      *
78      */

79     public JRBaseBarPlot(JRChartPlot barPlot)
80     {
81         super(barPlot);
82     }
83     
84     /**
85      *
86      */

87     public JRBaseBarPlot(JRBarPlot barPlot, JRBaseObjectFactory factory)
88     {
89         super(barPlot, factory);
90
91         isShowTickMarks = barPlot.isShowTickMarks();
92         isShowTickLabels = barPlot.isShowTickLabels();
93         isShowLabels = barPlot.isShowLabels();
94         
95         categoryAxisLabelExpression = factory.getExpression( barPlot.getCategoryAxisLabelExpression() );
96         categoryAxisLabelFont = factory.getFont(barPlot.getCategoryAxisLabelFont());
97         categoryAxisLabelColor = barPlot.getCategoryAxisLabelColor();
98         categoryAxisTickLabelFont = factory.getFont(barPlot.getCategoryAxisTickLabelFont());
99         categoryAxisTickLabelColor = barPlot.getCategoryAxisTickLabelColor();
100         categoryAxisTickLabelMask = barPlot.getCategoryAxisTickLabelMask();
101         categoryAxisLineColor = barPlot.getCategoryAxisLineColor();
102         
103         valueAxisLabelExpression = factory.getExpression( barPlot.getValueAxisLabelExpression() );
104         valueAxisLabelFont = factory.getFont(barPlot.getValueAxisLabelFont());
105         valueAxisLabelColor = barPlot.getValueAxisLabelColor();
106         valueAxisTickLabelFont = factory.getFont(barPlot.getValueAxisTickLabelFont());
107         valueAxisTickLabelColor = barPlot.getValueAxisTickLabelColor();
108         valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask();
109         valueAxisLineColor = barPlot.getValueAxisLineColor();
110     }
111
112     /**
113      *
114      */

115     public JRExpression getCategoryAxisLabelExpression(){
116         return categoryAxisLabelExpression;
117     }
118     
119     /**
120      *
121      */

122     public JRFont getCategoryAxisLabelFont()
123     {
124         return categoryAxisLabelFont;
125     }
126     
127     /**
128      *
129      */

130     public Color JavaDoc getCategoryAxisLabelColor()
131     {
132         return categoryAxisLabelColor;
133     }
134     
135     /**
136      *
137      */

138     public JRFont getCategoryAxisTickLabelFont()
139     {
140         return categoryAxisTickLabelFont;
141     }
142
143     /**
144      *
145      */

146     public Color JavaDoc getCategoryAxisTickLabelColor()
147     {
148         return categoryAxisTickLabelColor;
149     }
150
151     /**
152      *
153      */

154     public String JavaDoc getCategoryAxisTickLabelMask()
155     {
156         return categoryAxisTickLabelMask;
157     }
158
159     /**
160      *
161      */

162     public Color JavaDoc getCategoryAxisLineColor()
163     {
164         return categoryAxisLineColor;
165     }
166     
167     /**
168      *
169      */

170     public JRExpression getValueAxisLabelExpression(){
171         return valueAxisLabelExpression;
172     }
173
174     /**
175      *
176      */

177     public JRFont getValueAxisLabelFont()
178     {
179         return valueAxisLabelFont;
180     }
181     
182     /**
183      *
184      */

185     public Color JavaDoc getValueAxisLabelColor()
186     {
187         return valueAxisLabelColor;
188     }
189         
190     
191     /**
192      *
193      */

194     public JRFont getValueAxisTickLabelFont()
195     {
196         return valueAxisTickLabelFont;
197     }
198     
199     /**
200      *
201      */

202     public Color JavaDoc getValueAxisTickLabelColor()
203     {
204         return valueAxisTickLabelColor;
205     }
206
207     /**
208      *
209      */

210     public String JavaDoc getValueAxisTickLabelMask()
211     {
212         return valueAxisTickLabelMask;
213     }
214
215     /**
216      *
217      */

218     public Color JavaDoc getValueAxisLineColor()
219     {
220         return valueAxisLineColor;
221     }
222     /**
223      *
224      */

225     public boolean isShowTickMarks()
226     {
227         return isShowTickMarks;
228     }
229         
230     /**
231      *
232      */

233     public void setShowTickMarks(boolean isShowTickMarks)
234     {
235         this.isShowTickMarks = isShowTickMarks;
236     }
237         
238     /**
239      *
240      */

241     public boolean isShowTickLabels()
242     {
243         return isShowTickLabels;
244     }
245         
246     /**
247      *
248      */

249     public void setShowTickLabels(boolean isShowTickLabels)
250     {
251         this.isShowTickLabels = isShowTickLabels;
252     }
253     
254     /**
255      *
256      */

257     public boolean isShowLabels(){
258         return isShowLabels;
259     }
260     
261     /**
262      *
263      */

264     public void setShowLabels( boolean isShowLabels ){
265         this.isShowLabels = isShowLabels;
266     }
267         
268     /**
269      *
270      */

271     public void collectExpressions(JRExpressionCollector collector)
272     {
273         collector.collect(this);
274     }
275
276 }
277
Popular Tags