public class AnsiTerminal extends AbstractTerminal
TerminalOutput.ColorNEW_LINE| Constructor and Description |
|---|
AnsiTerminal(java.io.OutputStream outputStream,
Terminals.Output output) |
| Modifier and Type | Method and Description |
|---|---|
TerminalOutput |
bold()
Switches the terminal to bold text mode, if supported.
|
TerminalOutput |
bright()
Switches the terminal to high intensity, if supported.
|
TerminalOutput |
clearToEndOfLine()
Clears characters from the cursor position to the end of the current line.
|
TerminalOutput |
cursorDown(int count)
Moves the cursor the given number of characters down.
|
TerminalOutput |
cursorLeft(int count)
Moves the cursor the given number of characters to the left.
|
TerminalOutput |
cursorRight(int count)
Moves the cursor the given number of characters to the right.
|
TerminalOutput |
cursorStartOfLine()
Moves the cursor to the start of the current line.
|
TerminalOutput |
cursorUp(int count)
Moves the cursor the given number of characters up.
|
TerminalOutput |
defaultForeground()
Sets the terminal foreground color to the default, if supported.
|
TerminalOutput |
dim()
Switches the terminal to dim intensity, if supported.
|
TerminalOutput |
foreground(TerminalOutput.Color color)
Sets the terminal foreground color, if supported.
|
java.io.OutputStream |
getOutputStream()
Returns an
OutputStream that writes to this terminal. |
TerminalSize |
getTerminalSize()
Returns the size of the terminal.
|
TerminalOutput |
hideCursor()
Hides the cursor.
|
protected void |
init() |
TerminalOutput |
normal()
Switches the terminal to normal text mode.
|
TerminalOutput |
reset()
Resets this terminal.
|
TerminalOutput |
showCursor()
Shows the cursor, if hidden.
|
boolean |
supportsColor()
Returns true if this terminal supports setting output colors.
|
boolean |
supportsCursorMotion()
Returns true if this terminal supports moving the cursor.
|
boolean |
supportsCursorVisibility()
Returns true if this terminal supports hiding the cursor.
|
boolean |
supportsTextAttributes()
Returns true if this terminal supports setting text attributes, such as bold.
|
java.lang.String |
toString() |
newline, write, write, writepublic AnsiTerminal(java.io.OutputStream outputStream,
Terminals.Output output)
public java.lang.String toString()
toString in class java.lang.Objectprotected void init()
init in class AbstractTerminalpublic boolean supportsTextAttributes()
TerminalOutputpublic boolean supportsColor()
TerminalOutputpublic boolean supportsCursorMotion()
TerminalOutputpublic boolean supportsCursorVisibility()
TerminalOutputpublic TerminalSize getTerminalSize() throws NativeException
TerminalOutputNativeException - On failure.public java.io.OutputStream getOutputStream()
TerminalOutputOutputStream that writes to this terminal. The output stream is not buffered.public TerminalOutput foreground(TerminalOutput.Color color) throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput defaultForeground() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput bright() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput dim() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput bold() throws NativeException
TerminalOutputOften the same as TerminalOutput.bright().
NativeException - On failure.public TerminalOutput normal() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput reset() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput hideCursor() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput showCursor() throws NativeException
TerminalOutputNativeException - On failure.public TerminalOutput cursorLeft(int count) throws NativeException
TerminalOutputNativeException - On failure, or if this terminal does not support cursor motion.public TerminalOutput cursorRight(int count) throws NativeException
TerminalOutputNativeException - On failure, or if this terminal does not support cursor motion.public TerminalOutput cursorUp(int count) throws NativeException
TerminalOutputNativeException - On failure, or if this terminal does not support cursor motion.public TerminalOutput cursorDown(int count) throws NativeException
TerminalOutputNativeException - On failure, or if this terminal does not support cursor motion.public TerminalOutput cursorStartOfLine() throws NativeException
TerminalOutputNativeException - On failure, or if this terminal does not support cursor motion.public TerminalOutput clearToEndOfLine() throws NativeException
TerminalOutputNativeException - On failure, or if this terminal does not support clearing.