Class TerminfoTerminal
java.lang.Object
net.rubygrapefruit.platform.internal.AbstractTerminal
net.rubygrapefruit.platform.internal.TerminfoTerminal
- All Implemented Interfaces:
TerminalOutput
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.rubygrapefruit.platform.terminal.TerminalOutput
TerminalOutput.Color -
Field Summary
Fields inherited from class net.rubygrapefruit.platform.internal.AbstractTerminal
NEW_LINE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbold()Switches the terminal to bold text mode, if supported.bright()Switches the terminal to high intensity, 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.Sets the terminal foreground color to the default, if supported.dim()Switches the terminal to dim intensity, if supported.foreground(TerminalOutput.Color color) Sets the terminal foreground color, if supported.Returns anOutputStreamthat writes to this terminal.Returns the size of the terminal.Hides the cursor.protected voidinit()normal()Switches the terminal to normal text mode.reset()Resets this terminal.Shows the cursor, if hidden.booleanReturns true if this terminal supports setting output colors.booleanReturns true if this terminal supports moving the cursor.booleanReturns true if this terminal supports hiding the cursor.booleanReturns true if this terminal supports setting text attributes, such as bold.toString()Methods inherited from class net.rubygrapefruit.platform.internal.AbstractTerminal
newline, streamForOutput, write, write, write
-
Constructor Details
-
TerminfoTerminal
-
-
Method Details
-
toString
-
init
protected void init()- Specified by:
initin classAbstractTerminal
-
getTerminalSize
Description copied from interface:TerminalOutputReturns 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:TerminalOutputReturns true if this terminal supports setting output colors. -
supportsCursorMotion
public boolean supportsCursorMotion()Description copied from interface:TerminalOutputReturns true if this terminal supports moving the cursor. -
supportsTextAttributes
public boolean supportsTextAttributes()Description copied from interface:TerminalOutputReturns true if this terminal supports setting text attributes, such as bold. -
supportsCursorVisibility
public boolean supportsCursorVisibility()Description copied from interface:TerminalOutputReturns true if this terminal supports hiding the cursor. -
getOutputStream
Description copied from interface:TerminalOutputReturns anOutputStreamthat writes to this terminal. The output stream is not buffered. -
foreground
Description copied from interface:TerminalOutputSets the terminal foreground color, if supported. Does nothing if this terminal does not support setting the foreground color. -
bold
Description copied from interface:TerminalOutputSwitches the terminal to bold text mode, if supported. Does nothing if this terminal does not support bold mode.Often the same as
TerminalOutput.bright(). -
dim
Description copied from interface:TerminalOutputSwitches the terminal to dim intensity, if supported. Does nothing if this terminal does not support dim mode.- Throws:
NativeException- On failure.
-
bright
Description copied from interface:TerminalOutputSwitches the terminal to high intensity, if supported. Does nothing if this terminal does not support bright mode.- Throws:
NativeException- On failure.
-
normal
Description copied from interface:TerminalOutputSwitches the terminal to normal text mode. Switches off bold text mode and sets normal intensity. Supported by all terminals. -
defaultForeground
Description copied from interface:TerminalOutputSets the terminal foreground color to the default, if supported. Does nothing if this terminal does not support setting the foreground color.- Throws:
NativeException- On failure.
-
reset
Description copied from interface:TerminalOutputResets this terminal. Switches to normal text mode, restores default foreground color and shows the cursor. Supported by all terminals. -
hideCursor
Description copied from interface:TerminalOutputHides the cursor. Does nothing if this terminal does not support hiding the cursor.- Throws:
NativeException- On failure.
-
showCursor
Description copied from interface:TerminalOutputShows the cursor, if hidden. Supported by all terminals.- Throws:
NativeException- On failure.
-
cursorDown
Description copied from interface:TerminalOutputMoves the cursor the given number of characters down. -
cursorUp
Description copied from interface:TerminalOutputMoves the cursor the given number of characters up. -
cursorLeft
Description copied from interface:TerminalOutputMoves the cursor the given number of characters to the left. -
cursorRight
Description copied from interface:TerminalOutputMoves the cursor the given number of characters to the right. -
cursorStartOfLine
Description copied from interface:TerminalOutputMoves 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:TerminalOutputClears characters from the cursor position to the end of the current line.- Throws:
NativeException- On failure, or if this terminal does not support clearing.
-