public class DisplayLine
extends java.lang.Object
Constructor and Description |
---|
DisplayLine(CellAttributes attr)
Public constructor sets everything to drawing attributes.
|
DisplayLine(DisplayLine line)
Public constructor makes a duplicate (deep copy).
|
Modifier and Type | Method and Description |
---|---|
Cell |
charAt(int idx)
Get the Cell at a specific column.
|
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 |
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.
|
public DisplayLine(DisplayLine line)
line
- the line to duplicatepublic DisplayLine(CellAttributes attr)
attr
- current drawing attributespublic Cell charAt(int idx)
idx
- the character indexpublic int length()
public boolean isDoubleWidth()
public void setDoubleWidth(boolean doubleWidth)
doubleWidth
- new value for double width flagpublic int getDoubleHeight()
public void setDoubleHeight(int doubleHeight)
doubleHeight
- new value for double height flagpublic boolean isReverseColor()
public void setReverseColor(boolean reverseColor)
reverseColor
- new value for reverse video flagpublic void insert(int idx, Cell newCell)
idx
- the character indexnewCell
- the new Cellpublic void replace(int idx, Cell newCell)
idx
- the character indexnewCell
- the new Cellpublic void setBlank(int idx)
idx
- the character indexpublic void setChar(int idx, int ch)
idx
- the character indexch
- the new charpublic void setAttr(int idx, CellAttributes attr)
idx
- the character indexattr
- the new attributespublic void delete(int idx, Cell newCell)
idx
- the character indexnewCell
- the new CellCopyright © 2019 Kevin Lamonte. Licensed MIT.