Package jexer.tterminal
Class DisplayLine
- java.lang.Object
-
- jexer.tterminal.DisplayLine
-
public class DisplayLine extends java.lang.Object
This 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 Cell
charAt(int idx)
Get the Cell at a specific column.void
clearImages()
Clear image data from line.void
delete(int idx, Cell newCell)
Delete character at the specified position, filling in the new character on the right with newCell.int
getDoubleHeight()
Get double height flag.void
insert(int idx, Cell newCell)
Insert a character at the specified position.boolean
isDoubleWidth()
Get double width flag.boolean
isImage()
Determine if line contains image data.boolean
isReverseColor()
Get reverse video flag.int
length()
Get the length of this line.void
replace(int idx, Cell newCell)
Replace character at the specified position.void
setAttr(int idx, CellAttributes attr)
Set the attributes (just the attributes, not the char) at the specified position to attr.void
setBlank(int idx)
Set the Cell at the specified position to the blank (reset).void
setChar(int idx, int ch)
Set the character (just the char, not the attributes) at the specified position to ch.void
setDoubleHeight(int doubleHeight)
Set double height flag.void
setDoubleWidth(boolean doubleWidth)
Set double width flag.void
setReverseColor(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.
-
-