1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.caleigo.core.event;
20
21 import org.caleigo.core.*;
22
23 /*** Event for relaying changes of the structure or value content in Qualifier
24 * objects. This is equal to changes in what entities that the qualifier
25 * addresses.
26 *
27 * @author Dennis Zikovic
28 * @version 1.00
29 *
30 *//*
31 *
32 * WHEN WHO WHY & WHAT
33 * -----------------------------------------------------------------------------
34 * 2001-10-23 Dennis Zikovic Creation
35 */
36 public class QualifierEvent extends java.util.EventObject
37 {
38
39 public static final int STRUCTURE_CHANGED = 1;
40 public static final int CONTENT_CHANGED = 2;
41
42
43 private int mEventType;
44
45
46
47 /*** Creates new EntityCollectionEvent
48 */
49 public QualifierEvent(Qualifier sourceQualifier, int eventType)
50 {
51 super(sourceQualifier);
52 mEventType = eventType;
53 }
54
55
56 public String toString()
57 {
58 String params = null;
59 switch(mEventType)
60 {
61 case STRUCTURE_CHANGED:
62 params = "STRUCTURE_CHANGED";
63 break;
64 case CONTENT_CHANGED:
65 params = "CONTENT_CHANGED";
66 break;
67 default:
68 params = "UNKNOWN_TYPE";
69 break;
70 }
71 return getClass().getName()+"["+params+"] on Qualifier("+source.toString()+")";
72 }
73
74
75 public Qualifier getSourceQualifier()
76 {
77 return (Qualifier)this.getSource();
78 }
79
80 public int getEventType()
81 {
82 return mEventType;
83 }
84 }