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: BloofEvent.java,v $
19 Created on $Date: 2003/09/06 08:35:09 $
20 */
21 package net.sf.bloof.events;
22
23 import java.util.HashMap;
24
25 /***
26 *
27 * @author Lukasz Pekacki <pekacki@users.sourceforge.net>
28 * @version $Id: BloofEvent.java,v 1.3 2003/09/06 08:35:09 pekacki Exp $
29 */
30 public class BloofEvent {
31
32 private BloofEvent(int aType) {
33 mType = aType;
34 }
35
36 /***
37 * Default constructor for a Browser Event
38 * @param aBrowserEventType Type of the Event
39 * @param aParams Parameters for the Event<br> These parameters can be accessed via the PARAM_-Fields
40 */
41 public BloofEvent(BloofEvent aBrowserEventType, HashMap aParams) {
42 mType = aBrowserEventType.getEventType();
43 mParams = aParams;
44 }
45
46 /***
47 * Shortcut constructor for a Browser Event that only has a singe Object as parameter
48 * @param aBrowserEventType Type of the Event
49 * @param aKey PARAM_-Type of the parameter
50 * @param aValue Value of the parameter
51 */
52 public BloofEvent(BloofEvent aBrowserEventType, Object aKey, Object aValue) {
53 mType = aBrowserEventType.getEventType();
54 mParams = new HashMap();
55 mParams.put(aKey, aValue);
56 }
57
58 private int mType;
59 private HashMap mParams;
60 /****/
61 public static final int TYPE_PROJECT_IMPORTED = 0,
62 TYPE_PROJECT_CLOSED = 1,
63 TYPE_PROJECT_OPENED = 2,
64 TYPE_METRIC_RUN_FINISHED = 3,
65 TYPE_UPDATE_FINISHED = 4,
66 TYPE_EXPORT_FINISHED = 5;
67
68 /****/
69 public final static BloofEvent IMPORTED = new BloofEvent(TYPE_PROJECT_IMPORTED),
70 OPENED = new BloofEvent(TYPE_PROJECT_OPENED),
71 CLOSED = new BloofEvent(TYPE_PROJECT_CLOSED),
72 METRIC_RUN_FINISHED = new BloofEvent(TYPE_METRIC_RUN_FINISHED),
73 EXPORT_FINISHED = new BloofEvent(TYPE_EXPORT_FINISHED),
74 UPDATE_FINISHED = new BloofEvent(TYPE_UPDATE_FINISHED);
75
76 /****/
77 public final static String PARAM_OBJECT = "Object";
78
79 /***
80 * Returns the type of the Event
81 * @return type of the Event
82 */
83 public int getEventType() {
84 return mType;
85 }
86
87 /***
88 * Returns the parameters of this Event
89 * @return parameters of this Event
90 */
91 public HashMap getParams() {
92 return mParams;
93 }
94
95 /***
96 * @see java.lang.Object#toString()
97 */
98 public String toString() {
99 return "BloofEvent Type Nr.:" + mType;
100 }
101
102 }
This page was automatically generated by Maven