Class Console

    • Field Detail

      • DEFAULT_WIDTH

        public static int DEFAULT_WIDTH
      • DEFAULT_HEIGHT

        public static int DEFAULT_HEIGHT
    • Method Detail

      • create

        public static Console create()
        Factory to return the correct implementation of console.
        Returns:
        a new console object
      • readLine

        public String readLine()
      • read

        public abstract int read()
        Returns the next character from input stream of the console. In some cases check for ALT key pressed and return character + 1000, see JLine ConsoleReader In case of error a value lesser 0 will be returned.
        Returns:
        pressed key
      • cr

        public void cr()
      • isSupportSize

        public abstract boolean isSupportSize()
        Return true if the console knows about the current size of the terminal.
        Returns:
        True if support size
      • getWidth

        public abstract int getWidth()
      • getHeight

        public abstract int getHeight()
      • isSupportCursor

        public abstract boolean isSupportCursor()
      • setCursor

        public abstract void setCursor​(int x,
                                       int y)
      • getCursorX

        public abstract int getCursorX()
      • getCursorY

        public abstract int getCursorY()
      • isSupportColor

        public abstract boolean isSupportColor()
      • getForegroundColor

        public abstract Console.COLOR getForegroundColor()
      • getBackgroundColor

        public abstract Console.COLOR getBackgroundColor()
      • isSupportBlink

        public abstract boolean isSupportBlink()
      • setBlink

        public abstract void setBlink​(boolean blink)
      • isBlink

        public abstract boolean isBlink()
      • isSupportBold

        public abstract boolean isSupportBold()
      • setBold

        public abstract void setBold​(boolean bold)
      • isBold

        public abstract boolean isBold()
      • cleanup

        public abstract void cleanup()
      • printLine

        public void printLine()
      • adaptTo

        public <T> T adaptTo​(Class<? extends T> clazz)
      • printLine

        public void printLine​(char c)
      • resetTerminal

        public void resetTerminal()
      • resetConsole

        public static void resetConsole()
      • get

        public static Console get()
      • set

        public static void set​(Console console)
      • isInitialized

        public boolean isInitialized()
      • isAnsi

        public boolean isAnsi()
      • setWidth

        public void setWidth​(int w)
      • setHeight

        public void setHeight​(int h)
      • askQuestion

        public static char askQuestion​(String question,
                                       char[] answers,
                                       boolean toLower,
                                       boolean acceptEnter)
                                throws IOException
        Throws:
        IOException