Class WrapperTerminal
java.lang.Object
net.rubygrapefruit.platform.internal.AbstractTerminal
net.rubygrapefruit.platform.internal.WrapperTerminal
- All Implemented Interfaces:
Terminal
A
Terminal
implementation that wraps another to add thread safety.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.rubygrapefruit.platform.Terminal
Terminal.Color
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbold()
Switches the terminal to bold mode, if supported.Clears characters from the cursor position to the end of the current line.cursorDown
(int count) Moves the cursor the given number of characters down.cursorLeft
(int count) Moves the cursor the given number of characters to the left.cursorRight
(int count) Moves the cursor the given number of characters to the right.Moves the cursor to the start of the current line.cursorUp
(int count) Moves the cursor the given number of characters up.foreground
(Terminal.Color color) Sets the terminal foreground color, if supported.Returns the size of the terminal.protected void
init()
normal()
Switches the terminal to normal mode.reset()
Switches the terminal to normal mode and restores default colors.boolean
Returns true if this terminal supports setting output colors.boolean
Returns true if this terminal supports moving the cursor.boolean
Returns true if this terminal supports setting text attributes, such as bold.toString()
-
Constructor Details
-
WrapperTerminal
-
-
Method Details
-
init
protected void init()- Specified by:
init
in classAbstractTerminal
-
toString
-
getTerminalSize
Description copied from interface:Terminal
Returns the size of the terminal. Supported by all terminals.- Returns:
- The current terminal size. Never returns null.
- Throws:
NativeException
- On failure.
-
supportsColor
public boolean supportsColor()Description copied from interface:Terminal
Returns true if this terminal supports setting output colors. -
supportsCursorMotion
public boolean supportsCursorMotion()Description copied from interface:Terminal
Returns true if this terminal supports moving the cursor. -
supportsTextAttributes
public boolean supportsTextAttributes()Description copied from interface:Terminal
Returns true if this terminal supports setting text attributes, such as bold. -
normal
Description copied from interface:Terminal
Switches the terminal to normal mode. Supported by all terminals.- Throws:
NativeException
- On failure.
-
bold
Description copied from interface:Terminal
Switches the terminal to bold mode, if supported. Does nothing if this terminal does not support bold mode.- Throws:
NativeException
- On failure.
-
reset
Description copied from interface:Terminal
Switches the terminal to normal mode and restores default colors. Supported by all terminals.- Throws:
NativeException
- On failure.
-
foreground
Description copied from interface:Terminal
Sets the terminal foreground color, if supported. Does nothing if this terminal does not support setting the foreground color.- Throws:
NativeException
- On failure.
-
cursorLeft
Description copied from interface:Terminal
Moves the cursor the given number of characters to the left.- Throws:
NativeException
- On failure, or if this terminal does not support cursor motion.
-
cursorRight
Description copied from interface:Terminal
Moves the cursor the given number of characters to the right.- Throws:
NativeException
- On failure, or if this terminal does not support cursor motion.
-
cursorUp
Description copied from interface:Terminal
Moves the cursor the given number of characters up.- Throws:
NativeException
- On failure, or if this terminal does not support cursor motion.
-
cursorDown
Description copied from interface:Terminal
Moves the cursor the given number of characters down.- Throws:
NativeException
- On failure, or if this terminal does not support cursor motion.
-
cursorStartOfLine
Description copied from interface:Terminal
Moves the cursor to the start of the current line.- Throws:
NativeException
- On failure, or if this terminal does not support cursor motion.
-
clearToEndOfLine
Description copied from interface:Terminal
Clears characters from the cursor position to the end of the current line.- Throws:
NativeException
- On failure, or if this terminal does not support clearing.
-