Package aud.util
Class Terminal
java.lang.Object
aud.util.Terminal
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
set background colorstatic final int
static final int
static final String
set normal textstatic final String
clear screen and reset cursor position to upper left cornerstatic final int
static final String[]
set foreground colorstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String
hide cursorstatic final int
static final String
reset cursor position to upper left cornerstatic Terminal
singleton instanceboolean
invert colorsboolean
swap foreground and backgroundstatic final int
static final String
set bold textoutput stream, user is responsible for flushstatic final int
static final String
show cursorstatic final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bg
(int color) set background colorvoid
bold
(boolean b) switch use of bold fontvoid
cls()
clear screen (cls(true)
)void
cls
(boolean clear) clear screen (forclear=false
, move only cursor)boolean
dumb()
Is this a dumb terminal without colors?void
fg
(int color) set foreground colorvoid
hide cursorvoid
reset()
reset to black on white, normal fontvoid
show 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
-