Module com.googlecode.lanterna
Class TerminalEmulatorDeviceConfiguration
java.lang.Object
com.googlecode.lanterna.terminal.swing.TerminalEmulatorDeviceConfiguration
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 ClassesModifier and TypeClassDescriptionstatic enum
Different cursor styles supported by SwingTerminal -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final boolean
private final boolean
private final TextColor
private final TerminalEmulatorDeviceConfiguration.CursorStyle
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionint
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.What color to draw the text cursor color inStyle the text cursor should takeThis is a static reference to the default terminal device configuration.int
How many lines of history should be saved so the user can scroll back to them?boolean
boolean
Should the text cursor be blinkingwithBlinkLengthInMilliSeconds
(int blinkLengthInMilliSeconds) Copies the current configuration.withClipboardAvailable
(boolean clipboardAvailable) Copies the current configuration.withCursorBlinking
(boolean cursorBlinking) Copies the current configuration.withCursorColor
(TextColor cursorColor) Copies the current configuration.Copies the current configuration.withLineBufferScrollbackSize
(int lineBufferScrollbackSize) Copies the current configuration.
-
Field Details
-
lineBufferScrollbackSize
private final int lineBufferScrollbackSize -
blinkLengthInMilliSeconds
private final int blinkLengthInMilliSeconds -
cursorStyle
-
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' 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 Details
-
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
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
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
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
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.
-