24 |
|
|
25 |
import java.util.Vector; |
import java.util.Vector; |
26 |
|
|
27 |
import javax.swing.event.ChangeEvent; |
import net.sf.juife.event.GenericEvent; |
28 |
import javax.swing.event.ChangeListener; |
import net.sf.juife.event.GenericListener; |
29 |
|
|
30 |
|
|
31 |
/** |
/** |
36 |
private String name = "Untitled"; |
private String name = "Untitled"; |
37 |
private String description = ""; |
private String description = ""; |
38 |
|
|
39 |
private final Vector<ChangeListener> listeners = new Vector<ChangeListener>(); |
private final Vector<GenericListener> listeners = new Vector<GenericListener>(); |
40 |
|
|
41 |
/** |
/** |
42 |
* Creates a new instance of Resource |
* Creates a new instance of Resource |
46 |
|
|
47 |
/** |
/** |
48 |
* Registers the specified listener to be notified when the resource info is changed. |
* Registers the specified listener to be notified when the resource info is changed. |
49 |
* @param l The <code>ChangeListener</code> to register. |
* @param l The <code>GenericListener</code> to register. |
50 |
*/ |
*/ |
51 |
public void |
public void |
52 |
addChangeListener(ChangeListener l) { listeners.add(l); } |
addChangeListener(GenericListener l) { listeners.add(l); } |
53 |
|
|
54 |
/** |
/** |
55 |
* Removes the specified listener. |
* Removes the specified listener. |
56 |
* @param l The <code>ChangeListener</code> to remove. |
* @param l The <code>GenericListener</code> to remove. |
57 |
*/ |
*/ |
58 |
public void |
public void |
59 |
removeChangeListener(ChangeListener l) { listeners.remove(l); } |
removeChangeListener(GenericListener l) { listeners.remove(l); } |
60 |
|
|
61 |
/** |
/** |
62 |
* Gets the name of this resource. |
* Gets the name of this resource. |
95 |
/** Notifies listeners that the recourse properties has changed. */ |
/** Notifies listeners that the recourse properties has changed. */ |
96 |
protected void |
protected void |
97 |
fireChangeEvent() { |
fireChangeEvent() { |
98 |
ChangeEvent e = new ChangeEvent(this); |
GenericEvent e = new GenericEvent(this); |
99 |
for(ChangeListener l : listeners) l.stateChanged(e); |
for(GenericListener l : listeners) l.jobDone(e); |
100 |
} |
} |
101 |
} |
} |