Package org.fusesource.jansi
Class WindowsAnsiOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.fusesource.jansi.AnsiOutputStream
-
- org.fusesource.jansi.WindowsAnsiOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public final class WindowsAnsiOutputStream extends AnsiOutputStream
Deprecated.useWindowsAnsiPrintStream, which does not suffer from encoding issuesA Windows ANSI escape processor, that uses JNA to access native platform API's to change the console attributes.- Since:
- 1.0
- See Also:
WindowsAnsiPrintStream
-
-
Field Summary
Fields Modifier and Type Field Description private static short[]ANSI_BACKGROUND_COLOR_MAPDeprecated.private static short[]ANSI_FOREGROUND_COLOR_MAPDeprecated.private static shortBACKGROUND_BLACKDeprecated.private static shortBACKGROUND_CYANDeprecated.private static shortBACKGROUND_MAGENTADeprecated.private static shortBACKGROUND_WHITEDeprecated.private static shortBACKGROUND_YELLOWDeprecated.private longconsoleDeprecated.private static shortFOREGROUND_BLACKDeprecated.private static shortFOREGROUND_CYANDeprecated.private static shortFOREGROUND_MAGENTADeprecated.private static shortFOREGROUND_WHITEDeprecated.private static shortFOREGROUND_YELLOWDeprecated.private org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFOinfoDeprecated.private booleannegativeDeprecated.private shortoriginalColorsDeprecated.private shortsavedXDeprecated.private shortsavedYDeprecated.private static longstderr_handleDeprecated.private static longstdout_handleDeprecated.-
Fields inherited from class org.fusesource.jansi.AnsiOutputStream
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 Summary
Constructors Constructor Description WindowsAnsiOutputStream(java.io.OutputStream os)Deprecated.WindowsAnsiOutputStream(java.io.OutputStream os, boolean stdout)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidapplyAttribute()Deprecated.private voidapplyCursorPosition()Deprecated.private voidgetConsoleInfo()Deprecated.private shortinvertAttributeColors(short attributes)Deprecated.protected voidprocessAttributeRest()Deprecated.processSGR 0corresponding toReset / Normalprotected voidprocessChangeWindowTitle(java.lang.String label)Deprecated.processOSC 2;text BELcorresponding toChange Window titleprotected voidprocessCursorDown(int count)Deprecated.processCSI n Bcorresponding toCUD – Cursor Downprotected voidprocessCursorLeft(int count)Deprecated.processCSI n Dcorresponding toCUB – Cursor Backprotected voidprocessCursorRight(int count)Deprecated.processCSI n Ccorresponding toCUF – Cursor Forwardprotected voidprocessCursorTo(int row, int col)Deprecated.processCSI n ; m Hcorresponding toCUP – Cursor PositionorCSI n ; m fcorresponding toHVP – Horizontal and Vertical Positionprotected voidprocessCursorToColumn(int x)Deprecated.processCSI n Gcorresponding toCHA – Cursor Horizontal Absoluteprotected voidprocessCursorUp(int count)Deprecated.processCSI n Acorresponding toCUU – Cursor Upprotected voidprocessDefaultBackgroundColor()Deprecated.processSGR 49corresponding toDefault background colorprotected voidprocessDefaultTextColor()Deprecated.processSGR 39corresponding toDefault text color (foreground)protected voidprocessDeleteLine(int optionInt)Deprecated.ProcessCSI MANSI code, corresponding toDL – Delete Lineprotected voidprocessEraseLine(int eraseOption)Deprecated.ProcessCSI n KANSI code, corresponding toED – Erase in Lineprotected voidprocessEraseScreen(int eraseOption)Deprecated.ProcessCSI n JANSI code, corresponding toED – Erase in Displayprotected voidprocessInsertLine(int optionInt)Deprecated.ProcessCSI LANSI code, corresponding toIL – Insert Lineprotected voidprocessRestoreCursorPosition()Deprecated.ProcessCSI uANSI code, corresponding toRCP – Restore Cursor Positionprotected voidprocessSaveCursorPosition()Deprecated.ProcessCSI sANSI code, corresponding toSCP – Save Cursor Positionprotected voidprocessSetAttribute(int attribute)Deprecated.processSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)protected voidprocessSetBackgroundColor(int color, boolean bright)Deprecated.processSGR 40-47orSGR 100-107corresponding toSet background coloreither in normal mode or high intensity.protected voidprocessSetForegroundColor(int color, boolean bright)Deprecated.processSGR 30-37orSGR 90-97corresponding toSet text color (foreground)either in normal mode or high intensity.-
Methods inherited from class org.fusesource.jansi.AnsiOutputStream
close, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processCursorDownLine, processCursorUpLine, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColorExt, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColorExt, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand, write
-
-
-
-
Field Detail
-
stdout_handle
private static final long stdout_handle
Deprecated.
-
stderr_handle
private static final long stderr_handle
Deprecated.
-
console
private final long console
Deprecated.
-
FOREGROUND_BLACK
private static final short FOREGROUND_BLACK
Deprecated.- See Also:
- Constant Field Values
-
FOREGROUND_YELLOW
private static final short FOREGROUND_YELLOW
Deprecated.
-
FOREGROUND_MAGENTA
private static final short FOREGROUND_MAGENTA
Deprecated.
-
FOREGROUND_CYAN
private static final short FOREGROUND_CYAN
Deprecated.
-
FOREGROUND_WHITE
private static final short FOREGROUND_WHITE
Deprecated.
-
BACKGROUND_BLACK
private static final short BACKGROUND_BLACK
Deprecated.- See Also:
- Constant Field Values
-
BACKGROUND_YELLOW
private static final short BACKGROUND_YELLOW
Deprecated.
-
BACKGROUND_MAGENTA
private static final short BACKGROUND_MAGENTA
Deprecated.
-
BACKGROUND_CYAN
private static final short BACKGROUND_CYAN
Deprecated.
-
BACKGROUND_WHITE
private static final short BACKGROUND_WHITE
Deprecated.
-
ANSI_FOREGROUND_COLOR_MAP
private static final short[] ANSI_FOREGROUND_COLOR_MAP
Deprecated.
-
ANSI_BACKGROUND_COLOR_MAP
private static final short[] ANSI_BACKGROUND_COLOR_MAP
Deprecated.
-
info
private final org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO info
Deprecated.
-
originalColors
private final short originalColors
Deprecated.
-
negative
private boolean negative
Deprecated.
-
savedX
private short savedX
Deprecated.
-
savedY
private short savedY
Deprecated.
-
-
Constructor Detail
-
WindowsAnsiOutputStream
public WindowsAnsiOutputStream(java.io.OutputStream os, boolean stdout) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
WindowsAnsiOutputStream
public WindowsAnsiOutputStream(java.io.OutputStream os) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
-
Method Detail
-
getConsoleInfo
private void getConsoleInfo() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
applyAttribute
private void applyAttribute() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
invertAttributeColors
private short invertAttributeColors(short attributes)
Deprecated.
-
applyCursorPosition
private void applyCursorPosition() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
processEraseScreen
protected void processEraseScreen(int eraseOption) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamProcessCSI n JANSI code, corresponding toED – Erase in Display- Overrides:
processEraseScreenin classAnsiOutputStream- Parameters:
eraseOption- eraseOption- Throws:
java.io.IOException- IOException
-
processEraseLine
protected void processEraseLine(int eraseOption) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamProcessCSI n KANSI code, corresponding toED – Erase in Line- Overrides:
processEraseLinein classAnsiOutputStream- Parameters:
eraseOption- eraseOption- Throws:
java.io.IOException- IOException
-
processCursorLeft
protected void processCursorLeft(int count) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessCSI n Dcorresponding toCUB – Cursor Back- Overrides:
processCursorLeftin classAnsiOutputStream- Parameters:
count- numer of characters to move left- Throws:
java.io.IOException- IOException
-
processCursorRight
protected void processCursorRight(int count) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessCSI n Ccorresponding toCUF – Cursor Forward- Overrides:
processCursorRightin classAnsiOutputStream- Parameters:
count- number of characters to move on- Throws:
java.io.IOException- IOException
-
processCursorDown
protected void processCursorDown(int count) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessCSI n Bcorresponding toCUD – Cursor Down- Overrides:
processCursorDownin classAnsiOutputStream- Parameters:
count- numer of line- Throws:
java.io.IOException- IOException
-
processCursorUp
protected void processCursorUp(int count) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessCSI n Acorresponding toCUU – Cursor Up- Overrides:
processCursorUpin classAnsiOutputStream- Parameters:
count- number of lines- Throws:
java.io.IOException- IOException
-
processCursorTo
protected void processCursorTo(int row, int col) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessCSI n ; m Hcorresponding toCUP – Cursor PositionorCSI n ; m fcorresponding toHVP – Horizontal and Vertical Position- Overrides:
processCursorToin classAnsiOutputStream- Parameters:
row- rowcol- column- Throws:
java.io.IOException- IOException
-
processCursorToColumn
protected void processCursorToColumn(int x) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessCSI n Gcorresponding toCHA – Cursor Horizontal Absolute- Overrides:
processCursorToColumnin classAnsiOutputStream- Parameters:
x- the column- Throws:
java.io.IOException- IOException
-
processSetForegroundColor
protected void processSetForegroundColor(int color, boolean bright) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessSGR 30-37orSGR 90-97corresponding toSet text color (foreground)either in normal mode or high intensity.- Overrides:
processSetForegroundColorin classAnsiOutputStream- Parameters:
color- the text colorbright- is high intensity?- Throws:
java.io.IOException- IOException
-
processSetBackgroundColor
protected void processSetBackgroundColor(int color, boolean bright) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessSGR 40-47orSGR 100-107corresponding toSet background coloreither in normal mode or high intensity.- Overrides:
processSetBackgroundColorin classAnsiOutputStream- Parameters:
color- the background colorbright- is high intensity?- Throws:
java.io.IOException- IOException
-
processDefaultTextColor
protected void processDefaultTextColor() throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessSGR 39corresponding toDefault text color (foreground)- Overrides:
processDefaultTextColorin classAnsiOutputStream- Throws:
java.io.IOException- IOException
-
processDefaultBackgroundColor
protected void processDefaultBackgroundColor() throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessSGR 49corresponding toDefault background color- Overrides:
processDefaultBackgroundColorin classAnsiOutputStream- Throws:
java.io.IOException- IOException
-
processAttributeRest
protected void processAttributeRest() throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessSGR 0corresponding toReset / Normal- Overrides:
processAttributeRestin classAnsiOutputStream- Throws:
java.io.IOException- IOException
-
processSetAttribute
protected void processSetAttribute(int attribute) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamprocessSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)- Overrides:
processSetAttributein classAnsiOutputStream- Parameters:
attribute- attribute- Throws:
java.io.IOException- IOException- See Also:
AnsiOutputStream.processAttributeRest(),AnsiOutputStream.processSetForegroundColor(int),AnsiOutputStream.processSetForegroundColor(int, boolean),AnsiOutputStream.processSetForegroundColorExt(int),AnsiOutputStream.processSetForegroundColorExt(int, int, int),AnsiOutputStream.processDefaultTextColor(),AnsiOutputStream.processDefaultBackgroundColor()
-
processSaveCursorPosition
protected void processSaveCursorPosition() throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamProcessCSI sANSI code, corresponding toSCP – Save Cursor Position- Overrides:
processSaveCursorPositionin classAnsiOutputStream- Throws:
java.io.IOException- IOException
-
processRestoreCursorPosition
protected void processRestoreCursorPosition() throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamProcessCSI uANSI code, corresponding toRCP – Restore Cursor Position- Overrides:
processRestoreCursorPositionin classAnsiOutputStream- Throws:
java.io.IOException- IOException
-
processInsertLine
protected void processInsertLine(int optionInt) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamProcessCSI LANSI code, corresponding toIL – Insert Line- Overrides:
processInsertLinein classAnsiOutputStream- Parameters:
optionInt- option- Throws:
java.io.IOException- IOException
-
processDeleteLine
protected void processDeleteLine(int optionInt) throws java.io.IOExceptionDeprecated.Description copied from class:AnsiOutputStreamProcessCSI MANSI code, corresponding toDL – Delete Line- Overrides:
processDeleteLinein classAnsiOutputStream- Parameters:
optionInt- option- Throws:
java.io.IOException- IOException
-
processChangeWindowTitle
protected void processChangeWindowTitle(java.lang.String label)
Deprecated.Description copied from class:AnsiOutputStreamprocessOSC 2;text BELcorresponding toChange Window title- Overrides:
processChangeWindowTitlein classAnsiOutputStream- Parameters:
label- window label
-
-