001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.charts.util;
029:
030: import java.awt.Color;
031: import java.io.Serializable;
032:
033: import net.sf.jasperreports.engine.JRConstants;
034: import net.sf.jasperreports.engine.JRFont;
035:
036: /**
037: * Represents all the formatting options of a chart axis. The axis can be either a domain or
038: * a range axis, and any options that do not apply to the current axis are simply ignored.
039: *
040: * @author Barry Klawans (bklawans@users.sourceforge.net)
041: * @version $Id: JRAxisFormat.java 1413 2006-09-28 10:47:40Z teodord $
042: */
043: public class JRAxisFormat implements Serializable {
044:
045: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
046:
047: /**
048: * The color to use when writing the label of the axis.
049: */
050: protected Color labelColor = null;
051:
052: /**
053: * The font to use when writing the label of the axis.
054: */
055: protected JRFont labelFont = null;
056:
057: /**
058: * The color to use when writing the label of each tick mark. Ignored if tick marks are
059: * disabled.
060: */
061: protected Color tickLabelColor = null;
062:
063: /**
064: * The font to use when writing the label of each tick mark. Ignored if tick marks
065: * are disabled.
066: */
067: protected JRFont tickLabelFont = null;
068:
069: /**
070: * The mask to use for formatting the label of each tick mark. Ignored if tick marks
071: * are disabled, or if the axis being formatted is not either numeric or a date axis.
072: */
073: protected String tickLabelMask = null;
074:
075: /**
076: * The color to use when drawing the axis line and tick marks, if enabled.
077: */
078: protected Color lineColor = null;
079:
080: /**
081: * Constructor.
082: *
083: */
084: public JRAxisFormat() {
085: }
086:
087: /**
088: * Returns the color used when writing the label of the axis.
089: *
090: * @return the color used when writing the label of the axis
091: */
092: public Color getLabelColor() {
093: return labelColor;
094: }
095:
096: /**
097: * Sets the color used when writing the label of the axis.
098: *
099: * @param labelColor the color to use when writing the label of the axis
100: */
101: public void setLabelColor(Color labelColor) {
102: this .labelColor = labelColor;
103: }
104:
105: /**
106: * Returns the font used when writing the label of the axis.
107: *
108: * @return the font used when writing the label of the axis
109: */
110: public JRFont getLabelFont() {
111: return labelFont;
112: }
113:
114: /**
115: * Sets the font used when writing the label of the axis.
116: *
117: * @param labelFont the font to use when writing the label of the axis
118: */
119: public void setLabelFont(JRFont labelFont) {
120: this .labelFont = labelFont;
121: }
122:
123: /**
124: * Returns the color used when drawing the axis. This color is used for both
125: * the axis line itself and any tick marks present on the axis.
126: *
127: * @return the color used when drawing the axis.
128: */
129: public Color getLineColor() {
130: return lineColor;
131: }
132:
133: /**
134: * Sets the color used when drawing the axis. This color is used for both
135: * the axis line itself and any tick marks present on the axis.
136: *
137: * @param lineColor the color to use when drawing the axis.
138: */
139: public void setLineColor(Color lineColor) {
140: this .lineColor = lineColor;
141: }
142:
143: /**
144: * Returns the color used when writing the label of each tick mark.
145: *
146: * @return the color used when writing the label of each tick mark
147: */
148: public Color getTickLabelColor() {
149: return tickLabelColor;
150: }
151:
152: /**
153: * Sets the color to use when writing the label of each tick mark.
154: *
155: * @param tickLabelColor the color to use when writing the label of each tick mark
156: */
157: public void setTickLabelColor(Color tickLabelColor) {
158: this .tickLabelColor = tickLabelColor;
159: }
160:
161: /**
162: * Returns the font used when writing the label of each tick mark.
163: *
164: * @return the font used when writing the label of each tick mark
165: */
166: public JRFont getTickLabelFont() {
167: return tickLabelFont;
168: }
169:
170: /**
171: * Sets the font to use when writing the label of each tick mark.
172: *
173: * @param tickLabelFont the font to use when writing the label of each tick mark
174: */
175: public void setTickLabelFont(JRFont tickLabelFont) {
176: this .tickLabelFont = tickLabelFont;
177: }
178:
179: /**
180: * Returns the formatting mask used when writing the label of each tick mark.
181: *
182: * @return the formatting mask used when writing the label of each tick mark
183: */
184: public String getTickLabelMask() {
185: return tickLabelMask;
186: }
187:
188: /**
189: * Sets the formatting mask to user when writing the label of each tick mark.
190: *
191: * @param mask the formatting mask to use when writing the label of each tick mark
192: */
193: public void setTickLabelMask(String mask) {
194: this.tickLabelMask = mask;
195: }
196: }
|