Class WindowsAnsiOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public final class WindowsAnsiOutputStream
    extends AnsiOutputStream
    Deprecated.
    use WindowsAnsiPrintStream, which does not suffer from encoding issues
    A 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 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.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • WindowsAnsiOutputStream

        public WindowsAnsiOutputStream​(java.io.OutputStream os)
                                throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
    • Method Detail

      • getConsoleInfo

        private void getConsoleInfo()
                             throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • applyAttribute

        private void applyAttribute()
                             throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • invertAttributeColors

        private short invertAttributeColors​(short attributes)
        Deprecated.
      • applyCursorPosition

        private void applyCursorPosition()
                                  throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • processEraseScreen

        protected void processEraseScreen​(int eraseOption)
                                   throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        Process CSI n J ANSI code, corresponding to ED – Erase in Display
        Overrides:
        processEraseScreen in class AnsiOutputStream
        Parameters:
        eraseOption - eraseOption
        Throws:
        java.io.IOException - IOException
      • processEraseLine

        protected void processEraseLine​(int eraseOption)
                                 throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        Process CSI n K ANSI code, corresponding to ED – Erase in Line
        Overrides:
        processEraseLine in class AnsiOutputStream
        Parameters:
        eraseOption - eraseOption
        Throws:
        java.io.IOException - IOException
      • processCursorLeft

        protected void processCursorLeft​(int count)
                                  throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process CSI n D corresponding to CUB – Cursor Back
        Overrides:
        processCursorLeft in class AnsiOutputStream
        Parameters:
        count - numer of characters to move left
        Throws:
        java.io.IOException - IOException
      • processCursorRight

        protected void processCursorRight​(int count)
                                   throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process CSI n C corresponding to CUF – Cursor Forward
        Overrides:
        processCursorRight in class AnsiOutputStream
        Parameters:
        count - number of characters to move on
        Throws:
        java.io.IOException - IOException
      • processCursorDown

        protected void processCursorDown​(int count)
                                  throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process CSI n B corresponding to CUD – Cursor Down
        Overrides:
        processCursorDown in class AnsiOutputStream
        Parameters:
        count - numer of line
        Throws:
        java.io.IOException - IOException
      • processCursorUp

        protected void processCursorUp​(int count)
                                throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process CSI n A corresponding to CUU – Cursor Up
        Overrides:
        processCursorUp in class AnsiOutputStream
        Parameters:
        count - number of lines
        Throws:
        java.io.IOException - IOException
      • processCursorTo

        protected void processCursorTo​(int row,
                                       int col)
                                throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process CSI n ; m H corresponding to CUP – Cursor Position or CSI n ; m f corresponding to HVP – Horizontal and Vertical Position
        Overrides:
        processCursorTo in class AnsiOutputStream
        Parameters:
        row - row
        col - column
        Throws:
        java.io.IOException - IOException
      • processCursorToColumn

        protected void processCursorToColumn​(int x)
                                      throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process CSI n G corresponding to CHA – Cursor Horizontal Absolute
        Overrides:
        processCursorToColumn in class AnsiOutputStream
        Parameters:
        x - the column
        Throws:
        java.io.IOException - IOException
      • processSetForegroundColor

        protected void processSetForegroundColor​(int color,
                                                 boolean bright)
                                          throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process SGR 30-37 or SGR 90-97 corresponding to Set text color (foreground) either in normal mode or high intensity.
        Overrides:
        processSetForegroundColor in class AnsiOutputStream
        Parameters:
        color - the text color
        bright - is high intensity?
        Throws:
        java.io.IOException - IOException
      • processSetBackgroundColor

        protected void processSetBackgroundColor​(int color,
                                                 boolean bright)
                                          throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process SGR 40-47 or SGR 100-107 corresponding to Set background color either in normal mode or high intensity.
        Overrides:
        processSetBackgroundColor in class AnsiOutputStream
        Parameters:
        color - the background color
        bright - is high intensity?
        Throws:
        java.io.IOException - IOException
      • processDefaultTextColor

        protected void processDefaultTextColor()
                                        throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process SGR 39 corresponding to Default text color (foreground)
        Overrides:
        processDefaultTextColor in class AnsiOutputStream
        Throws:
        java.io.IOException - IOException
      • processDefaultBackgroundColor

        protected void processDefaultBackgroundColor()
                                              throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process SGR 49 corresponding to Default background color
        Overrides:
        processDefaultBackgroundColor in class AnsiOutputStream
        Throws:
        java.io.IOException - IOException
      • processAttributeRest

        protected void processAttributeRest()
                                     throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        process SGR 0 corresponding to Reset / Normal
        Overrides:
        processAttributeRest in class AnsiOutputStream
        Throws:
        java.io.IOException - IOException
      • processSaveCursorPosition

        protected void processSaveCursorPosition()
                                          throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        Process CSI s ANSI code, corresponding to SCP – Save Cursor Position
        Overrides:
        processSaveCursorPosition in class AnsiOutputStream
        Throws:
        java.io.IOException - IOException
      • processRestoreCursorPosition

        protected void processRestoreCursorPosition()
                                             throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        Process CSI u ANSI code, corresponding to RCP – Restore Cursor Position
        Overrides:
        processRestoreCursorPosition in class AnsiOutputStream
        Throws:
        java.io.IOException - IOException
      • processInsertLine

        protected void processInsertLine​(int optionInt)
                                  throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        Process CSI L ANSI code, corresponding to IL – Insert Line
        Overrides:
        processInsertLine in class AnsiOutputStream
        Parameters:
        optionInt - option
        Throws:
        java.io.IOException - IOException
      • processDeleteLine

        protected void processDeleteLine​(int optionInt)
                                  throws java.io.IOException
        Deprecated.
        Description copied from class: AnsiOutputStream
        Process CSI M ANSI code, corresponding to DL – Delete Line
        Overrides:
        processDeleteLine in class AnsiOutputStream
        Parameters:
        optionInt - option
        Throws:
        java.io.IOException - IOException
      • processChangeWindowTitle

        protected void processChangeWindowTitle​(java.lang.String label)
        Deprecated.
        Description copied from class: AnsiOutputStream
        process OSC 2;text BEL corresponding to Change Window title
        Overrides:
        processChangeWindowTitle in class AnsiOutputStream
        Parameters:
        label - window label