Class TerminalEmulatorDeviceConfiguration

java.lang.Object
com.googlecode.lanterna.terminal.swing.TerminalEmulatorDeviceConfiguration

public class TerminalEmulatorDeviceConfiguration extends Object
Object that encapsulates the configuration parameters for the terminal 'device' that a SwingTerminal is emulating. This includes properties such as the shape of the cursor, the color of the cursor, how large scrollback is available and if the cursor should blink or not.
  • Field Details

    • lineBufferScrollbackSize

      private final int lineBufferScrollbackSize
    • blinkLengthInMilliSeconds

      private final int blinkLengthInMilliSeconds
    • cursorStyle

    • cursorColor

      private final TextColor cursorColor
    • cursorBlinking

      private final boolean cursorBlinking
    • clipboardAvailable

      private final boolean clipboardAvailable
  • Constructor Details

    • TerminalEmulatorDeviceConfiguration

      public TerminalEmulatorDeviceConfiguration()
      Creates a new terminal device configuration object with all the defaults set
    • TerminalEmulatorDeviceConfiguration

      public TerminalEmulatorDeviceConfiguration(int lineBufferScrollbackSize, int blinkLengthInMilliSeconds, TerminalEmulatorDeviceConfiguration.CursorStyle cursorStyle, TextColor cursorColor, boolean cursorBlinking)
      Creates a new terminal device configuration object with all configurable values specified.
      Parameters:
      lineBufferScrollbackSize - How many lines of scrollback buffer should the terminal save?
      blinkLengthInMilliSeconds - How many milliseconds does a 'blink' last
      cursorStyle - Style of the terminal text cursor
      cursorColor - Color of the terminal text cursor
      cursorBlinking - Should the terminal text cursor blink?
    • TerminalEmulatorDeviceConfiguration

      public TerminalEmulatorDeviceConfiguration(int lineBufferScrollbackSize, int blinkLengthInMilliSeconds, TerminalEmulatorDeviceConfiguration.CursorStyle cursorStyle, TextColor cursorColor, boolean cursorBlinking, boolean clipboardAvailable)
      Creates a new terminal device configuration object with all configurable values specified.
      Parameters:
      lineBufferScrollbackSize - How many lines of scrollback buffer should the terminal save?
      blinkLengthInMilliSeconds - How many milliseconds does a 'blink' last
      cursorStyle - Style of the terminal text cursor
      cursorColor - Color of the terminal text cursor
      cursorBlinking - Should the terminal text cursor blink?
      clipboardAvailable - Should the terminal support pasting text from the clipboard?
  • Method Details

    • getDefault

      public static TerminalEmulatorDeviceConfiguration getDefault()
      This is a static reference to the default terminal device configuration. Use this one if you are unsure.
      Returns:
      A terminal device configuration object with all settings set to default
    • getBlinkLengthInMilliSeconds

      public int getBlinkLengthInMilliSeconds()
      Returns the length of a 'blink', which is the interval time a character with the blink SGR enabled with be drawn with foreground color and background color set to the same.
      Returns:
      Milliseconds of a blink interval
    • getLineBufferScrollbackSize

      public int getLineBufferScrollbackSize()
      How many lines of history should be saved so the user can scroll back to them?
      Returns:
      Number of lines in the scrollback buffer
    • getCursorStyle

      Style the text cursor should take
      Returns:
      Text cursor style
      See Also:
    • getCursorColor

      public TextColor getCursorColor()
      What color to draw the text cursor color in
      Returns:
      Color of the text cursor
    • isCursorBlinking

      public boolean isCursorBlinking()
      Should the text cursor be blinking
      Returns:
      true if the text cursor should be blinking
    • isClipboardAvailable

      public boolean isClipboardAvailable()
    • withBlinkLengthInMilliSeconds

      public TerminalEmulatorDeviceConfiguration withBlinkLengthInMilliSeconds(int blinkLengthInMilliSeconds)
      Copies the current configuration. The new object has the given value.
      Parameters:
      blinkLengthInMilliSeconds - How many milliseconds does a 'blink' last
      Returns:
      A copy of the current configuration with the changed value.
    • withLineBufferScrollbackSize

      public TerminalEmulatorDeviceConfiguration withLineBufferScrollbackSize(int lineBufferScrollbackSize)
      Copies the current configuration. The new object has the given value.
      Parameters:
      lineBufferScrollbackSize - How many lines of scrollback buffer should the terminal save?
      Returns:
      A copy of the current configuration with the changed value.
    • withCursorStyle

      Copies the current configuration. The new object has the given value.
      Parameters:
      cursorStyle - Style of the terminal text cursor
      Returns:
      A copy of the current configuration with the changed value.
    • withCursorColor

      public TerminalEmulatorDeviceConfiguration withCursorColor(TextColor cursorColor)
      Copies the current configuration. The new object has the given value.
      Parameters:
      cursorColor - Color of the terminal text cursor
      Returns:
      A copy of the current configuration with the changed value.
    • withCursorBlinking

      public TerminalEmulatorDeviceConfiguration withCursorBlinking(boolean cursorBlinking)
      Copies the current configuration. The new object has the given value.
      Parameters:
      cursorBlinking - Should the terminal text cursor blink?
      Returns:
      A copy of the current configuration with the changed value.
    • withClipboardAvailable

      public TerminalEmulatorDeviceConfiguration withClipboardAvailable(boolean clipboardAvailable)
      Copies the current configuration. The new object has the given value.
      Parameters:
      clipboardAvailable - Should the terminal support pasting text from the clipboard?
      Returns:
      A copy of the current configuration with the changed value.