KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > houston > StatusConsole


1 /*
2 ** Houston - Status and Logging Toolkit
3 ** Copyright (c) 2001, 2002, 2003 by Gerald Bauer
4 **
5 ** This program is free software.
6 **
7 ** You may redistribute it and/or modify it under the terms of the GNU
8 ** Lesser General Public License as published by the Free Software Foundation.
9 ** 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 java.awt.*;
26
27 public class StatusConsole implements StatusListener
28 {
29    static Logger T = Logger.getLogger( StatusConsole.class );
30
31    public void error( String JavaDoc msg )
32    {
33       Toolkit.getDefaultToolkit().beep();
34       message( msg );
35       T.error( msg );
36    }
37
38    public void fatal( String JavaDoc msg )
39    {
40       Toolkit.getDefaultToolkit().beep();
41       message( msg );
42       T.fatal( msg );
43    }
44
45    public void hint( String JavaDoc msg )
46    {
47       message( msg );
48       T.debug( msg );
49    }
50
51    public void info( String JavaDoc msg )
52    {
53       message( msg );
54       T.debug( msg );
55    }
56
57    public void info( int level, String JavaDoc msg )
58    {
59       message( level, msg );
60       T.debug( msg );
61    }
62
63    public void warning( String JavaDoc msg )
64    {
65       message( msg );
66       T.warning( msg );
67    }
68
69    private void message( int level, String JavaDoc msg )
70    {
71       System.out.println( msg );
72    }
73
74    private void message( String JavaDoc msg )
75    {
76       System.out.println( msg );
77    }
78 }
79
Popular Tags