KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > chart > event > ChartProgressEvent


1 /* ===========================================================
2  * JFreeChart : a free chart library for the Java(tm) platform
3  * ===========================================================
4  *
5  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
6  *
7  * Project Info: http://www.jfree.org/jfreechart/index.html
8  *
9  * This library is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this library; if not, write to the Free Software Foundation,
21  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
24  * in the United States and other countries.]
25  *
26  * -----------------------
27  * ChartProgressEvent.java
28  * -----------------------
29  * (C) Copyright 2003, 2004, by Object Refinery Limited.
30  *
31  * Original Author: David Gilbert (for Object Refinery Limited);
32  * Contributor(s): -;
33  *
34  * $Id: ChartProgressEvent.java,v 1.3 2005/03/28 19:39:00 mungady Exp $
35  *
36  * Changes
37  * -------
38  * 14-Jan-2003 : Version 1 (DG);
39  *
40  */

41
42 package org.jfree.chart.event;
43
44 import org.jfree.chart.JFreeChart;
45
46 /**
47  * An event that contains information about the drawing progress of a chart.
48  *
49  */

50 public class ChartProgressEvent extends java.util.EventObject JavaDoc {
51
52     /** Indicates drawing has started. */
53     public static final int DRAWING_STARTED = 1;
54
55     /** Indicates drawing has finished. */
56     public static final int DRAWING_FINISHED = 2;
57
58     /** The type of event. */
59     private int type;
60
61     /** The percentage of completion. */
62     private int percent;
63
64     /** The chart that generated the event. */
65     private JFreeChart chart;
66
67     /**
68      * Creates a new chart change event.
69      *
70      * @param source the source of the event (could be the chart, a title, an
71      * axis etc.)
72      * @param chart the chart that generated the event.
73      * @param type the type of event.
74      * @param percent the percentage of completion.
75      */

76     public ChartProgressEvent(Object JavaDoc source, JFreeChart chart, int type,
77                               int percent) {
78         super(source);
79         this.chart = chart;
80         this.type = type;
81     }
82
83     /**
84      * Returns the chart that generated the change event.
85      *
86      * @return The chart that generated the change event.
87      */

88     public JFreeChart getChart() {
89         return this.chart;
90     }
91
92     /**
93      * Sets the chart that generated the change event.
94      *
95      * @param chart the chart that generated the event.
96      */

97     public void setChart(JFreeChart chart) {
98         this.chart = chart;
99     }
100
101     /**
102      * Returns the event type.
103      *
104      * @return The event type.
105      */

106     public int getType() {
107         return this.type;
108     }
109
110     /**
111      * Sets the event type.
112      *
113      * @param type the event type.
114      */

115     public void setType(int type) {
116         this.type = type;
117     }
118
119     /**
120      * Returns the percentage complete.
121      *
122      * @return The percentage complete.
123      */

124     public int getPercent() {
125         return this.percent;
126     }
127
128     /**
129      * Sets the percentage complete.
130      *
131      * @param percent the percentage.
132      */

133     public void setPercent(int percent) {
134         this.percent = percent;
135     }
136
137 }
138
Popular Tags