Class TerminfoTerminal
- java.lang.Object
-
- net.rubygrapefruit.platform.internal.AbstractTerminal
-
- net.rubygrapefruit.platform.internal.TerminfoTerminal
-
- All Implemented Interfaces:
Terminal
public class TerminfoTerminal extends AbstractTerminal
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.rubygrapefruit.platform.Terminal
Terminal.Color
-
-
Constructor Summary
Constructors Constructor Description TerminfoTerminal(Terminals.Output output)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Terminalbold()Switches the terminal to bold mode, if supported.TerminalclearToEndOfLine()Clears characters from the cursor position to the end of the current line.TerminalcursorDown(int count)Moves the cursor the given number of characters down.TerminalcursorLeft(int count)Moves the cursor the given number of characters to the left.TerminalcursorRight(int count)Moves the cursor the given number of characters to the right.TerminalcursorStartOfLine()Moves the cursor to the start of the current line.TerminalcursorUp(int count)Moves the cursor the given number of characters up.Terminalforeground(Terminal.Color color)Sets the terminal foreground color, if supported.TerminalSizegetTerminalSize()Returns the size of the terminal.protected voidinit()Terminalnormal()Switches the terminal to normal mode.Terminalreset()Switches the terminal to normal mode and restores default colors.booleansupportsColor()Returns true if this terminal supports setting output colors.booleansupportsCursorMotion()Returns true if this terminal supports moving the cursor.booleansupportsTextAttributes()Returns true if this terminal supports setting text attributes, such as bold.java.lang.StringtoString()
-
-
-
Constructor Detail
-
TerminfoTerminal
public TerminfoTerminal(Terminals.Output output)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
init
protected void init()
- Specified by:
initin classAbstractTerminal
-
getTerminalSize
public TerminalSize getTerminalSize()
Description copied from interface:TerminalReturns the size of the terminal. Supported by all terminals.- Returns:
- The current terminal size. Never returns null.
-
supportsColor
public boolean supportsColor()
Description copied from interface:TerminalReturns true if this terminal supports setting output colors.
-
supportsCursorMotion
public boolean supportsCursorMotion()
Description copied from interface:TerminalReturns true if this terminal supports moving the cursor.
-
supportsTextAttributes
public boolean supportsTextAttributes()
Description copied from interface:TerminalReturns true if this terminal supports setting text attributes, such as bold.
-
foreground
public Terminal foreground(Terminal.Color color)
Description copied from interface:TerminalSets the terminal foreground color, if supported. Does nothing if this terminal does not support setting the foreground color.
-
bold
public Terminal bold()
Description copied from interface:TerminalSwitches the terminal to bold mode, if supported. Does nothing if this terminal does not support bold mode.
-
normal
public Terminal normal()
Description copied from interface:TerminalSwitches the terminal to normal mode. Supported by all terminals.
-
reset
public Terminal reset()
Description copied from interface:TerminalSwitches the terminal to normal mode and restores default colors. Supported by all terminals.
-
cursorDown
public Terminal cursorDown(int count)
Description copied from interface:TerminalMoves the cursor the given number of characters down.
-
cursorUp
public Terminal cursorUp(int count)
Description copied from interface:TerminalMoves the cursor the given number of characters up.
-
cursorLeft
public Terminal cursorLeft(int count)
Description copied from interface:TerminalMoves the cursor the given number of characters to the left.
-
cursorRight
public Terminal cursorRight(int count)
Description copied from interface:TerminalMoves the cursor the given number of characters to the right.
-
cursorStartOfLine
public Terminal cursorStartOfLine() throws NativeException
Description copied from interface:TerminalMoves the cursor to the start of the current line.- Throws:
NativeException- On failure, or if this terminal does not support cursor motion.
-
clearToEndOfLine
public Terminal clearToEndOfLine() throws NativeException
Description copied from interface:TerminalClears characters from the cursor position to the end of the current line.- Throws:
NativeException- On failure, or if this terminal does not support clearing.
-
-