public class TraceableTerminal extends BasePrimitives
| Modifier and Type | Field and Description |
|---|---|
private static CentralLogger |
LOG
Logger
|
(package private) BasePrimitives |
std
default plugin
|
cursorInvalid, EMPTY_CELL| Constructor and Description |
|---|
TraceableTerminal()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(int chr,
Color color)
Add a character to the virtual terminal at the current cursor position.
|
void |
append(java.lang.String str,
Color color)
Add a string to the virtual terminal at the current cursor position.
|
void |
box(int left,
int top,
int right,
int bottom,
Color color)
Draw a box using the specified dimensions and color pair.
|
Cell |
cellAt(int row,
int col)
Get character at specified position.
|
void |
clearArea(int left,
int top,
int right,
int bottom,
Color color)
Blank out a box using the specified attributes and color pair.
|
private void |
cp()
Prints cursor position.
|
boolean |
cursorAt(int x,
int y)
Position the virtual cursor during the drawing.
|
boolean |
cursorStay(int x,
int y)
Position the real cursor.
|
void |
drawHBorder(int col,
int row,
int width,
Color color)
Draw the upper or lower border.
|
void |
drawLLCorner(int col,
int row,
Color color)
Draw the lower-left border corner.
|
void |
drawLRCorner(int col,
int row,
Color color)
Draw the lower-right border corner.
|
void |
drawULCorner(int col,
int row,
Color color)
Draw the upper-left border corner.
|
void |
drawURCorner(int col,
int row,
Color color)
Draw the upper-right border corner.
|
void |
drawVBorder(int col,
int row,
int height,
Color color)
Draw the left or right border.
|
ScreenBitmap |
getScreenBitmap()
Get the screen bitmap for this output primitives implementation.
|
int |
getX()
Get absolute X position of the cursor.
|
int |
getY()
Get absolute Y position of the cursor.
|
boolean |
hasBoxBorderCorners()
Check if this output primitives implementation requires border corners
when drawing a box.
|
void |
hLine(int length,
Color color)
Draw a horizontal line of the specified length starting at the current
cursor position.
|
void |
refresh(NativeRectangle rect)
Mark a rectangle as needing repainting.
|
int |
screenHeight()
Gets the number of rows on the screen.
|
int |
screenWidth()
Gets the number of columns on the screen.
|
void |
setScreenBitmap(ScreenBitmap bitmap)
Replace the current bitmap instance with this one.
|
void |
sync()
Synchronize the state of the physical terminal with the state of
the virtual terminal.
|
private void |
tn(java.lang.String s)
Prints a string with new line.
|
void |
trace(boolean tracing)
Controls the tracing of the primitives.
|
void |
updateScreen(ScreenData screen)
Perform a bulk output operation for the whole screen at once with
output masking when desired.
|
void |
vLine(int length,
Color color)
Draw a vertical line of the specified length starting at the current
cursor position.
|
borderColor, getWindowId, isCursorInvalid, setCursorInvalid, widgetColorprivate static final CentralLogger LOG
BasePrimitives std
public void trace(boolean tracing)
tracing - true turns tracing onpublic void append(int chr,
Color color)
append in class BasePrimitiveschr - The character to output.color - Color.public void append(java.lang.String str,
Color color)
append in class BasePrimitivesstr - The text to output.color - Color.public void hLine(int length,
Color color)
hLine in class BasePrimitiveslength - The length of the line to draw in columns.color - Color.public void vLine(int length,
Color color)
vLine in class BasePrimitiveslength - The length of the line to draw in rows.color - Color.public void clearArea(int left,
int top,
int right,
int bottom,
Color color)
left - The left column of the rectangle.top - The top row of the rectangle.right - The right column of the rectangle.bottom - The bottom row of the rectangle.color - Color.public void box(int left,
int top,
int right,
int bottom,
Color color)
box in class BasePrimitivesleft - The left column of the rectangle.top - The top row of the rectangle.right - The right column of the rectangle.bottom - The bottom row of the rectangle.color - Color.public int getX()
getX in class BasePrimitivespublic int getY()
getY in class BasePrimitivespublic boolean cursorAt(int x,
int y)
cursorAt in class BasePrimitivesx - Cursor X coordinate.y - Cursor Y coordinate.true if cursor positioning succeeded.public boolean cursorStay(int x,
int y)
cursorStay in class BasePrimitivesx - Cursor X coordinate.y - Cursor Y coordinate.true if cursor positioning succeeded.public void refresh(NativeRectangle rect)
rect - rectangle to mark for repaintingpublic int screenWidth()
public int screenHeight()
public void sync()
private void tn(java.lang.String s)
s - string to printprivate void cp()
public ScreenBitmap getScreenBitmap()
public void setScreenBitmap(ScreenBitmap bitmap)
bitmap - The new bitmap instance.public void drawULCorner(int col,
int row,
Color color)
drawULCorner in class BasePrimitivescol - The column number where to draw.row - The row number where to draw.color - The number of the color-pair (foreground+background) to use
for blanking the rectangle.public void drawURCorner(int col,
int row,
Color color)
drawURCorner in class BasePrimitivescol - The column number where to draw.row - The row number where to draw.color - The number of the color-pair (foreground+background) to use
for blanking the rectangle.public void drawLLCorner(int col,
int row,
Color color)
drawLLCorner in class BasePrimitivescol - The column number where to draw.row - The row number where to draw.color - The number of the color-pair (foreground+background) to use
for blanking the rectangle.public void drawLRCorner(int col,
int row,
Color color)
drawLRCorner in class BasePrimitivescol - The column number where to draw.row - The row number where to draw.color - The number of the color-pair (foreground+background) to use
for blanking the rectangle.public void drawHBorder(int col,
int row,
int width,
Color color)
drawHBorder in class BasePrimitivescol - The column number where to draw.row - The row number where to draw.width - The border width.color - The number of the color-pair (foreground+background)public void drawVBorder(int col,
int row,
int height,
Color color)
drawVBorder in class BasePrimitivescol - The column number where to draw.row - The row number where to draw.height - The border height.color - The number of the color-pair (foreground+background)public boolean hasBoxBorderCorners()
hasBoxBorderCorners in class BasePrimitivestrue if the box should be drawn with border
corners.public Cell cellAt(int row, int col)
cellAt in class BasePrimitivesrow - Character row.col - Character column.public void updateScreen(ScreenData screen)
updateScreen in class BasePrimitivesscreen - Container for whole screen content and cursor position.