public class BatchPrimitives extends ConsolePrimitives
This implementation uses console-based null driver for terminal access. This means all i/o requests will produce the error messages and immediate stop for client application. There are two modes of functionality. If batch mode is active the primitives generate error otherwise the control is passing to the underlying console primitive handlers.
Modifier and Type | Field and Description |
---|---|
private boolean |
isActive
Flag indicating whether we need to do special processing or just ignore calls.
|
cursorInvalid, EMPTY_CELL
Constructor and Description |
---|
BatchPrimitives()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates special processing for batch mode.
|
void |
append(java.lang.String str,
Color color)
Add a string to the virtual terminal at the current cursor position.
|
boolean |
cursorAt(int x,
int y)
Position the virtual cursor during the drawing.
|
void |
deActivate()
Deactivates special processing for batch mode.
|
boolean |
isActive()
Check if the special internal processing for batch mode is active.
|
int |
screenHeight()
Gets the number of rows on the screen.
|
int |
screenWidth()
Gets the number of columns on the screen.
|
void |
sync()
Synchronize the state of the physical terminal with the state of
the virtual terminal.
|
void |
updateScreen(ScreenData screen)
Perform a bulk output operation for the whole screen at once with
output masking when desired.
|
cursorStay, getX, getY, init
append, borderColor, box, clearArea, drawHBorder, drawLLCorner, drawLRCorner, drawULCorner, drawURCorner, drawVBorder, getScreenBitmap, hLine, refresh, setScreenBitmap, vLine, widgetColor
cellAt, getWindowId, hasBoxBorderCorners, isCursorInvalid, setCursorInvalid
private boolean isActive
public void activate()
public void deActivate()
public boolean isActive()
true
if batch mode is active, false
otherwise.public boolean cursorAt(int x, int y)
cursorAt
in class ConsolePrimitives
x
- New cursor X.y
- New cursor Y.true
if cursor positioning succeeded.public void append(java.lang.String str, Color color)
append
in class ConsolePrimitives
str
- The text to output.color
- The Color instance used to draw characters. Mapping into native
colors is performed internally.public int screenHeight()
screenHeight
in interface OutputPrimitives
screenHeight
in class ConsolePrimitives
public int screenWidth()
screenWidth
in interface OutputPrimitives
screenWidth
in class ConsolePrimitives
public void sync()
sync
in interface OutputPrimitives
sync
in class ConsolePrimitives
public void updateScreen(ScreenData screen)
The screen container is safe for use with characters that are UNICODE
encoded which are also outside of the 7-bit ASCII range. Such
characters are passed through to the native layer directly and are
not converted to a natively encoded form. This could be provided
but since one of the primary uses of this method is for drawing
characters (e.g. ACS_HLINE
) which are encoded using the
full 32-bits, any attempt to convert these into a single byte native
encoding would lose data.
Because of the above limitation, DO NOT USE THIS FOR OUTPUT OF USER DATA THAT COULD CONTAIN DATA OUTSIDE OF THE 7-bit ASCII RANGE.
updateScreen
in class ConsolePrimitives
screen
- Container for whole screen content and cursor position.