public interface OutputPrimitives
This interface holds vast majority of methods necessary for P2J to perform
user interaction. Particular implementation may use DriverPrimitives
class as a base and share most of the code required to implement this
interface.
Modifier and Type | Method and Description |
---|---|
void |
clearArea(int left,
int top,
int right,
int bottom,
Color color)
Clear specified area at the screen.
|
ScreenBitmap |
getScreenBitmap()
Get the screen bitmap for this output primitives implementation.
|
int |
getWindowId()
Get the ID of the window currently selected.
|
void |
refresh(NativeRectangle rect)
Refresh specified area.
|
int |
screenHeight()
Get height of the screen represented by this instance.
|
int |
screenWidth()
Get width of the screen represented by this instance.
|
void |
setScreenBitmap(ScreenBitmap bitmap)
Replace the current bitmap instance with this one.
|
void |
sync()
Synchronize screen.
|
void clearArea(int left, int top, int right, int bottom, Color color)
The driver-level implementation does not need to implement this method because it is never reaches the driver.
left
- Left coordinate of the area.top
- Top coordinate of the area.right
- Right coordinate of the area.bottom
- Bottom coordinate of the area.color
- Color.void refresh(NativeRectangle rect)
This method is used to refresh current state of the implementations which use buffering. For driver-level implementation this method should do nothing.
rect
- Area to refresh.int screenWidth()
Driver-level implementation of this method should return physical dimension of the screen used for user interaction. The dimension is expressed in characters.
int screenHeight()
Driver-level implementation of this method should return physical dimension of the screen used for user interaction. The dimension is expressed in characters.
void sync()
Driver level implementation of this method should force flushing internal low-level buffers to screen. This method requires implementation only if operating system or hardware uses internal buffering for the terminal output. Otherwise this method can do nothing.
ScreenBitmap getScreenBitmap()
This method is used by implementations which use internal buffering. The driver-level implementation does not need to implement this method because it is never reaches the driver.
void setScreenBitmap(ScreenBitmap bitmap)
This method is used by implementations which use internal buffering. The driver-level implementation does not need to implement this method because it is never reaches the driver.
bitmap
- The new bitmap instance.int getWindowId()