Class WindowsTerminal

java.lang.Object
net.rubygrapefruit.platform.internal.AbstractTerminal
net.rubygrapefruit.platform.internal.WindowsTerminal
All Implemented Interfaces:
Terminal

public class WindowsTerminal extends AbstractTerminal
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • init

      protected void init()
      Specified by:
      init in class AbstractTerminal
    • supportsColor

      public boolean supportsColor()
      Description copied from interface: Terminal
      Returns true if this terminal supports setting output colors.
    • supportsTextAttributes

      public boolean supportsTextAttributes()
      Description copied from interface: Terminal
      Returns true if this terminal supports setting text attributes, such as bold.
    • supportsCursorMotion

      public boolean supportsCursorMotion()
      Description copied from interface: Terminal
      Returns true if this terminal supports moving the cursor.
    • getTerminalSize

      public TerminalSize getTerminalSize()
      Description copied from interface: Terminal
      Returns the size of the terminal. Supported by all terminals.
      Returns:
      The current terminal size. Never returns null.
    • bold

      public Terminal bold()
      Description copied from interface: Terminal
      Switches the terminal to bold mode, if supported. Does nothing if this terminal does not support bold mode.
    • foreground

      public Terminal foreground(Terminal.Color color)
      Description copied from interface: Terminal
      Sets the terminal foreground color, if supported. Does nothing if this terminal does not support setting the foreground color.
    • normal

      public Terminal normal()
      Description copied from interface: Terminal
      Switches the terminal to normal mode. Supported by all terminals.
    • reset

      public Terminal reset()
      Description copied from interface: Terminal
      Switches the terminal to normal mode and restores default colors. Supported by all terminals.
    • cursorDown

      public Terminal cursorDown(int count) throws NativeException
      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.
    • cursorUp

      public Terminal cursorUp(int count) throws NativeException
      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.
    • cursorLeft

      public Terminal cursorLeft(int count) throws NativeException
      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

      public Terminal cursorRight(int count) throws NativeException
      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.
    • cursorStartOfLine

      public Terminal cursorStartOfLine() throws NativeException
      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

      public Terminal clearToEndOfLine() throws NativeException
      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.