1 /*
2 Bloof - visualize the evolution of your software project
3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de>
4 http://bloof.sf.net/
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 $RCSfile: ProgressEvent.java,v $
19 Created on $Date: 2003/08/18 11:13:00 $
20 */
21 package net.sf.bloof.util;
22
23 /***
24 * A semantic event which indicates that a progress occured. This event is generated
25 * by a component ( such as a Metrics ) when the component-specific event occurs ( e.g. 30% of the
26 * calculation is finished ). The event is passed to every every ProgrssListener object that
27 * registered to receive such events using the component's addProgressListener method.
28 * The object that implements the ProgressListener interface gets this ProgressEvent when
29 * the event occurs.
30 *
31 * @author Lukasz Pekacki <pekacki@users.sourceforge.net>
32 * @version $Id: ProgressEvent.java,v 1.4 2003/08/18 11:13:00 pekacki Exp $
33 */
34 public class ProgressEvent {
35
36 /***
37 * Constructs an ProgressEvent with progess percentate = 0 and empty message
38 */
39 public ProgressEvent( ) {
40 this( "", 0 );
41 }
42
43 /***
44 * Constructs an ProgressEvent with progess percentate = 0
45 * @param aMessage Message of the Event
46 */
47 public ProgressEvent( String aMessage ) {
48 this( aMessage, 0 );
49 }
50
51 /***
52 * Constructs an ProgressEvent
53 * @param aMessage Message of the Event
54 * @param aPercentage Percentage of the Progress of the total Action
55 */
56 public ProgressEvent( String aMessage, int aPercentage ) {
57 mPercentage = aPercentage;
58 mMessage = aMessage;
59 }
60
61 /***
62 * Returns the message.
63 * @return String
64 */
65 public String getMessage( ) {
66 return mMessage;
67 }
68
69 /***
70 * Returns the percentage.
71 * @return int
72 */
73 public int getPercentage( ) {
74 return mPercentage;
75 }
76 private String mMessage;
77 private int mPercentage;
78
79 /***
80 * @see java.lang.Object#toString()
81 */
82 public String toString() {
83 return mMessage + "("+mPercentage+"%)";
84 }
85
86 }
This page was automatically generated by Maven