01: /*
02: * Jacareto Copyright (c) 2002-2005
03: * Applied Computer Science Research Group, Darmstadt University of
04: * Technology, Institute of Mathematics & Computer Science,
05: * Ludwigsburg University of Education, and Computer Based
06: * Learning Research Group, Aachen University. All rights reserved.
07: *
08: * Jacareto is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * Jacareto is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public
19: * License along with Jacareto; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: *
22: */
23:
24: package jacareto.comp;
25:
26: import java.util.EventObject;
27:
28: /**
29: * An event which stands for a change in the components instance.
30: *
31: * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
32: * @version 1.01
33: */
34: public class ComponentsEvent extends EventObject {
35: /** The component tree has changed. */
36: public static final int TREE_CHANGED = 0;
37:
38: /** A user defined name has been set. */
39: public static final int USER_DEFINED_NAME_SET = 1;
40:
41: /** The id. */
42: private int id;
43:
44: /** The jacareto name. */
45: private String jacaretoName;
46:
47: /** The user defined name. */
48: private String userDefinedName;
49:
50: /**
51: * Creates a new components event
52: *
53: * @param source the components instance
54: * @param id the event id
55: * @param jacaretoName DOCUMENT ME!
56: * @param userDefinedName DOCUMENT ME!
57: */
58: public ComponentsEvent(Object source, int id, String jacaretoName,
59: String userDefinedName) {
60: super (source);
61: this .id = id;
62: this .jacaretoName = jacaretoName;
63: this .userDefinedName = userDefinedName;
64: }
65:
66: /**
67: * Returns the id.
68: *
69: * @return DOCUMENT ME!
70: */
71: public int getID() {
72: return id;
73: }
74:
75: /**
76: * Returns the jacareto name of the component associated with this event, or <code>null</code>
77: * if no component is associated.
78: *
79: * @return DOCUMENT ME!
80: */
81: public String getJacaretoName() {
82: return jacaretoName;
83: }
84:
85: /**
86: * Returns the user defined name of the component associated with this event, or
87: * <code>null</code> if no component is associated.
88: *
89: * @return DOCUMENT ME!
90: */
91: public String getUserDefinedName() {
92: return userDefinedName;
93: }
94: }
|