001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * Chart.java
028: *
029: * Created on 8 luglio 2005, 18.00
030: *
031: */
032:
033: package it.businesslogic.ireport.chart;
034:
035: import it.businesslogic.ireport.HyperLinkableReportElement;
036:
037: /**
038: *
039: * @author Administrator
040: */
041: public class Chart implements HyperLinkableReportElement {
042:
043: private ChartTitle title = null;
044: private ChartTitle subTitle = null;
045: private ChartLegend legend = null;
046: private boolean showLegend = true;
047: protected Plot plot = null;
048: private Dataset dataset = null;
049:
050: private String name = "Generic chart";
051:
052: private String customizerClass = "";
053:
054: private java.awt.Image chartImage = null;
055:
056: private String anchorNameExpression = "";
057:
058: private String hyperlinkAnchorExpression = "";
059:
060: private String hyperlinkPageExpression = "";
061:
062: private String hyperlinkReferenceExpression = "";
063:
064: private String hyperlinkType = "None";
065:
066: private String hyperlinkTarget = "Self";
067:
068: private int bookmarkLevel = 0;
069:
070: private String tooltipExpression = "";
071:
072: private java.util.List linkParameters = new java.util.ArrayList();
073:
074: /** Creates a new instance of Chart */
075: public Chart() {
076:
077: setTitle(new ChartTitle(""));
078: setSubTitle(new ChartTitle(""));
079: setLegend(new ChartLegend());
080: plot = new Plot(); // This line shold be overridden in the derived classes..
081: dataset = new Dataset();
082:
083: }
084:
085: public ChartTitle getTitle() {
086: return title;
087: }
088:
089: public void setTitle(ChartTitle title) {
090: this .title = title;
091: }
092:
093: public ChartTitle getSubTitle() {
094: return subTitle;
095: }
096:
097: public void setSubTitle(ChartTitle subTitle) {
098: this .subTitle = subTitle;
099: }
100:
101: public boolean isShowLegend() {
102: return showLegend;
103: }
104:
105: public void setShowLegend(boolean showLegend) {
106: this .showLegend = showLegend;
107: }
108:
109: public java.awt.Image getChartImage() {
110: return chartImage;
111: }
112:
113: public void setChartImage(java.awt.Image chartImage) {
114: this .chartImage = chartImage;
115: }
116:
117: public Plot getPlot() {
118: return plot;
119: }
120:
121: public void setPlot(Plot plot) {
122: this .plot = plot;
123: }
124:
125: public Dataset getDataset() {
126: return dataset;
127: }
128:
129: public void setDataset(Dataset dataset) {
130: this .dataset = dataset;
131: }
132:
133: public Chart cloneMe() {
134: Chart chart = cloneBaseChart();
135: chart.setTitle(getTitle().cloneMe());
136: chart.setSubTitle(getSubTitle().cloneMe());
137: chart.setLegend(getLegend().cloneMe());
138: chart.setPlot(getPlot().cloneMe());
139: chart.setDataset(getDataset().cloneMe());
140: chart.setShowLegend(isShowLegend());
141: chart.setAnchorNameExpression(getAnchorNameExpression());
142: chart
143: .setHyperlinkAnchorExpression(getHyperlinkAnchorExpression());
144: chart.setHyperlinkPageExpression(getHyperlinkPageExpression());
145: chart
146: .setHyperlinkReferenceExpression(getHyperlinkReferenceExpression());
147: chart.setHyperlinkType(getHyperlinkType());
148: chart.setHyperlinkTarget(getHyperlinkTarget());
149: chart.setCustomizerClass(getCustomizerClass());
150:
151: return chart;
152: }
153:
154: public Chart cloneBaseChart() {
155: return new Chart();
156: }
157:
158: public String getAnchorNameExpression() {
159: return anchorNameExpression;
160: }
161:
162: public void setAnchorNameExpression(String anchorNameExpression) {
163: this .anchorNameExpression = anchorNameExpression;
164: }
165:
166: public String getHyperlinkAnchorExpression() {
167: return hyperlinkAnchorExpression;
168: }
169:
170: public void setHyperlinkAnchorExpression(
171: String hyperlinkAnchorExpression) {
172: this .hyperlinkAnchorExpression = hyperlinkAnchorExpression;
173: }
174:
175: public String getHyperlinkPageExpression() {
176: return hyperlinkPageExpression;
177: }
178:
179: public void setHyperlinkPageExpression(
180: String hyperlinkPageExpression) {
181: this .hyperlinkPageExpression = hyperlinkPageExpression;
182: }
183:
184: public String getHyperlinkReferenceExpression() {
185: return hyperlinkReferenceExpression;
186: }
187:
188: public void setHyperlinkReferenceExpression(
189: String hyperlinkReferenceExpression) {
190: this .hyperlinkReferenceExpression = hyperlinkReferenceExpression;
191: }
192:
193: public String getHyperlinkType() {
194: return hyperlinkType;
195: }
196:
197: public void setHyperlinkType(String hyperlinkType) {
198: this .hyperlinkType = hyperlinkType;
199: }
200:
201: public String getHyperlinkTarget() {
202: return hyperlinkTarget;
203: }
204:
205: public void setHyperlinkTarget(String hyperlinkTarget) {
206: this .hyperlinkTarget = hyperlinkTarget;
207: }
208:
209: public int getBookmarkLevel() {
210: return bookmarkLevel;
211: }
212:
213: public void setBookmarkLevel(int bookmarkLevel) {
214: this .bookmarkLevel = bookmarkLevel;
215: }
216:
217: public String getCustomizerClass() {
218: return customizerClass;
219: }
220:
221: public void setCustomizerClass(String customizerClass) {
222: this .customizerClass = customizerClass;
223: }
224:
225: public java.util.List getLinkParameters() {
226: return linkParameters;
227: }
228:
229: public void setLinkParameters(java.util.List linkParameters) {
230: this .linkParameters = linkParameters;
231: }
232:
233: public ChartLegend getLegend() {
234: return legend;
235: }
236:
237: public void setLegend(ChartLegend legend) {
238: this .legend = legend;
239: }
240:
241: public String getName() {
242: return name;
243: }
244:
245: public void setName(String name) {
246: this .name = name;
247: }
248:
249: public String getTooltipExpression() {
250: return tooltipExpression;
251: }
252:
253: public void setTooltipExpression(String tooltipExpression) {
254: this.tooltipExpression = tooltipExpression;
255: }
256:
257: }
|