01: /*
02: * This is free software, licensed under the Gnu Public License (GPL)
03: * get a copy from <http://www.gnu.org/licenses/gpl.html>
04: * $Id: TerminalOutputDevice.java,v 1.2 2005/03/24 13:57:46 hzeller Exp $
05: * author: Henner Zeller <H.Zeller@acm.org>
06: */
07: package henplus;
08:
09: import java.io.PrintStream;
10:
11: /**
12: * The OutputDevice to write to.
13: */
14: public class TerminalOutputDevice extends PrintStreamOutputDevice {
15: private static final String BOLD = "\033[1m";
16: private static final String NORMAL = "\033[m";
17: private static final String GREY = "\033[1;30m";
18:
19: public TerminalOutputDevice(PrintStream out) {
20: super (out);
21: }
22:
23: public void attributeBold() {
24: print(BOLD);
25: }
26:
27: public void attributeGrey() {
28: print(GREY);
29: }
30:
31: public void attributeReset() {
32: print(NORMAL);
33: }
34:
35: public boolean isTerminal() {
36: return true;
37: }
38: }
|