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.base;
029:
030: import java.awt.Color;
031:
032: import net.sf.jasperreports.charts.JRBubblePlot;
033: import net.sf.jasperreports.engine.JRChart;
034: import net.sf.jasperreports.engine.JRChartPlot;
035: import net.sf.jasperreports.engine.JRConstants;
036: import net.sf.jasperreports.engine.JRExpression;
037: import net.sf.jasperreports.engine.JRExpressionCollector;
038: import net.sf.jasperreports.engine.JRFont;
039: import net.sf.jasperreports.engine.base.JRBaseChartPlot;
040: import net.sf.jasperreports.engine.base.JRBaseFont;
041: import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
042: import net.sf.jasperreports.engine.util.JRStyleResolver;
043:
044: import org.jfree.chart.renderer.xy.XYBubbleRenderer;
045:
046: /**
047: * @author Flavius Sana (flavius_sana@users.sourceforge.net)
048: * @version $Id: JRBaseBubblePlot.java 1577 2007-02-09 11:25:48Z teodord $
049: */
050: public class JRBaseBubblePlot extends JRBaseChartPlot implements
051: JRBubblePlot {
052:
053: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
054:
055: protected JRExpression xAxisLabelExpression = null;
056: protected JRFont xAxisLabelFont = null;
057: protected Color xAxisLabelColor = null;
058: protected JRFont xAxisTickLabelFont = null;
059: protected Color xAxisTickLabelColor = null;
060: protected String xAxisTickLabelMask = null;
061: protected Color xAxisLineColor = null;
062:
063: protected JRExpression yAxisLabelExpression = null;
064: protected JRFont yAxisLabelFont = null;
065: protected Color yAxisLabelColor = null;
066: protected JRFont yAxisTickLabelFont = null;
067: protected Color yAxisTickLabelColor = null;
068: protected String yAxisTickLabelMask = null;
069: protected Color yAxisLineColor = null;
070:
071: protected int scaleType = XYBubbleRenderer.SCALE_ON_RANGE_AXIS;
072:
073: /**
074: *
075: */
076: public JRBaseBubblePlot(JRChartPlot bubblePlot, JRChart chart) {
077: super (bubblePlot, chart);
078: }
079:
080: /**
081: *
082: */
083: public JRBaseBubblePlot(JRBubblePlot bubblePlot,
084: JRBaseObjectFactory factory) {
085: super (bubblePlot, factory);
086:
087: scaleType = bubblePlot.getScaleType();
088:
089: xAxisLabelExpression = factory.getExpression(bubblePlot
090: .getXAxisLabelExpression());
091: xAxisLabelFont = new JRBaseFont(null, null, bubblePlot
092: .getChart(), bubblePlot.getXAxisLabelFont());
093: xAxisLabelColor = bubblePlot.getOwnXAxisLabelColor();
094: xAxisTickLabelFont = new JRBaseFont(null, null, bubblePlot
095: .getChart(), bubblePlot.getXAxisTickLabelFont());
096: xAxisTickLabelColor = bubblePlot.getOwnXAxisTickLabelColor();
097: xAxisTickLabelMask = bubblePlot.getXAxisTickLabelMask();
098: xAxisLineColor = bubblePlot.getXAxisLineColor();
099:
100: yAxisLabelExpression = factory.getExpression(bubblePlot
101: .getYAxisLabelExpression());
102: yAxisLabelFont = new JRBaseFont(null, null, bubblePlot
103: .getChart(), bubblePlot.getYAxisLabelFont());
104: yAxisLabelColor = bubblePlot.getOwnYAxisLabelColor();
105: yAxisTickLabelFont = new JRBaseFont(null, null, bubblePlot
106: .getChart(), bubblePlot.getYAxisTickLabelFont());
107: yAxisTickLabelColor = bubblePlot.getOwnYAxisTickLabelColor();
108: yAxisTickLabelMask = bubblePlot.getYAxisTickLabelMask();
109: yAxisLineColor = bubblePlot.getYAxisLineColor();
110: }
111:
112: /**
113: *
114: */
115: public JRExpression getXAxisLabelExpression() {
116: return xAxisLabelExpression;
117: }
118:
119: /**
120: *
121: */
122: public JRFont getXAxisLabelFont() {
123: return xAxisLabelFont;
124: }
125:
126: /**
127: *
128: */
129: public Color getXAxisLabelColor() {
130: return JRStyleResolver.getXAxisLabelColor(this , this );
131: }
132:
133: /**
134: *
135: */
136: public Color getOwnXAxisLabelColor() {
137: return xAxisLabelColor;
138: }
139:
140: /**
141: *
142: */
143: public JRFont getXAxisTickLabelFont() {
144: return xAxisTickLabelFont;
145: }
146:
147: /**
148: *
149: */
150: public Color getXAxisTickLabelColor() {
151: return JRStyleResolver.getXAxisTickLabelColor(this , this );
152: }
153:
154: /**
155: *
156: */
157: public Color getOwnXAxisTickLabelColor() {
158: return xAxisTickLabelColor;
159: }
160:
161: /**
162: *
163: */
164: public String getXAxisTickLabelMask() {
165: return xAxisTickLabelMask;
166: }
167:
168: /**
169: *
170: */
171: public Color getXAxisLineColor() {
172: return JRStyleResolver.getXAxisLineColor(this , this );
173: }
174:
175: /**
176: *
177: */
178: public Color getOwnXAxisLineColor() {
179: return xAxisLineColor;
180: }
181:
182: /**
183: *
184: */
185: public JRExpression getYAxisLabelExpression() {
186: return yAxisLabelExpression;
187: }
188:
189: /**
190: *
191: */
192: public JRFont getYAxisLabelFont() {
193: return yAxisLabelFont;
194: }
195:
196: /**
197: *
198: */
199: public Color getYAxisLabelColor() {
200: return JRStyleResolver.getYAxisLabelColor(this , this );
201: }
202:
203: /**
204: *
205: */
206: public Color getOwnYAxisLabelColor() {
207: return yAxisLabelColor;
208: }
209:
210: /**
211: *
212: */
213: public JRFont getYAxisTickLabelFont() {
214: return yAxisTickLabelFont;
215: }
216:
217: /**
218: *
219: */
220: public Color getYAxisTickLabelColor() {
221: return JRStyleResolver.getYAxisTickLabelColor(this , this );
222: }
223:
224: /**
225: *
226: */
227: public Color getOwnYAxisTickLabelColor() {
228: return yAxisTickLabelColor;
229: }
230:
231: /**
232: *
233: */
234: public String getYAxisTickLabelMask() {
235: return yAxisTickLabelMask;
236: }
237:
238: /**
239: *
240: */
241: public Color getYAxisLineColor() {
242: return JRStyleResolver.getYAxisLineColor(this , this );
243: }
244:
245: /**
246: *
247: */
248: public Color getOwnYAxisLineColor() {
249: return yAxisLineColor;
250: }
251:
252: /**
253: *
254: */
255: public int getScaleType() {
256: return scaleType;
257: }
258:
259: /**
260: *
261: */
262: public void setScaleType(int scaleType) {
263: this .scaleType = scaleType;
264: }
265:
266: /**
267: *
268: */
269: public void collectExpressions(JRExpressionCollector collector) {
270: collector.collect(this);
271: }
272:
273: }
|