Package aud.util
Class Terminal
java.lang.Object
aud.util.Terminal
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]set background colorstatic final intstatic final intstatic final Stringset normal textstatic final Stringclear screen and reset cursor position to upper left cornerstatic final intstatic final String[]set foreground colorstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringhide cursorstatic final intstatic final Stringreset cursor position to upper left cornerstatic Terminalsingleton instancebooleaninvert colorsbooleanswap foreground and backgroundstatic final intstatic final Stringset bold textoutput stream, user is responsible for flushstatic final intstatic final Stringshow cursorstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbg(int color) set background colorvoidbold(boolean b) switch use of bold fontvoidcls()clear screen (cls(true))voidcls(boolean clear) clear screen (forclear=false, move only cursor)booleandumb()Is this a dumb terminal without colors?voidfg(int color) set foreground colorvoidhide cursorvoidreset()reset to black on white, normal fontvoidshow cursor
-
Field Details
-
BLACK
public static final int BLACK- See Also:
-
RED
public static final int RED- See Also:
-
GREEN
public static final int GREEN- See Also:
-
YELLOW
public static final int YELLOW- See Also:
-
BLUE
public static final int BLUE- See Also:
-
MAGENTA
public static final int MAGENTA- See Also:
-
CYAN
public static final int CYAN- See Also:
-
WHITE
public static final int WHITE- See Also:
-
HIGHLIGHT
public static final int HIGHLIGHT- See Also:
-
HI_BLACK
public static final int HI_BLACK- See Also:
-
HI_RED
public static final int HI_RED- See Also:
-
HI_GREEN
public static final int HI_GREEN- See Also:
-
HI_YELLOW
public static final int HI_YELLOW- See Also:
-
HI_BLUE
public static final int HI_BLUE- See Also:
-
HI_MAGENTA
public static final int HI_MAGENTA- See Also:
-
HI_CYAN
public static final int HI_CYAN- See Also:
-
HI_WHITE
public static final int HI_WHITE- See Also:
-
FGCOLOR
set foreground color -
BGCOLOR
set background color -
NORMAL
set bold text- See Also:
-
BOLD
set normal text- See Also:
-
CLEAR_SCREEN
clear screen and reset cursor position to upper left corner- See Also:
-
HOME
reset cursor position to upper left corner- See Also:
-
SHOW_CURSOR
show cursor- See Also:
-
HIDE_CURSOR
hide cursor- See Also:
-
invert_color
public boolean invert_colorinvert colors -
invert_foreground_background
public boolean invert_foreground_backgroundswap foreground and background -
out
output stream, user is responsible for flush -
instance
singleton instance
-
-
Constructor Details
-
Terminal
public Terminal(boolean ansi) Constructor.- Parameters:
ansi- assume terminal emulation is available
-
Terminal
public Terminal()Constructor: guess availability of terminal emulation. Simple rule: assume that Windows systems don't provide terminal emulation, all other systems do.
-
-
Method Details
-
dumb
public boolean dumb()Is this a dumb terminal without colors? -
fg
public void fg(int color) set foreground color -
bg
public void bg(int color) set background color -
cls
public void cls(boolean clear) clear screen (forclear=false, move only cursor) -
bold
public void bold(boolean b) switch use of bold font -
cls
public void cls()clear screen (cls(true)) -
reset
public void reset()reset to black on white, normal font -
showCursor
public void showCursor()show cursor -
hideCursor
public void hideCursor()hide cursor
-