KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > chart > Chart


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * Chart.java
28  *
29  * Created on 8 luglio 2005, 18.00
30  *
31  */

32
33 package it.businesslogic.ireport.chart;
34 import it.businesslogic.ireport.HyperLinkableReportElement;
35 /**
36  *
37  * @author Administrator
38  */

39 public class Chart implements HyperLinkableReportElement {
40     
41     private ChartTitle title = null;
42     private ChartTitle subTitle = null;
43     private ChartLegend legend = null;
44     private boolean showLegend = true;
45     protected Plot plot = null;
46     private Dataset dataset = null;
47     
48     private String JavaDoc name = "Generic chart";
49     
50     private String JavaDoc customizerClass = "";
51     
52     private java.awt.Image JavaDoc chartImage = null;
53     
54     private String JavaDoc anchorNameExpression = "";
55     
56     private String JavaDoc hyperlinkAnchorExpression = "";
57     
58     private String JavaDoc hyperlinkPageExpression = "";
59     
60     private String JavaDoc hyperlinkReferenceExpression = "";
61     
62     private String JavaDoc hyperlinkType = "None";
63     
64     private String JavaDoc hyperlinkTarget = "Self";
65     
66     private int bookmarkLevel = 0;
67     
68     private java.util.List JavaDoc linkParameters = new java.util.ArrayList JavaDoc();
69     
70     /** Creates a new instance of Chart */
71     public Chart() {
72         
73         setTitle(new ChartTitle(""));
74         setSubTitle(new ChartTitle(""));
75         setLegend(new ChartLegend());
76         plot = new Plot(); // This line shold be overridden in the derived classes..
77
dataset = new Dataset();
78           
79     }
80     
81     public ChartTitle getTitle() {
82         return title;
83     }
84
85     public void setTitle(ChartTitle title) {
86         this.title = title;
87     }
88
89     public ChartTitle getSubTitle() {
90         return subTitle;
91     }
92
93     public void setSubTitle(ChartTitle subTitle) {
94         this.subTitle = subTitle;
95     }
96
97     public boolean isShowLegend() {
98         return showLegend;
99     }
100
101     public void setShowLegend(boolean showLegend) {
102         this.showLegend = showLegend;
103     }
104
105     public java.awt.Image JavaDoc getChartImage() {
106         return chartImage;
107     }
108
109     public void setChartImage(java.awt.Image JavaDoc chartImage) {
110         this.chartImage = chartImage;
111     }
112
113     public Plot getPlot() {
114         return plot;
115     }
116
117     public void setPlot(Plot plot) {
118         this.plot = plot;
119     }
120
121     public Dataset getDataset() {
122         return dataset;
123     }
124
125     public void setDataset(Dataset dataset) {
126         this.dataset = dataset;
127     }
128     
129     public Chart cloneMe()
130     {
131         Chart chart = cloneBaseChart();
132         chart.setTitle( getTitle().cloneMe() );
133         chart.setSubTitle( getSubTitle().cloneMe() );
134         chart.setLegend( getLegend().cloneMe());
135         chart.setPlot( getPlot().cloneMe() );
136         chart.setDataset( getDataset().cloneMe() );
137         chart.setShowLegend( isShowLegend() );
138         chart.setAnchorNameExpression( getAnchorNameExpression() );
139         chart.setHyperlinkAnchorExpression( getHyperlinkAnchorExpression() );
140         chart.setHyperlinkPageExpression( getHyperlinkPageExpression() );
141         chart.setHyperlinkReferenceExpression( getHyperlinkReferenceExpression() );
142         chart.setHyperlinkType( getHyperlinkType() );
143         chart.setHyperlinkTarget( getHyperlinkTarget() );
144         chart.setCustomizerClass( getCustomizerClass() );
145         
146         return chart;
147     }
148     
149     public Chart cloneBaseChart()
150     {
151         return new Chart();
152     }
153
154     public String JavaDoc getAnchorNameExpression() {
155         return anchorNameExpression;
156     }
157
158     public void setAnchorNameExpression(String JavaDoc anchorNameExpression) {
159         this.anchorNameExpression = anchorNameExpression;
160     }
161
162     public String JavaDoc getHyperlinkAnchorExpression() {
163         return hyperlinkAnchorExpression;
164     }
165
166     public void setHyperlinkAnchorExpression(String JavaDoc hyperlinkAnchorExpression) {
167         this.hyperlinkAnchorExpression = hyperlinkAnchorExpression;
168     }
169
170     public String JavaDoc getHyperlinkPageExpression() {
171         return hyperlinkPageExpression;
172     }
173
174     public void setHyperlinkPageExpression(String JavaDoc hyperlinkPageExpression) {
175         this.hyperlinkPageExpression = hyperlinkPageExpression;
176     }
177
178     public String JavaDoc getHyperlinkReferenceExpression() {
179         return hyperlinkReferenceExpression;
180     }
181
182     public void setHyperlinkReferenceExpression(String JavaDoc hyperlinkReferenceExpression) {
183         this.hyperlinkReferenceExpression = hyperlinkReferenceExpression;
184     }
185
186     public String JavaDoc getHyperlinkType() {
187         return hyperlinkType;
188     }
189
190     public void setHyperlinkType(String JavaDoc hyperlinkType) {
191         this.hyperlinkType = hyperlinkType;
192     }
193
194     public String JavaDoc getHyperlinkTarget() {
195         return hyperlinkTarget;
196     }
197
198     public void setHyperlinkTarget(String JavaDoc hyperlinkTarget) {
199         this.hyperlinkTarget = hyperlinkTarget;
200     }
201
202     public int getBookmarkLevel() {
203         return bookmarkLevel;
204     }
205
206     public void setBookmarkLevel(int bookmarkLevel) {
207         this.bookmarkLevel = bookmarkLevel;
208     }
209
210     public String JavaDoc getCustomizerClass() {
211         return customizerClass;
212     }
213
214     public void setCustomizerClass(String JavaDoc customizerClass) {
215         this.customizerClass = customizerClass;
216     }
217
218     public java.util.List JavaDoc getLinkParameters() {
219         return linkParameters;
220     }
221
222     public void setLinkParameters(java.util.List JavaDoc linkParameters) {
223         this.linkParameters = linkParameters;
224     }
225
226     public ChartLegend getLegend() {
227         return legend;
228     }
229
230     public void setLegend(ChartLegend legend) {
231         this.legend = legend;
232     }
233
234     public String JavaDoc getName() {
235         return name;
236     }
237
238     public void setName(String JavaDoc name) {
239         this.name = name;
240     }
241     
242 }
243
Popular Tags