01: package org.acm.seguin.pmd.swingui.event;
02:
03: import java.io.File;
04: import java.util.EventObject;
05: import java.util.Iterator;
06: import java.util.List;
07:
08: /**
09: *
10: * @author Donald A. Leckie
11: * @since December 13, 2002
12: * @version $Revision: 1.1 $, $Date: 2003/07/29 20:51:59 $
13: */
14: public class AnalyzeFileEvent extends EventObject {
15: private File m_file;
16:
17: /**
18: *****************************************************************************
19: *
20: */
21: private AnalyzeFileEvent(Object source) {
22: super (source);
23: }
24:
25: /**
26: *****************************************************************************
27: *
28: */
29: private AnalyzeFileEvent(Object source, File file) {
30: super (source);
31:
32: m_file = file;
33: }
34:
35: /**
36: *****************************************************************************
37: *
38: * @return
39: */
40: public File getFile() {
41: return m_file;
42: }
43:
44: /**
45: *****************************************************************************
46: *
47: * @param source
48: * @param file
49: */
50: public static final void notifyStartAnalysis(Object source,
51: File file) {
52: AnalyzeFileEvent event = new AnalyzeFileEvent(source, file);
53: List listenerList = ListenerList
54: .getListeners(AnalyzeFileEventListener.class);
55: Iterator listeners = listenerList.iterator();
56:
57: while (listeners.hasNext()) {
58: AnalyzeFileEventListener listener;
59:
60: listener = (AnalyzeFileEventListener) listeners.next();
61: listener.startAnalysis(event);
62: }
63: }
64:
65: /**
66: *****************************************************************************
67: *
68: * @param source
69: * @param file
70: */
71: public static final void notifyStopAnalysis(Object source, File file) {
72: AnalyzeFileEvent event = new AnalyzeFileEvent(source, file);
73: List listenerList = ListenerList
74: .getListeners(AnalyzeFileEventListener.class);
75: Iterator listeners = listenerList.iterator();
76:
77: while (listeners.hasNext()) {
78: AnalyzeFileEventListener listener;
79:
80: listener = (AnalyzeFileEventListener) listeners.next();
81: listener.stopAnalysis(event);
82: }
83: }
84: }
|