Package jexer.tterminal
Class DisplayLine
- java.lang.Object
-
- jexer.tterminal.DisplayLine
-
public class DisplayLine extends java.lang.ObjectThis represents a single line of the display buffer.
-
-
Constructor Summary
Constructors Constructor Description DisplayLine(CellAttributes attr)Public constructor sets everything to drawing attributes.DisplayLine(DisplayLine line)Public constructor makes a duplicate (deep copy).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CellcharAt(int idx)Get the Cell at a specific column.voidclearImages()Clear image data from line.voiddelete(int idx, Cell newCell)Delete character at the specified position, filling in the new character on the right with newCell.intgetDoubleHeight()Get double height flag.voidinsert(int idx, Cell newCell)Insert a character at the specified position.booleanisDoubleWidth()Get double width flag.booleanisImage()Determine if line contains image data.booleanisReverseColor()Get reverse video flag.intlength()Get the length of this line.voidreplace(int idx, Cell newCell)Replace character at the specified position.voidsetAttr(int idx, CellAttributes attr)Set the attributes (just the attributes, not the char) at the specified position to attr.voidsetBlank(int idx)Set the Cell at the specified position to the blank (reset).voidsetChar(int idx, int ch)Set the character (just the char, not the attributes) at the specified position to ch.voidsetDoubleHeight(int doubleHeight)Set double height flag.voidsetDoubleWidth(boolean doubleWidth)Set double width flag.voidsetReverseColor(boolean reverseColor)Set double-height flag.
-
-
-
Constructor Detail
-
DisplayLine
public DisplayLine(DisplayLine line)
Public constructor makes a duplicate (deep copy).- Parameters:
line- the line to duplicate
-
DisplayLine
public DisplayLine(CellAttributes attr)
Public constructor sets everything to drawing attributes.- Parameters:
attr- current drawing attributes
-
-
Method Detail
-
charAt
public Cell charAt(int idx)
Get the Cell at a specific column.- Parameters:
idx- the character index- Returns:
- the Cell
-
length
public int length()
Get the length of this line.- Returns:
- line length
-
isDoubleWidth
public boolean isDoubleWidth()
Get double width flag.- Returns:
- double width
-
setDoubleWidth
public void setDoubleWidth(boolean doubleWidth)
Set double width flag.- Parameters:
doubleWidth- new value for double width flag
-
getDoubleHeight
public int getDoubleHeight()
Get double height flag.- Returns:
- double height
-
setDoubleHeight
public void setDoubleHeight(int doubleHeight)
Set double height flag.- Parameters:
doubleHeight- new value for double height flag
-
isReverseColor
public boolean isReverseColor()
Get reverse video flag.- Returns:
- reverse video
-
setReverseColor
public void setReverseColor(boolean reverseColor)
Set double-height flag.- Parameters:
reverseColor- new value for reverse video flag
-
insert
public void insert(int idx, Cell newCell)Insert a character at the specified position.- Parameters:
idx- the character indexnewCell- the new Cell
-
replace
public void replace(int idx, Cell newCell)Replace character at the specified position.- Parameters:
idx- the character indexnewCell- the new Cell
-
setBlank
public void setBlank(int idx)
Set the Cell at the specified position to the blank (reset).- Parameters:
idx- the character index
-
setChar
public void setChar(int idx, int ch)Set the character (just the char, not the attributes) at the specified position to ch.- Parameters:
idx- the character indexch- the new char
-
setAttr
public void setAttr(int idx, CellAttributes attr)Set the attributes (just the attributes, not the char) at the specified position to attr.- Parameters:
idx- the character indexattr- the new attributes
-
delete
public void delete(int idx, Cell newCell)Delete character at the specified position, filling in the new character on the right with newCell.- Parameters:
idx- the character indexnewCell- the new Cell
-
isImage
public boolean isImage()
Determine if line contains image data.- Returns:
- true if the line has image data
-
clearImages
public void clearImages()
Clear image data from line.
-
-