Package jexer.backend
Class HeadlessBackend
- java.lang.Object
-
- jexer.backend.LogicalScreen
-
- jexer.backend.HeadlessBackend
-
public class HeadlessBackend extends LogicalScreen implements Backend
HeadlessBackend
-
-
Field Summary
-
Fields inherited from class jexer.backend.LogicalScreen
cursorVisible, cursorX, cursorY, height, logical, physical, reallyCleared, width
-
-
Constructor Summary
Constructors Constructor Description HeadlessBackend()Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ColorattrToBackgroundColor(CellAttributes attr)Convert a CellAttributes background color to an AWT Color.java.awt.ColorattrToForegroundColor(CellAttributes attr)Convert a CellAttributes foreground color to an AWT Color.voidflushScreen()Subclasses must provide an implementation that syncs the logical screen to the physical device.voidgetEvents(java.util.List<TInputEvent> queue)Subclasses must provide an implementation to get keyboard, mouse, and screen resize events.ScreengetScreen()Get a Screen, which displays the text cells to the user.SessionInfogetSessionInfo()Getter for sessionInfo.booleanhasEvents()Check if there are events in the queue.booleanisImagesOverText()Check if backend will support incomplete image fragments over text display.booleanisPixelMouse()Check if backend is reporting pixel-based mouse position.booleanisReadOnly()Check if backend is read-only.voidreloadOptions()Reload backend options from System properties.voidsetListener(java.lang.Object listener)Set listener to a different Object.voidsetMouseStyle(java.lang.String mouseStyle)Set the mouse pointer (cursor) style.voidsetPixelMouse(boolean pixelMouse)Set request for backend to report pixel-based mouse position.voidsetReadOnly(boolean readOnly)Set read-only flag.voidshutdown()Subclasses must provide an implementation that closes sockets, restores console, etc.-
Methods inherited from class jexer.backend.LogicalScreen
blendRectangle, blendScreen, clear, clearPhysical, copyScreen, copyScreen, copySelection, drawBox, drawBox, drawBoxShadow, flushPhysical, getAttrXY, getBackend, getCharXY, getCharXY, getClipBottom, getClipLeft, getClipRight, getClipTop, getCursorX, getCursorY, getHeight, getOffsetX, getOffsetY, getTextHeight, getTextWidth, getWidth, hideCursor, hLineXY, hLineXY, invertCell, invertCell, isCursorVisible, isDirty, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putCursor, putFullwidthCharXY, putFullwidthCharXY, putFullwidthCharXY, putStringXY, putStringXY, reset, resetClipping, resizeToScreen, setBackend, setClipBottom, setClipLeft, setClipRight, setClipTop, setDimensions, setHeight, setOffsetX, setOffsetY, setSelection, setTitle, setWidth, snapshot, snapshot, snapshotPhysical, unsetImageRow, vLineXY, vLineXY
-
-
-
-
Method Detail
-
getSessionInfo
public final SessionInfo getSessionInfo()
Getter for sessionInfo.- Specified by:
getSessionInfoin interfaceBackend- Returns:
- the SessionInfo
-
getScreen
public Screen getScreen()
Get a Screen, which displays the text cells to the user.
-
flushScreen
public void flushScreen()
Subclasses must provide an implementation that syncs the logical screen to the physical device.- Specified by:
flushScreenin interfaceBackend
-
hasEvents
public boolean hasEvents()
Check if there are events in the queue.
-
getEvents
public void getEvents(java.util.List<TInputEvent> queue)
Subclasses must provide an implementation to get keyboard, mouse, and screen resize events.
-
shutdown
public void shutdown()
Subclasses must provide an implementation that closes sockets, restores console, etc.
-
setListener
public void setListener(java.lang.Object listener)
Set listener to a different Object.- Specified by:
setListenerin interfaceBackend- Parameters:
listener- the new listening object that run() wakes up on new input
-
reloadOptions
public void reloadOptions()
Reload backend options from System properties.- Specified by:
reloadOptionsin interfaceBackend
-
isReadOnly
public boolean isReadOnly()
Check if backend is read-only. For a HeadlessBackend, this is always false.- Specified by:
isReadOnlyin interfaceBackend- Returns:
- true
-
setReadOnly
public void setReadOnly(boolean readOnly)
Set read-only flag. This does nothing for HeadlessBackend.- Specified by:
setReadOnlyin interfaceBackend- Parameters:
readOnly- ignored
-
isImagesOverText
public boolean isImagesOverText()
Check if backend will support incomplete image fragments over text display.- Specified by:
isImagesOverTextin interfaceBackend- Returns:
- true if images can partially obscure text
-
isPixelMouse
public boolean isPixelMouse()
Check if backend is reporting pixel-based mouse position.- Specified by:
isPixelMousein interfaceBackend- Returns:
- true if single-pixel mouse movements are reported
-
setPixelMouse
public void setPixelMouse(boolean pixelMouse)
Set request for backend to report pixel-based mouse position.- Specified by:
setPixelMousein interfaceBackend- Parameters:
pixelMouse- if true, single-pixel mouse movements will be reported, if the backend supports it
-
setMouseStyle
public void setMouseStyle(java.lang.String mouseStyle)
Set the mouse pointer (cursor) style.- Specified by:
setMouseStylein interfaceBackend- Parameters:
mouseStyle- the pointer style string, one of: "default", "none", "hand", "text", "move", or "crosshair"
-
attrToForegroundColor
public java.awt.Color attrToForegroundColor(CellAttributes attr)
Convert a CellAttributes foreground color to an AWT Color.- Specified by:
attrToForegroundColorin interfaceBackend- Parameters:
attr- the text attributes- Returns:
- the AWT Color
-
attrToBackgroundColor
public java.awt.Color attrToBackgroundColor(CellAttributes attr)
Convert a CellAttributes background color to an AWT Color.- Specified by:
attrToBackgroundColorin interfaceBackend- Parameters:
attr- the text attributes- Returns:
- the AWT Color
-
-