Module com.googlecode.lanterna
Class TerminalEmulatorDeviceConfiguration
- java.lang.Object
-
- com.googlecode.lanterna.terminal.swing.TerminalEmulatorDeviceConfiguration
-
public class TerminalEmulatorDeviceConfiguration extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TerminalEmulatorDeviceConfiguration.CursorStyle
Different cursor styles supported by SwingTerminal
-
Field Summary
Fields Modifier and Type Field Description private int
blinkLengthInMilliSeconds
private boolean
clipboardAvailable
private boolean
cursorBlinking
private TextColor
cursorColor
private TerminalEmulatorDeviceConfiguration.CursorStyle
cursorStyle
private int
lineBufferScrollbackSize
-
Constructor Summary
Constructors Constructor Description TerminalEmulatorDeviceConfiguration()
Creates a new terminal device configuration object with all the defaults setTerminalEmulatorDeviceConfiguration(int lineBufferScrollbackSize, int blinkLengthInMilliSeconds, TerminalEmulatorDeviceConfiguration.CursorStyle cursorStyle, TextColor cursorColor, boolean cursorBlinking)
Creates a new terminal device configuration object with all configurable values specified.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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.TextColor
getCursorColor()
What color to draw the text cursor color inTerminalEmulatorDeviceConfiguration.CursorStyle
getCursorStyle()
Style the text cursor should takestatic TerminalEmulatorDeviceConfiguration
getDefault()
This is a static reference to the default terminal device configuration.int
getLineBufferScrollbackSize()
How many lines of history should be saved so the user can scroll back to them?boolean
isClipboardAvailable()
boolean
isCursorBlinking()
Should the text cursor be blinkingTerminalEmulatorDeviceConfiguration
withBlinkLengthInMilliSeconds(int blinkLengthInMilliSeconds)
Copies the current configuration.TerminalEmulatorDeviceConfiguration
withClipboardAvailable(boolean clipboardAvailable)
Copies the current configuration.TerminalEmulatorDeviceConfiguration
withCursorBlinking(boolean cursorBlinking)
Copies the current configuration.TerminalEmulatorDeviceConfiguration
withCursorColor(TextColor cursorColor)
Copies the current configuration.TerminalEmulatorDeviceConfiguration
withCursorStyle(TerminalEmulatorDeviceConfiguration.CursorStyle cursorStyle)
Copies the current configuration.TerminalEmulatorDeviceConfiguration
withLineBufferScrollbackSize(int lineBufferScrollbackSize)
Copies the current configuration.
-
-
-
Field Detail
-
lineBufferScrollbackSize
private final int lineBufferScrollbackSize
-
blinkLengthInMilliSeconds
private final int blinkLengthInMilliSeconds
-
cursorStyle
private final TerminalEmulatorDeviceConfiguration.CursorStyle cursorStyle
-
cursorColor
private final TextColor cursorColor
-
cursorBlinking
private final boolean cursorBlinking
-
clipboardAvailable
private final boolean clipboardAvailable
-
-
Constructor Detail
-
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' lastcursorStyle
- Style of the terminal text cursorcursorColor
- Color of the terminal text cursorcursorBlinking
- 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' lastcursorStyle
- Style of the terminal text cursorcursorColor
- Color of the terminal text cursorcursorBlinking
- Should the terminal text cursor blink?clipboardAvailable
- Should the terminal support pasting text from the clipboard?
-
-
Method Detail
-
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
public TerminalEmulatorDeviceConfiguration.CursorStyle getCursorStyle()
Style the text cursor should take- Returns:
- Text cursor style
- See Also:
TerminalEmulatorDeviceConfiguration.CursorStyle
-
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
public TerminalEmulatorDeviceConfiguration withCursorStyle(TerminalEmulatorDeviceConfiguration.CursorStyle cursorStyle)
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.
-
-