2
* JasperReports - Free Java Reporting Library.
3
* Copyright (C) 2001 - 2009 Jaspersoft Corporation. All rights reserved.
4
* http://www.jaspersoft.com
6
* Unless you have purchased a commercial license agreement from Jaspersoft,
7
* the following license terms apply:
9
* This program is part of JasperReports.
11
* JasperReports is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
16
* JasperReports is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser General Public License
22
* along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
24
package net.sf.jasperreports.charts.fill;
26
import net.sf.jasperreports.charts.JRCategorySeries;
27
import net.sf.jasperreports.engine.JRException;
28
import net.sf.jasperreports.engine.JRExpression;
29
import net.sf.jasperreports.engine.JRHyperlink;
30
import net.sf.jasperreports.engine.JRHyperlinkHelper;
31
import net.sf.jasperreports.engine.JRPrintHyperlink;
32
import net.sf.jasperreports.engine.JRRuntimeException;
33
import net.sf.jasperreports.engine.fill.JRCalculator;
34
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
35
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
36
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
40
* @author Teodor Danciu (teodord@users.sourceforge.net)
41
* @version $Id: JRFillCategorySeries.java 3876 2010-07-14 14:18:47Z shertage $
43
public class JRFillCategorySeries implements JRCategorySeries
49
protected JRCategorySeries parent = null;
51
private Comparable series = null;
52
private Comparable category = null;
53
private Number value = null;
54
private String label = null;
55
private JRPrintHyperlink itemHyperlink;
61
public JRFillCategorySeries(
62
JRCategorySeries categorySeries,
63
JRFillObjectFactory factory
66
factory.put(categorySeries, this);
68
parent = categorySeries;
75
public JRExpression getSeriesExpression()
77
return parent.getSeriesExpression();
83
public JRExpression getCategoryExpression()
85
return parent.getCategoryExpression();
91
public JRExpression getValueExpression()
93
return parent.getValueExpression();
99
public JRExpression getLabelExpression()
101
return parent.getLabelExpression();
108
public Comparable getSeries()
116
public Comparable getCategory()
124
public Number getValue()
132
public String getLabel()
137
public JRPrintHyperlink getPrintItemHyperlink()
139
return itemHyperlink;
146
public void evaluate(JRCalculator calculator) throws JRExpressionEvalException
148
series = (Comparable)calculator.evaluate(getSeriesExpression());
149
category = (Comparable)calculator.evaluate(getCategoryExpression());
150
value = (Number)calculator.evaluate(getValueExpression());
151
label = (String)calculator.evaluate(getLabelExpression());
153
if (hasItemHyperlinks())
155
evaluateItemHyperlink(calculator);
160
public void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException
164
itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), calculator, JRExpression.EVALUATION_DEFAULT);
166
catch (JRExpressionEvalException e)
170
catch (JRException e)
172
throw new JRRuntimeException(e);
177
public boolean hasItemHyperlinks()
179
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
183
public JRHyperlink getItemHyperlink()
185
return parent.getItemHyperlink();
191
public Object clone()
193
throw new UnsupportedOperationException();