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 | Class and Description |
|---|---|
static interface |
BatchPrimitives.OutputWriter
Interface to define how
BatchPrimitives writes output. |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isActive
Flag indicating whether we need to do special processing or just ignore calls.
|
private BatchPrimitives.OutputWriter |
outputWriter
Defines the writer for displaying messages.
|
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 |
setOutputWriter(BatchPrimitives.OutputWriter outputWriter)
Sets the writer for output.
|
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, initappend, borderColor, box, clearArea, drawHBorder, drawLLCorner, drawLRCorner, drawULCorner, drawURCorner, drawVBorder, getScreenBitmap, hLine, refresh, setScreenBitmap, vLine, widgetColorcellAt, getWindowId, hasBoxBorderCorners, isCursorInvalid, setCursorInvalidprivate boolean isActive
private BatchPrimitives.OutputWriter outputWriter
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 ConsolePrimitivesx - New cursor X.y - New cursor Y.true if cursor positioning succeeded.public void append(java.lang.String str,
Color color)
append in class ConsolePrimitivesstr - 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 OutputPrimitivesscreenHeight in class ConsolePrimitivespublic int screenWidth()
screenWidth in interface OutputPrimitivesscreenWidth in class ConsolePrimitivespublic void sync()
sync in interface OutputPrimitivessync in class ConsolePrimitivespublic 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 ConsolePrimitivesscreen - Container for whole screen content and cursor position.public void setOutputWriter(BatchPrimitives.OutputWriter outputWriter)
outputWriter - Writer for output that implements BatchPrimitives.OutputWriter interface.