-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDataChangeMixin.java
More file actions
40 lines (33 loc) · 956 Bytes
/
DataChangeMixin.java
File metadata and controls
40 lines (33 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
Written 1999 by Douglas Greiman.
This software may be used and distributed according to the terms
of the GNU Public License, incorporated herein by reference.
*/
package duggelz.jape;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
public class DataChangeMixin
{
// Instance data
private Vector listeners = new Vector(1);
// Instance methods
public synchronized void addDataChangeListener(DataChangeListener l) {
if (l == null) {
return;
}
this.listeners.addElement(l);
}
public synchronized void removeDataChangeListener(DataChangeListener l) {
if (l == null) {
return;
}
this.listeners.removeElement(l);
}
public void fireDataChangeEvent(DataChangeEvent event) {
int size = this.listeners.size();
for( int idx = 0; idx < size; ++idx ) {
((DataChangeListener) this.listeners.elementAt(idx)).dataChanged(event);
}
}
}