public abstract class VT100AbstractRenderer<T> extends java.lang.Object implements VT100Renderer
| Modifier and Type | Field and Description |
|---|---|
private boolean |
autoWrap
Auto wrap mode
|
protected int |
begScroll
Scroll window, starting position.
|
protected int |
col
Cursor column position.
|
protected int |
cols
Number of columns in the screen.
|
protected T[][] |
data
Screen contents.
|
protected int |
endScroll
Scroll window, ending position.
|
protected int |
row
Cursor row position.
|
protected int |
rows
Number of rows in the screen.
|
| Constructor and Description |
|---|
VT100AbstractRenderer(T[][] data,
int rows,
int cols,
int begScroll,
int endScroll)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
attributeMask(int id)
Get attribute mask.
|
abstract void |
beep()
Play a message beep.
|
private void |
clearRow(int rowIndex,
int begCol,
int endCol) |
private void |
clearScreen(int begRow,
int endRow)
Clear screen.
|
protected abstract T |
emptyCell()
Create an empty cell.
|
void |
eraseInDisplay(int mode)
Clear lines on screen.
|
void |
eraseInLine(int mode)
Clear characters in current line.
|
int |
getColumns()
Get number of columns.
|
int |
getCursorCol()
Get cursor current column position.
|
int |
getCursorRow()
Get cursor current row position.
|
void |
index()
IND -- Index ESC D
This sequence causes the active position to move downward one line without changing the
column position.
|
protected abstract T |
makeCell(char text,
int attribute,
int color)
Build a new video memory cell.
|
private void |
moveCursorNext()
Move cursor to the next position.
|
void |
moveCursorPos(int nRows,
int nCols)
Move cursor position with the amount of rows and columns.
|
void |
nextLine()
NEL -- Next Line ESC E
This sequence causes the active position to move to the first position on the next line
downward.
|
void |
reverseIndex()
RI -- Reverse Index ESC M
Move the active position to the same horizontal position on the preceding line.
|
private void |
scrollDown()
Scroll DOWN one line in scroll window.
|
private void |
scrollUp()
Scroll UP one line in scroll window.
|
void |
setAutoWrap(boolean autoWrap)
Set auto wrap mode.
|
void |
setCellText(char text,
int attribute,
int color)
Set cell text attributes and color.
|
void |
setCursorCol(int column)
Set cursor at column.
|
void |
setCursorPos(int row,
int col)
Set cursor position.
|
abstract void |
setCursorVisible(boolean showCursor)
Set cursor visibility.
|
void |
setScrollRegion(int begLine,
int endLine)
Set scroll window.
|
protected abstract void |
updateScreen()
Update screen.
|
protected int rows
protected int cols
protected int begScroll
protected int endScroll
protected int row
protected int col
protected T[][] data
private boolean autoWrap
public VT100AbstractRenderer(T[][] data, int rows, int cols, int begScroll, int endScroll)
data - Video buffer.rows - Number of rows on the screen.cols - Number of columns on the screen.begScroll - Scroll window, starting position.endScroll - Scroll window, ending position.public void setCursorPos(int row,
int col)
setCursorPos in interface VT100Rendererrow - Line number.col - Column number.public void moveCursorPos(int nRows,
int nCols)
moveCursorPos in interface VT100RenderernRows - Number of rows.nCols - Number of columns.public void eraseInDisplay(int mode)
eraseInDisplay in interface VT100Renderermode - An integer value representing a screen region:
0 - Erase from the active position to the end of the screen, inclusive (default)
1 - Erase from start of the screen to the active position, inclusive
2 - Erase all of the display -- all lines are erased, changed to single-width,
and the cursor does not move.public void eraseInLine(int mode)
eraseInLine in interface VT100Renderermode - An integer value representing a line region:
0 - Erase from the active position to the end of the line, inclusive (default)
1 - Erase from the start of the line to the active position, inclusive
2 - Erase all of the line, inclusivepublic void setCellText(char text,
int attribute,
int color)
setCellText in interface VT100Renderertext - Character that should be displayed.attribute - Cell attributes.color - Call color FG/BGpublic abstract void beep()
beep in interface VT100Rendererpublic void setCursorCol(int column)
setCursorCol in interface VT100Renderercolumn - Column number.public void nextLine()
nextLine in interface VT100Rendererpublic void index()
index in interface VT100Rendererpublic void reverseIndex()
reverseIndex in interface VT100Rendererpublic void setScrollRegion(int begLine,
int endLine)
setScrollRegion in interface VT100RendererbegLine - Start line.endLine - End line.public abstract void setCursorVisible(boolean showCursor)
setCursorVisible in interface VT100RenderershowCursor - public void setAutoWrap(boolean autoWrap)
setAutoWrap in interface VT100RendererautoWrap - public int getCursorRow()
getCursorRow in interface VT100Rendererpublic int getCursorCol()
getCursorCol in interface VT100Rendererpublic int getColumns()
getColumns in interface VT100Rendererpublic abstract int attributeMask(int id)
attributeMask in interface VT100Rendererid - Attribute id.
0 - NORMAL 1 - BLINK 2 - BOLD 3 - UNDERLINE 4 - REVERSE
protected abstract T emptyCell()
protected abstract T makeCell(char text, int attribute, int color)
text - Cell character.attribute - Color attributescolor - Color pair FG/BGprotected abstract void updateScreen()
private void moveCursorNext()
private void clearRow(int rowIndex,
int begCol,
int endCol)
rowIndex - Row number.begCol - Start column position.endCol - End column position.private void scrollUp()
private void scrollDown()
private void clearScreen(int begRow,
int endRow)
begRow - Start row number.endRow - End row number.