- java.lang.Object
-
- org.jline.utils.Display
-
public class Display extends Object
Handle display and visual cursor.- Author:
- Guillaume Nodet
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancanScrollprotected Map<InfoCmp.Capability,Integer>costprotected booleancursorDownIsNewLineprotected intcursorPosprotected booleandelayedWrapAtEolprotected booleandelayLineWrapprotected booleanfullScreenprotected List<AttributedString>oldLinesprotected booleanresetprotected introwsprotected Terminalterminalprotected booleanwrapAtEol
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancan(InfoCmp.Capability single, InfoCmp.Capability multi)voidclear()Clears the whole screen.booleandelayLineWrap()If cursor is at right margin, don't wrap immediately.protected booleandeleteChars(int nb)protected booleandeleteLines(int nb)protected booleaninsertChars(int nb)protected booleaninsertLines(int nb)protected intmoveVisualCursorTo(int i1)protected voidmoveVisualCursorTo(int targetPos, List<AttributedString> newLines)protected booleanperform(InfoCmp.Capability single, InfoCmp.Capability multi, int nb)voidreset()voidresize(int rows, int columns)voidsetDelayLineWrap(boolean v)voidupdate(List<AttributedString> newLines, int targetCursorPos)Update the display according to the new lines and flushes the output.voidupdate(List<AttributedString> newLines, int targetCursorPos, boolean flush)Update the display according to the new lines.voidupdateAnsi(List<String> newLines, int targetCursorPos)intwcwidth(String str)
-
-
-
Field Detail
-
terminal
protected final Terminal terminal
-
fullScreen
protected final boolean fullScreen
-
oldLines
protected List<AttributedString> oldLines
-
cursorPos
protected int cursorPos
-
rows
protected int rows
-
reset
protected boolean reset
-
delayLineWrap
protected boolean delayLineWrap
-
cost
protected final Map<InfoCmp.Capability,Integer> cost
-
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. Seeorg.jline.reader.LineReader.Option#DELAY_LINE_WRAP.- Returns:
trueif line wrap is delayed,falseotherwise
-
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.
-
update
public void update(List<AttributedString> newLines, int targetCursorPos)
Update the display according to the new lines and flushes the output.- Parameters:
newLines- the lines to displaytargetCursorPos- desired cursor position - see Size.cursorPos.
-
update
public void update(List<AttributedString> newLines, int targetCursorPos, boolean flush)
Update the display according to the new lines.- Parameters:
newLines- the lines to displaytargetCursorPos- 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)
-
can
protected boolean can(InfoCmp.Capability single, InfoCmp.Capability multi)
-
perform
protected boolean perform(InfoCmp.Capability single, InfoCmp.Capability multi, int nb)
-
moveVisualCursorTo
protected void moveVisualCursorTo(int targetPos, List<AttributedString> newLines)
-
moveVisualCursorTo
protected int moveVisualCursorTo(int i1)
-
wcwidth
public int wcwidth(String str)
-
-