KickJava   Java API By Example, From Geeks To Geeks.

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


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.JRBar3DPlot;
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 import org.jfree.chart.renderer.category.BarRenderer3D;
42
43 /**
44  * @author Flavius Sana (flavius_sana@users.sourceforge.net)
45  * @version $Id: JRBaseBar3DPlot.java 1386 2006-09-06 00:33:02 +0300 (Wed, 06 Sep 2006) bklawans $
46  */

47 public class JRBaseBar3DPlot extends JRBaseChartPlot implements JRBar3DPlot {
48
49     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
50     
51     protected JRExpression categoryAxisLabelExpression = null;
52     protected JRFont categoryAxisLabelFont = null;
53     protected Color JavaDoc categoryAxisLabelColor = null;
54     protected JRFont categoryAxisTickLabelFont = null;
55     protected Color JavaDoc categoryAxisTickLabelColor = null;
56     protected String JavaDoc categoryAxisTickLabelMask = null;
57     protected Color JavaDoc categoryAxisLineColor = null;
58
59     protected JRExpression valueAxisLabelExpression = null;
60     protected JRFont valueAxisLabelFont = null;
61     protected Color JavaDoc valueAxisLabelColor = null;
62     protected JRFont valueAxisTickLabelFont = null;
63     protected Color JavaDoc valueAxisTickLabelColor = null;
64     protected String JavaDoc valueAxisTickLabelMask = null;
65     protected Color JavaDoc valueAxisLineColor = null;
66
67     protected double xOffset = BarRenderer3D.DEFAULT_X_OFFSET;
68     protected double yOffset = BarRenderer3D.DEFAULT_Y_OFFSET;
69     protected boolean isShowLabels = false;
70     
71
72     /**
73      *
74      */

75     public JRBaseBar3DPlot( JRChartPlot barPlot){
76         super( barPlot);
77     }
78
79
80     /**
81      *
82      */

83     public JRBaseBar3DPlot( JRBar3DPlot barPlot, JRBaseObjectFactory factory ){
84         super( barPlot, factory );
85         
86         xOffset = barPlot.getXOffset();
87         yOffset = barPlot.getYOffset();
88         isShowLabels = barPlot.isShowLabels();
89         
90         categoryAxisLabelExpression = factory.getExpression( barPlot.getCategoryAxisLabelExpression() );
91         categoryAxisLabelFont = factory.getFont(barPlot.getCategoryAxisLabelFont());
92         categoryAxisLabelColor = barPlot.getCategoryAxisLabelColor();
93         categoryAxisTickLabelFont = factory.getFont(barPlot.getCategoryAxisTickLabelFont());
94         categoryAxisTickLabelColor = barPlot.getCategoryAxisTickLabelColor();
95         categoryAxisTickLabelMask = barPlot.getCategoryAxisTickLabelMask();
96         categoryAxisLineColor = barPlot.getCategoryAxisLineColor();
97         
98         valueAxisLabelExpression = factory.getExpression( barPlot.getValueAxisLabelExpression() );
99         valueAxisLabelFont = factory.getFont(barPlot.getValueAxisLabelFont());
100         valueAxisLabelColor = barPlot.getValueAxisLabelColor();
101         valueAxisTickLabelFont = factory.getFont(barPlot.getValueAxisTickLabelFont());
102         valueAxisTickLabelColor = barPlot.getValueAxisTickLabelColor();
103         valueAxisTickLabelMask = barPlot.getValueAxisTickLabelMask();
104         valueAxisLineColor = barPlot.getValueAxisLineColor();
105     }
106     
107     /**
108      *
109      */

110     public JRExpression getCategoryAxisLabelExpression(){
111         return categoryAxisLabelExpression;
112     }
113     
114     /**
115      *
116      */

117     public JRFont getCategoryAxisLabelFont()
118     {
119         return categoryAxisLabelFont;
120     }
121     
122     /**
123      *
124      */

125     public Color JavaDoc getCategoryAxisLabelColor()
126     {
127         return categoryAxisLabelColor;
128     }
129     
130     /**
131      *
132      */

133     public JRFont getCategoryAxisTickLabelFont()
134     {
135         return categoryAxisTickLabelFont;
136     }
137     
138     /**
139      *
140      */

141     public Color JavaDoc getCategoryAxisTickLabelColor()
142     {
143         return categoryAxisTickLabelColor;
144     }
145
146     /**
147      *
148      */

149     public String JavaDoc getCategoryAxisTickLabelMask()
150     {
151         return categoryAxisTickLabelMask;
152     }
153
154     /**
155      *
156      */

157     public Color JavaDoc getCategoryAxisLineColor()
158     {
159         return categoryAxisLineColor;
160     }
161         
162     /**
163      *
164      */

165     public JRExpression getValueAxisLabelExpression(){
166         return valueAxisLabelExpression;
167     }
168
169     /**
170      *
171      */

172     public JRFont getValueAxisLabelFont()
173     {
174         return valueAxisLabelFont;
175     }
176     
177     /**
178      *
179      */

180     public Color JavaDoc getValueAxisLabelColor()
181     {
182         return valueAxisLabelColor;
183     }
184
185     /**
186      *
187      */

188     public JRFont getValueAxisTickLabelFont()
189     {
190         return valueAxisTickLabelFont;
191     }
192     
193     /**
194      *
195      */

196     public Color JavaDoc getValueAxisTickLabelColor()
197     {
198         return valueAxisTickLabelColor;
199     }
200
201     /**
202      *
203      */

204     public String JavaDoc getValueAxisTickLabelMask()
205     {
206         return valueAxisTickLabelMask;
207     }
208
209     /**
210      *
211      */

212     public Color JavaDoc getValueAxisLineColor()
213     {
214         return valueAxisLineColor;
215     }
216
217     /**
218      *
219      */

220     public double getXOffset(){
221         return xOffset;
222     }
223     
224     /**
225      *
226      */

227     public void setXOffset( double xOffset ){
228         this.xOffset = xOffset;
229     }
230     
231     /**
232      *
233      */

234     public double getYOffset(){
235         return yOffset;
236     }
237     
238     /**
239      *
240      */

241     public void setYOffset( double yOffset ){
242         this.yOffset = yOffset;
243     }
244     
245     /**
246      *
247      */

248     public boolean isShowLabels(){
249         return isShowLabels;
250     }
251     
252     /**
253      *
254      */

255     public void setShowLabels( boolean isShowLabels ){
256         this.isShowLabels = isShowLabels;
257     }
258
259     /**
260      *
261      */

262     public void collectExpressions(JRExpressionCollector collector)
263     {
264         collector.collect(this);
265     }
266
267 }
268
Popular Tags