WindowsAnsiPrintStream
, which does not suffer from encoding issuespublic final class WindowsAnsiOutputStream extends AnsiOutputStream
WindowsAnsiPrintStream
Modifier and Type | Field and Description |
---|---|
private static short[] |
ANSI_BACKGROUND_COLOR_MAP
Deprecated.
|
private static short[] |
ANSI_FOREGROUND_COLOR_MAP
Deprecated.
|
private static short |
BACKGROUND_BLACK
Deprecated.
|
private static short |
BACKGROUND_CYAN
Deprecated.
|
private static short |
BACKGROUND_MAGENTA
Deprecated.
|
private static short |
BACKGROUND_WHITE
Deprecated.
|
private static short |
BACKGROUND_YELLOW
Deprecated.
|
private static long |
console
Deprecated.
|
private static short |
FOREGROUND_BLACK
Deprecated.
|
private static short |
FOREGROUND_CYAN
Deprecated.
|
private static short |
FOREGROUND_MAGENTA
Deprecated.
|
private static short |
FOREGROUND_WHITE
Deprecated.
|
private static short |
FOREGROUND_YELLOW
Deprecated.
|
private org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO |
info
Deprecated.
|
private boolean |
negative
Deprecated.
|
private short |
originalColors
Deprecated.
|
private short |
savedX
Deprecated.
|
private short |
savedY
Deprecated.
|
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, RESET_CODE, REST_CODE, state, WHITE, YELLOW
Constructor and Description |
---|
WindowsAnsiOutputStream(java.io.OutputStream os)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private void |
applyAttribute()
Deprecated.
|
private void |
applyCursorPosition()
Deprecated.
|
private void |
getConsoleInfo()
Deprecated.
|
private short |
invertAttributeColors(short attributes)
Deprecated.
|
protected void |
processAttributeRest()
Deprecated.
process
SGR 0 corresponding to Reset / Normal |
protected void |
processChangeWindowTitle(java.lang.String label)
Deprecated.
process
OSC 2;text BEL corresponding to Change Window title |
protected void |
processCursorDown(int count)
Deprecated.
process
CSI n B corresponding to CUD – Cursor Down |
protected void |
processCursorLeft(int count)
Deprecated.
process
CSI n D corresponding to CUB – Cursor Back |
protected void |
processCursorRight(int count)
Deprecated.
process
CSI n C corresponding to CUF – Cursor Forward |
protected void |
processCursorTo(int row,
int col)
Deprecated.
process
CSI n ; m H corresponding to CUP – Cursor Position or
CSI n ; m f corresponding to HVP – Horizontal and Vertical Position |
protected void |
processCursorToColumn(int x)
Deprecated.
process
CSI n G corresponding to CHA – Cursor Horizontal Absolute |
protected void |
processCursorUp(int count)
Deprecated.
process
CSI n A corresponding to CUU – Cursor Up |
protected void |
processDefaultBackgroundColor()
Deprecated.
process
SGR 49 corresponding to Default background color |
protected void |
processDefaultTextColor()
Deprecated.
process
SGR 39 corresponding to Default text color (foreground) |
protected void |
processDeleteLine(int optionInt)
Deprecated.
Process
CSI M ANSI code, corresponding to DL – Delete Line |
protected void |
processEraseLine(int eraseOption)
Deprecated.
Process
CSI n K ANSI code, corresponding to ED – Erase in Line |
protected void |
processEraseScreen(int eraseOption)
Deprecated.
Process
CSI n J ANSI code, corresponding to ED – Erase in Display |
protected void |
processInsertLine(int optionInt)
Deprecated.
Process
CSI L ANSI code, corresponding to IL – Insert Line |
protected void |
processRestoreCursorPosition()
Deprecated.
Process
CSI u ANSI code, corresponding to RCP – Restore Cursor Position |
protected void |
processSaveCursorPosition()
Deprecated.
Process
CSI s ANSI code, corresponding to SCP – Save Cursor Position |
protected void |
processSetAttribute(int attribute)
Deprecated.
process
SGR other than 0 (reset), 30-39 (foreground),
40-49 (background), 90-97 (foreground high intensity) or
100-107 (background high intensity) |
protected void |
processSetBackgroundColor(int color,
boolean bright)
Deprecated.
process
SGR 40-47 or SGR 100-107 corresponding to
Set background color either in normal mode or high intensity. |
protected void |
processSetForegroundColor(int color,
boolean bright)
Deprecated.
process
SGR 30-37 or SGR 90-97 corresponding to
Set text color (foreground) either in normal mode or high intensity. |
close, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processCursorDownLine, processCursorUpLine, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColorExt, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColorExt, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand, write
private static final long console
private static final short FOREGROUND_BLACK
private static final short FOREGROUND_YELLOW
private static final short FOREGROUND_MAGENTA
private static final short FOREGROUND_CYAN
private static final short FOREGROUND_WHITE
private static final short BACKGROUND_BLACK
private static final short BACKGROUND_YELLOW
private static final short BACKGROUND_MAGENTA
private static final short BACKGROUND_CYAN
private static final short BACKGROUND_WHITE
private static final short[] ANSI_FOREGROUND_COLOR_MAP
private static final short[] ANSI_BACKGROUND_COLOR_MAP
private final org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO info
private final short originalColors
private boolean negative
private short savedX
private short savedY
public WindowsAnsiOutputStream(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
private void getConsoleInfo() throws java.io.IOException
java.io.IOException
private void applyAttribute() throws java.io.IOException
java.io.IOException
private short invertAttributeColors(short attributes)
private void applyCursorPosition() throws java.io.IOException
java.io.IOException
protected void processEraseScreen(int eraseOption) throws java.io.IOException
AnsiOutputStream
CSI n J
ANSI code, corresponding to ED – Erase in Display
processEraseScreen
in class AnsiOutputStream
eraseOption
- eraseOptionjava.io.IOException
- IOExceptionprotected void processEraseLine(int eraseOption) throws java.io.IOException
AnsiOutputStream
CSI n K
ANSI code, corresponding to ED – Erase in Line
processEraseLine
in class AnsiOutputStream
eraseOption
- eraseOptionjava.io.IOException
- IOExceptionprotected void processCursorLeft(int count) throws java.io.IOException
AnsiOutputStream
CSI n D
corresponding to CUB – Cursor Back
processCursorLeft
in class AnsiOutputStream
count
- numer of characters to move leftjava.io.IOException
- IOExceptionprotected void processCursorRight(int count) throws java.io.IOException
AnsiOutputStream
CSI n C
corresponding to CUF – Cursor Forward
processCursorRight
in class AnsiOutputStream
count
- number of characters to move onjava.io.IOException
- IOExceptionprotected void processCursorDown(int count) throws java.io.IOException
AnsiOutputStream
CSI n B
corresponding to CUD – Cursor Down
processCursorDown
in class AnsiOutputStream
count
- numer of linejava.io.IOException
- IOExceptionprotected void processCursorUp(int count) throws java.io.IOException
AnsiOutputStream
CSI n A
corresponding to CUU – Cursor Up
processCursorUp
in class AnsiOutputStream
count
- number of linesjava.io.IOException
- IOExceptionprotected void processCursorTo(int row, int col) throws java.io.IOException
AnsiOutputStream
CSI n ; m H
corresponding to CUP – Cursor Position
or
CSI n ; m f
corresponding to HVP – Horizontal and Vertical Position
processCursorTo
in class AnsiOutputStream
row
- rowcol
- columnjava.io.IOException
- IOExceptionprotected void processCursorToColumn(int x) throws java.io.IOException
AnsiOutputStream
CSI n G
corresponding to CHA – Cursor Horizontal Absolute
processCursorToColumn
in class AnsiOutputStream
x
- the columnjava.io.IOException
- IOExceptionprotected void processSetForegroundColor(int color, boolean bright) throws java.io.IOException
AnsiOutputStream
SGR 30-37
or SGR 90-97
corresponding to
Set text color (foreground)
either in normal mode or high intensity.processSetForegroundColor
in class AnsiOutputStream
color
- the text colorbright
- is high intensity?java.io.IOException
- IOExceptionprotected void processSetBackgroundColor(int color, boolean bright) throws java.io.IOException
AnsiOutputStream
SGR 40-47
or SGR 100-107
corresponding to
Set background color
either in normal mode or high intensity.processSetBackgroundColor
in class AnsiOutputStream
color
- the background colorbright
- is high intensity?java.io.IOException
- IOExceptionprotected void processDefaultTextColor() throws java.io.IOException
AnsiOutputStream
SGR 39
corresponding to Default text color (foreground)
processDefaultTextColor
in class AnsiOutputStream
java.io.IOException
- IOExceptionprotected void processDefaultBackgroundColor() throws java.io.IOException
AnsiOutputStream
SGR 49
corresponding to Default background color
processDefaultBackgroundColor
in class AnsiOutputStream
java.io.IOException
- IOExceptionprotected void processAttributeRest() throws java.io.IOException
AnsiOutputStream
SGR 0
corresponding to Reset / Normal
processAttributeRest
in class AnsiOutputStream
java.io.IOException
- IOExceptionprotected void processSetAttribute(int attribute) throws java.io.IOException
AnsiOutputStream
SGR
other than 0
(reset), 30-39
(foreground),
40-49
(background), 90-97
(foreground high intensity) or
100-107
(background high intensity)processSetAttribute
in class AnsiOutputStream
attribute
- attributejava.io.IOException
- IOExceptionAnsiOutputStream.processAttributeRest()
,
AnsiOutputStream.processSetForegroundColor(int)
,
AnsiOutputStream.processSetForegroundColor(int, boolean)
,
AnsiOutputStream.processSetForegroundColorExt(int)
,
AnsiOutputStream.processSetForegroundColorExt(int, int, int)
,
AnsiOutputStream.processDefaultTextColor()
,
AnsiOutputStream.processDefaultBackgroundColor()
protected void processSaveCursorPosition() throws java.io.IOException
AnsiOutputStream
CSI s
ANSI code, corresponding to SCP – Save Cursor Position
processSaveCursorPosition
in class AnsiOutputStream
java.io.IOException
- IOExceptionprotected void processRestoreCursorPosition() throws java.io.IOException
AnsiOutputStream
CSI u
ANSI code, corresponding to RCP – Restore Cursor Position
processRestoreCursorPosition
in class AnsiOutputStream
java.io.IOException
- IOExceptionprotected void processInsertLine(int optionInt) throws java.io.IOException
AnsiOutputStream
CSI L
ANSI code, corresponding to IL – Insert Line
processInsertLine
in class AnsiOutputStream
optionInt
- optionjava.io.IOException
- IOExceptionprotected void processDeleteLine(int optionInt) throws java.io.IOException
AnsiOutputStream
CSI M
ANSI code, corresponding to DL – Delete Line
processDeleteLine
in class AnsiOutputStream
optionInt
- optionjava.io.IOException
- IOExceptionprotected void processChangeWindowTitle(java.lang.String label)
AnsiOutputStream
OSC 2;text BEL
corresponding to Change Window title
processChangeWindowTitle
in class AnsiOutputStream
label
- window label