Package org.jline.terminal.impl.jni.win
Class WindowsAnsiWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.jline.utils.AnsiWriter
-
- org.jline.terminal.impl.jni.win.WindowsAnsiWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public final class WindowsAnsiWriter extends AnsiWriter
A Windows ANSI escape processor, that uses JNA to access native platform API's to change the console attributes.- Since:
- 1.0
- Author:
- Hiram Chirino, Joris Kuipers
-
-
Field Summary
-
Fields inherited from class org.jline.utils.AnsiWriter
ATTRIBUTE_BLINK_FAST, ATTRIBUTE_BLINK_OFF, ATTRIBUTE_BLINK_SLOW, ATTRIBUTE_CONCEAL_OFF, ATTRIBUTE_CONCEAL_ON, ATTRIBUTE_INTENSITY_BOLD, ATTRIBUTE_INTENSITY_FAINT, ATTRIBUTE_INTENSITY_NORMAL, ATTRIBUTE_ITALIC, ATTRIBUTE_NEGATIVE_Off, ATTRIBUTE_NEGATIVE_OFF, ATTRIBUTE_NEGATIVE_ON, ATTRIBUTE_UNDERLINE, ATTRIBUTE_UNDERLINE_DOUBLE, ATTRIBUTE_UNDERLINE_OFF, BLACK, BLUE, CYAN, ERASE_LINE, ERASE_LINE_TO_BEGINING, ERASE_LINE_TO_END, ERASE_SCREEN, ERASE_SCREEN_TO_BEGINING, ERASE_SCREEN_TO_END, GREEN, MAGENTA, RED, WHITE, YELLOW
-
-
Constructor Summary
Constructors Constructor Description WindowsAnsiWriter(java.io.Writer out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
processAttributeRest()
processSGR 0
corresponding toReset / Normal
protected void
processChangeWindowTitle(java.lang.String title)
processOSC 2;text BEL
corresponding toChange Window title
protected void
processCursorDown(int count)
processCSI n B
corresponding toCUD ? Cursor Down
protected void
processCursorDownLine(int count)
processCSI n E
corresponding toCNL ? Cursor Next Line
protected void
processCursorLeft(int count)
processCSI n D
corresponding toCUB ? Cursor Back
protected void
processCursorRight(int count)
processCSI n C
corresponding toCUF ? Cursor Forward
protected void
processCursorTo(int row, int col)
processCSI n ; m H
corresponding toCUP ? Cursor Position
orCSI n ; m f
corresponding toHVP ? Horizontal and Vertical Position
protected void
processCursorToColumn(int x)
processCSI n G
corresponding toCHA ? Cursor Horizontal Absolute
protected void
processCursorUp(int count)
processCSI n A
corresponding toCUU ? Cursor Up
protected void
processCursorUpLine(int count)
processCSI n F
corresponding toCPL ? Cursor Previous Line
protected void
processDefaultBackgroundColor()
processSGR 49
corresponding toDefault background color
protected void
processDefaultTextColor()
processSGR 39
corresponding toDefault text color (foreground)
protected void
processDeleteLine(int optionInt)
ProcessCSI s
ANSI code, corresponding toDL ? Delete Line
protected void
processEraseLine(int eraseOption)
ProcessCSI n K
ANSI code, corresponding toED ? Erase in Line
protected void
processEraseScreen(int eraseOption)
ProcessCSI n J
ANSI code, corresponding toED ? Erase in Display
protected void
processInsertLine(int optionInt)
ProcessCSI s
ANSI code, corresponding toIL ? Insert Line
protected void
processRestoreCursorPosition()
ProcessCSI u
ANSI code, corresponding toRCP ? Restore Cursor Position
protected void
processSaveCursorPosition()
ProcessCSI s
ANSI code, corresponding toSCP ? Save Cursor Position
protected void
processSetAttribute(int attribute)
processSGR
other than0
(reset),30-39
(foreground),40-49
(background),90-97
(foreground high intensity) or100-107
(background high intensity)protected void
processSetBackgroundColorExt(int paletteIndex)
processSGR 48
corresponding toextended set background color
with a palette of 255 colors.protected void
processSetForegroundColorExt(int paletteIndex)
processSGR 38
corresponding toextended set text color (foreground)
with a palette of 255 colors.-
Methods inherited from class org.jline.utils.AnsiWriter
close, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColor, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColor, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand, write, write, write
-
-
-
-
Method Detail
-
processEraseScreen
protected void processEraseScreen(int eraseOption) throws java.io.IOException
Description copied from class:AnsiWriter
ProcessCSI n J
ANSI code, corresponding toED ? Erase in Display
- Overrides:
processEraseScreen
in classAnsiWriter
- Parameters:
eraseOption
- the erase option- Throws:
java.io.IOException
- if an error occurs
-
processEraseLine
protected void processEraseLine(int eraseOption) throws java.io.IOException
Description copied from class:AnsiWriter
ProcessCSI n K
ANSI code, corresponding toED ? Erase in Line
- Overrides:
processEraseLine
in classAnsiWriter
- Parameters:
eraseOption
- the erase option- Throws:
java.io.IOException
- if an error occurs
-
processCursorUpLine
protected void processCursorUpLine(int count) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n F
corresponding toCPL ? Cursor Previous Line
- Overrides:
processCursorUpLine
in classAnsiWriter
- Parameters:
count
- line count- Throws:
java.io.IOException
- if an error occurs
-
processCursorDownLine
protected void processCursorDownLine(int count) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n E
corresponding toCNL ? Cursor Next Line
- Overrides:
processCursorDownLine
in classAnsiWriter
- Parameters:
count
- line count- Throws:
java.io.IOException
- if an error occurs
-
processCursorLeft
protected void processCursorLeft(int count) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n D
corresponding toCUB ? Cursor Back
- Overrides:
processCursorLeft
in classAnsiWriter
- Parameters:
count
- the count- Throws:
java.io.IOException
- if an error occurs
-
processCursorRight
protected void processCursorRight(int count) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n C
corresponding toCUF ? Cursor Forward
- Overrides:
processCursorRight
in classAnsiWriter
- Parameters:
count
- the count- Throws:
java.io.IOException
- if an error occurs
-
processCursorDown
protected void processCursorDown(int count) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n B
corresponding toCUD ? Cursor Down
- Overrides:
processCursorDown
in classAnsiWriter
- Parameters:
count
- the count- Throws:
java.io.IOException
- if an error occurs
-
processCursorUp
protected void processCursorUp(int count) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n A
corresponding toCUU ? Cursor Up
- Overrides:
processCursorUp
in classAnsiWriter
- Parameters:
count
- the count- Throws:
java.io.IOException
- if an error occurs
-
processCursorTo
protected void processCursorTo(int row, int col) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n ; m H
corresponding toCUP ? Cursor Position
orCSI n ; m f
corresponding toHVP ? Horizontal and Vertical Position
- Overrides:
processCursorTo
in classAnsiWriter
- Parameters:
row
- the rowcol
- the column- Throws:
java.io.IOException
- if an error occurs
-
processCursorToColumn
protected void processCursorToColumn(int x) throws java.io.IOException
Description copied from class:AnsiWriter
processCSI n G
corresponding toCHA ? Cursor Horizontal Absolute
- Overrides:
processCursorToColumn
in classAnsiWriter
- Parameters:
x
- the column- Throws:
java.io.IOException
- if an error occurs
-
processSetForegroundColorExt
protected void processSetForegroundColorExt(int paletteIndex) throws java.io.IOException
Description copied from class:AnsiWriter
processSGR 38
corresponding toextended set text color (foreground)
with a palette of 255 colors.- Overrides:
processSetForegroundColorExt
in classAnsiWriter
- Parameters:
paletteIndex
- the text color in the palette- Throws:
java.io.IOException
- if an error occurs
-
processSetBackgroundColorExt
protected void processSetBackgroundColorExt(int paletteIndex) throws java.io.IOException
Description copied from class:AnsiWriter
processSGR 48
corresponding toextended set background color
with a palette of 255 colors.- Overrides:
processSetBackgroundColorExt
in classAnsiWriter
- Parameters:
paletteIndex
- the background color in the palette- Throws:
java.io.IOException
- if an error occurs
-
processDefaultTextColor
protected void processDefaultTextColor() throws java.io.IOException
Description copied from class:AnsiWriter
processSGR 39
corresponding toDefault text color (foreground)
- Overrides:
processDefaultTextColor
in classAnsiWriter
- Throws:
java.io.IOException
- if an error occurs
-
processDefaultBackgroundColor
protected void processDefaultBackgroundColor() throws java.io.IOException
Description copied from class:AnsiWriter
processSGR 49
corresponding toDefault background color
- Overrides:
processDefaultBackgroundColor
in classAnsiWriter
- Throws:
java.io.IOException
- if an error occurs
-
processAttributeRest
protected void processAttributeRest() throws java.io.IOException
Description copied from class:AnsiWriter
processSGR 0
corresponding toReset / Normal
- Overrides:
processAttributeRest
in classAnsiWriter
- Throws:
java.io.IOException
- if an error occurs
-
processSetAttribute
protected void processSetAttribute(int attribute) throws java.io.IOException
Description copied from class:AnsiWriter
processSGR
other than0
(reset),30-39
(foreground),40-49
(background),90-97
(foreground high intensity) or100-107
(background high intensity)- Overrides:
processSetAttribute
in classAnsiWriter
- Parameters:
attribute
- the attribute to set- Throws:
java.io.IOException
- if an error occurs- See Also:
AnsiWriter.processAttributeRest()
,AnsiWriter.processSetForegroundColor(int)
,AnsiWriter.processSetForegroundColor(int, boolean)
,AnsiWriter.processSetForegroundColorExt(int)
,AnsiWriter.processSetForegroundColorExt(int, int, int)
,AnsiWriter.processDefaultTextColor()
,AnsiWriter.processDefaultBackgroundColor()
-
processSaveCursorPosition
protected void processSaveCursorPosition() throws java.io.IOException
Description copied from class:AnsiWriter
ProcessCSI s
ANSI code, corresponding toSCP ? Save Cursor Position
- Overrides:
processSaveCursorPosition
in classAnsiWriter
- Throws:
java.io.IOException
- if an error occurs
-
processRestoreCursorPosition
protected void processRestoreCursorPosition() throws java.io.IOException
Description copied from class:AnsiWriter
ProcessCSI u
ANSI code, corresponding toRCP ? Restore Cursor Position
- Overrides:
processRestoreCursorPosition
in classAnsiWriter
- Throws:
java.io.IOException
- if an error occurs
-
processInsertLine
protected void processInsertLine(int optionInt) throws java.io.IOException
Description copied from class:AnsiWriter
ProcessCSI s
ANSI code, corresponding toIL ? Insert Line
- Overrides:
processInsertLine
in classAnsiWriter
- Parameters:
optionInt
- the option- Throws:
java.io.IOException
- if an error occurs
-
processDeleteLine
protected void processDeleteLine(int optionInt) throws java.io.IOException
Description copied from class:AnsiWriter
ProcessCSI s
ANSI code, corresponding toDL ? Delete Line
- Overrides:
processDeleteLine
in classAnsiWriter
- Parameters:
optionInt
- the option- Throws:
java.io.IOException
- if an error occurs
-
processChangeWindowTitle
protected void processChangeWindowTitle(java.lang.String title)
Description copied from class:AnsiWriter
processOSC 2;text BEL
corresponding toChange Window title
- Overrides:
processChangeWindowTitle
in classAnsiWriter
- Parameters:
title
- the title
-
-