KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > charts > util > JRAxisFormat


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.util;
29
30 import java.awt.Color JavaDoc;
31 import java.io.Serializable JavaDoc;
32
33 import net.sf.jasperreports.engine.JRConstants;
34 import net.sf.jasperreports.engine.JRFont;
35
36 /**
37  * Represents all the formatting options of a chart axis. The axis can be either a domain or
38  * a range axis, and any options that do not apply to the current axis are simply ignored.
39  *
40  * @author Barry Klawans (bklawans@users.sourceforge.net)
41  * @version $Id: JRAxisFormat.java 1413 2006-09-28 13:47:40 +0300 (Thu, 28 Sep 2006) teodord $
42  */

43 public class JRAxisFormat implements Serializable JavaDoc {
44     
45     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
46     
47     /**
48      * The color to use when writing the label of the axis.
49      */

50     protected Color JavaDoc labelColor = null;
51
52     /**
53      * The font to use when writing the label of the axis.
54      */

55     protected JRFont labelFont = null;
56
57     /**
58      * The color to use when writing the label of each tick mark. Ignored if tick marks are
59      * disabled.
60      */

61     protected Color JavaDoc tickLabelColor = null;
62     
63     /**
64      * The font to use when writing the label of each tick mark. Ignored if tick marks
65      * are disabled.
66      */

67     protected JRFont tickLabelFont = null;
68
69     /**
70      * The mask to use for formatting the label of each tick mark. Ignored if tick marks
71      * are disabled, or if the axis being formatted is not either numeric or a date axis.
72      */

73     protected String JavaDoc tickLabelMask = null;
74
75     /**
76      * The color to use when drawing the axis line and tick marks, if enabled.
77      */

78     protected Color JavaDoc lineColor = null;
79     
80     /**
81      * Constructor.
82      *
83      */

84     public JRAxisFormat() {}
85     
86     /**
87      * Returns the color used when writing the label of the axis.
88      *
89      * @return the color used when writing the label of the axis
90      */

91     public Color JavaDoc getLabelColor()
92     {
93         return labelColor;
94     }
95     
96     /**
97      * Sets the color used when writing the label of the axis.
98      *
99      * @param labelColor the color to use when writing the label of the axis
100      */

101     public void setLabelColor(Color JavaDoc labelColor)
102     {
103         this.labelColor = labelColor;
104     }
105     
106     /**
107      * Returns the font used when writing the label of the axis.
108      *
109      * @return the font used when writing the label of the axis
110      */

111     public JRFont getLabelFont()
112     {
113         return labelFont;
114     }
115     
116     /**
117      * Sets the font used when writing the label of the axis.
118      *
119      * @param labelFont the font to use when writing the label of the axis
120      */

121     public void setLabelFont(JRFont labelFont)
122     {
123         this.labelFont = labelFont;
124     }
125
126     /**
127      * Returns the color used when drawing the axis. This color is used for both
128      * the axis line itself and any tick marks present on the axis.
129      *
130      * @return the color used when drawing the axis.
131      */

132     public Color JavaDoc getLineColor() {
133         return lineColor;
134     }
135
136     /**
137      * Sets the color used when drawing the axis. This color is used for both
138      * the axis line itself and any tick marks present on the axis.
139      *
140      * @param lineColor the color to use when drawing the axis.
141      */

142     public void setLineColor(Color JavaDoc lineColor) {
143         this.lineColor = lineColor;
144     }
145
146     /**
147      * Returns the color used when writing the label of each tick mark.
148      *
149      * @return the color used when writing the label of each tick mark
150      */

151     public Color JavaDoc getTickLabelColor() {
152         return tickLabelColor;
153     }
154
155     /**
156      * Sets the color to use when writing the label of each tick mark.
157      *
158      * @param tickLabelColor the color to use when writing the label of each tick mark
159      */

160     public void setTickLabelColor(Color JavaDoc tickLabelColor) {
161         this.tickLabelColor = tickLabelColor;
162     }
163
164     /**
165      * Returns the font used when writing the label of each tick mark.
166      *
167      * @return the font used when writing the label of each tick mark
168      */

169     public JRFont getTickLabelFont() {
170         return tickLabelFont;
171     }
172
173     /**
174      * Sets the font to use when writing the label of each tick mark.
175      *
176      * @param tickLabelFont the font to use when writing the label of each tick mark
177      */

178     public void setTickLabelFont(JRFont tickLabelFont) {
179         this.tickLabelFont = tickLabelFont;
180     }
181
182     /**
183      * Returns the formatting mask used when writing the label of each tick mark.
184      *
185      * @return the formatting mask used when writing the label of each tick mark
186      */

187     public String JavaDoc getTickLabelMask() {
188         return tickLabelMask;
189     }
190
191     /**
192      * Sets the formatting mask to user when writing the label of each tick mark.
193      *
194      * @param mask the formatting mask to use when writing the label of each tick mark
195      */

196     public void setTickLabelMask(String JavaDoc mask) {
197         this.tickLabelMask = mask;
198     }
199 }
200
Popular Tags