Class Display


  • public class Display
    extends java.lang.Object
    Handle display and visual cursor.
    Author:
    Guillaume Nodet
    • Field Detail

      • terminal

        protected final Terminal terminal
      • fullScreen

        protected final boolean fullScreen
      • cursorPos

        protected int cursorPos
      • columns

        protected int columns
      • columns1

        protected int columns1
      • rows

        protected int rows
      • reset

        protected boolean reset
      • delayLineWrap

        protected boolean delayLineWrap
      • canScroll

        protected final boolean canScroll
      • wrapAtEol

        protected final boolean wrapAtEol
      • delayedWrapAtEol

        protected final boolean delayedWrapAtEol
      • cursorDownIsNewLine

        protected final boolean cursorDownIsNewLine
    • Constructor Detail

      • Display

        public Display​(Terminal terminal,
                       boolean fullscreen)
    • Method Detail

      • delayLineWrap

        public boolean delayLineWrap()
        If cursor is at right margin, don't wrap immediately. See org.jline.reader.LineReader.Option#DELAY_LINE_WRAP.
        Returns:
        true if line wrap is delayed, false otherwise
      • setDelayLineWrap

        public void setDelayLineWrap​(boolean v)
      • resize

        public void resize​(int rows,
                           int columns)
      • reset

        public void reset()
      • clear

        public void clear()
        Clears the whole screen. Use this method only when using full-screen / application mode.
      • updateAnsi

        public void updateAnsi​(java.util.List<java.lang.String> newLines,
                               int targetCursorPos)
      • update

        public void update​(java.util.List<AttributedString> newLines,
                           int targetCursorPos)
        Update the display according to the new lines and flushes the output.
        Parameters:
        newLines - the lines to display
        targetCursorPos - desired cursor position - see Size.cursorPos.
      • update

        public void update​(java.util.List<AttributedString> newLines,
                           int targetCursorPos,
                           boolean flush)
        Update the display according to the new lines.
        Parameters:
        newLines - the lines to display
        targetCursorPos - desired cursor position - see Size.cursorPos.
        flush - whether the output should be flushed or not
      • deleteLines

        protected boolean deleteLines​(int nb)
      • insertLines

        protected boolean insertLines​(int nb)
      • insertChars

        protected boolean insertChars​(int nb)
      • deleteChars

        protected boolean deleteChars​(int nb)
      • moveVisualCursorTo

        protected void moveVisualCursorTo​(int targetPos,
                                          java.util.List<AttributedString> newLines)
      • moveVisualCursorTo

        protected int moveVisualCursorTo​(int i1)
      • wcwidth

        public int wcwidth​(java.lang.String str)