01: /*
02: ** Houston - Status and Logging Toolkit
03: ** Copyright (c) 2001, 2002, 2003 by Gerald Bauer
04: **
05: ** This program is free software.
06: **
07: ** You may redistribute it and/or modify it under the terms of the GNU
08: ** Lesser General Public License as published by the Free Software Foundation.
09: ** Version 2.1 of the license should be included with this distribution in
10: ** the file LICENSE, as well as License.html. If the license is not
11: ** included with this distribution, you may find a copy at the FSF web
12: ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
13: ** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
14: **
15: ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
16: ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
17: ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
18: ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
19: ** REDISTRIBUTION OF THIS SOFTWARE.
20: **
21: */
22:
23: package houston;
24:
25: import javax.swing.event.*;
26:
27: public class Status {
28: private static EventListenerList _listener = new EventListenerList();
29:
30: public static int getNumOfErrors() {
31: return 0;
32: }
33:
34: public static void addListener(StatusListener l) {
35: _listener.add(StatusListener.class, l);
36: }
37:
38: public static void beginTracking() {
39: }
40:
41: public static void error(String msg) {
42: StatusListener l[] = (StatusListener[]) _listener
43: .getListeners(StatusListener.class);
44: for (int i = 0; i < l.length; i++)
45: l[i].error(msg);
46: }
47:
48: public static void fatal(String msg) {
49: StatusListener l[] = (StatusListener[]) _listener
50: .getListeners(StatusListener.class);
51: for (int i = 0; i < l.length; i++)
52: l[i].fatal(msg);
53: }
54:
55: public static void hint(String msg) {
56: StatusListener l[] = (StatusListener[]) _listener
57: .getListeners(StatusListener.class);
58: for (int i = 0; i < l.length; i++)
59: l[i].hint(msg);
60: }
61:
62: public static void info(int level, String msg) {
63: StatusListener l[] = (StatusListener[]) _listener
64: .getListeners(StatusListener.class);
65: for (int i = 0; i < l.length; i++)
66: l[i].info(level, msg);
67: }
68:
69: public static void info(String msg) {
70: StatusListener l[] = (StatusListener[]) _listener
71: .getListeners(StatusListener.class);
72: for (int i = 0; i < l.length; i++)
73: l[i].info(msg);
74: }
75:
76: public static void removeListener(StatusListener l) {
77: _listener.remove(StatusListener.class, l);
78: }
79:
80: public static void warning(String msg) {
81: StatusListener l[] = (StatusListener[]) _listener
82: .getListeners(StatusListener.class);
83: for (int i = 0; i < l.length; i++)
84: l[i].warning(msg);
85: }
86: }
|