Package org.jline.utils
Class Display
java.lang.Object
org.jline.utils.Display
Handle display and visual cursor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean
private int
private int
protected final Map<InfoCmp.Capability,
Integer> protected final boolean
protected int
protected final boolean
protected boolean
protected final boolean
protected List<AttributedString>
protected boolean
protected int
protected final Terminal
protected final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
can
(InfoCmp.Capability single, InfoCmp.Capability multi) void
clear()
Clears the whole screen.private int
private int
cost
(InfoCmp.Capability cap) boolean
If cursor is at right margin, don't wrap immediately.protected boolean
deleteChars
(int nb) protected boolean
deleteLines
(int nb) protected boolean
insertChars
(int nb) protected boolean
insertLines
(int nb) private static int[]
longestCommon
(List<AttributedString> l1, List<AttributedString> l2) protected int
moveVisualCursorTo
(int i1) protected void
moveVisualCursorTo
(int targetPos, List<AttributedString> newLines) protected boolean
perform
(InfoCmp.Capability single, InfoCmp.Capability multi, int nb) (package private) void
rawPrint
(char c, int num) (package private) void
rawPrint
(int c) (package private) void
rawPrint
(AttributedString str) void
reset()
void
resize
(int rows, int columns) void
setDelayLineWrap
(boolean v) void
update
(List<AttributedString> newLines, int targetCursorPos) Update the display according to the new lines and flushes the output.void
update
(List<AttributedString> newLines, int targetCursorPos, boolean flush) Update the display according to the new lines.void
updateAnsi
(List<String> newLines, int targetCursorPos) int
-
Field Details
-
terminal
-
fullScreen
protected final boolean fullScreen -
oldLines
-
cursorPos
protected int cursorPos -
columns
private int columns -
columns1
private int columns1 -
rows
protected int rows -
reset
protected boolean reset -
delayLineWrap
protected boolean delayLineWrap -
cost
-
canScroll
protected final boolean canScroll -
wrapAtEol
protected final boolean wrapAtEol -
delayedWrapAtEol
protected final boolean delayedWrapAtEol -
cursorDownIsNewLine
protected final boolean cursorDownIsNewLine
-
-
Constructor Details
-
Display
-
-
Method Details
-
delayLineWrap
public boolean delayLineWrap()If cursor is at right margin, don't wrap immediately. Seeorg.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
-
update
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
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
-
perform
-
cost
-
computeCost
-
longestCommon
-
moveVisualCursorTo
-
moveVisualCursorTo
protected int moveVisualCursorTo(int i1) -
rawPrint
void rawPrint(char c, int num) -
rawPrint
void rawPrint(int c) -
rawPrint
-
wcwidth
-