Package jexer.backend
Class MultiBackend
- java.lang.Object
-
- jexer.backend.MultiBackend
-
-
Constructor Summary
Constructors Constructor Description MultiBackend(Backend backend)
Public constructor requires one backend.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBackend(Backend backend)
Add a backend to the list.void
addBackend(Backend backend, boolean readOnly)
Add a backend to the list.void
flushScreen()
Subclasses must provide an implementation that syncs the logical screen to the physical device.java.util.List<Backend>
getBackends()
Get the active backends.void
getEvents(java.util.List<TInputEvent> queue)
Subclasses must provide an implementation to get keyboard, mouse, and screen resize events.Screen
getScreen()
Getter for screen.SessionInfo
getSessionInfo()
Getter for sessionInfo.boolean
hasEvents()
Check if there are events in the queue.boolean
isImagesOverText()
Check if backend will support incomplete image fragments over text display.boolean
isPixelMouse()
Check if backend is reporting pixel-based mouse position.boolean
isReadOnly()
Check if backend is read-only.void
reloadOptions()
Reload backend options from System properties.void
removeBackend(Backend backend)
Remove a backend from the list.void
setListener(java.lang.Object listener)
Set listener to a different Object.void
setMouseStyle(java.lang.String mouseStyle)
Set the mouse pointer (cursor) style.void
setPixelMouse(boolean pixelMouse)
Set request for backend to report pixel-based mouse position.void
setReadOnly(boolean readOnly)
Set read-only flag.void
setTitle(java.lang.String title)
Subclasses must provide an implementation that sets the window title.void
shutdown()
Subclasses must provide an implementation that closes sockets, restores console, etc.
-
-
-
Constructor Detail
-
MultiBackend
public MultiBackend(Backend backend)
Public constructor requires one backend. Note that this backend's screen will be replaced with a MultiScreen.- Parameters:
backend
- the backend to add
-
-
Method Detail
-
getSessionInfo
public SessionInfo getSessionInfo()
Getter for sessionInfo.- Specified by:
getSessionInfo
in interfaceBackend
- Returns:
- the SessionInfo
-
getScreen
public Screen getScreen()
Getter for screen.
-
flushScreen
public void flushScreen()
Subclasses must provide an implementation that syncs the logical screen to the physical device.- Specified by:
flushScreen
in 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.
-
setTitle
public void setTitle(java.lang.String title)
Subclasses must provide an implementation that sets the window title.
-
setListener
public void setListener(java.lang.Object listener)
Set listener to a different Object.- Specified by:
setListener
in 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:
reloadOptions
in interfaceBackend
-
isImagesOverText
public boolean isImagesOverText()
Check if backend will support incomplete image fragments over text display.- Specified by:
isImagesOverText
in interfaceBackend
- Returns:
- true if images can partially obscure text
-
addBackend
public void addBackend(Backend backend)
Add a backend to the list.- Parameters:
backend
- the backend to add
-
addBackend
public void addBackend(Backend backend, boolean readOnly)
Add a backend to the list.- Parameters:
backend
- the backend to addreadOnly
- set the backend as read-only. If this would result in all backends begin read-only, it is ignored.
-
removeBackend
public void removeBackend(Backend backend)
Remove a backend from the list.- Parameters:
backend
- the backend to remove
-
getBackends
public java.util.List<Backend> getBackends()
Get the active backends.- Returns:
- the list of active (not headless) backends, including read-only backends
-
isReadOnly
public boolean isReadOnly()
Check if backend is read-only. For a MultiBackend, this is always false.- Specified by:
isReadOnly
in interfaceBackend
- Returns:
- false
-
setReadOnly
public void setReadOnly(boolean readOnly)
Set read-only flag. This does nothing for MultiBackend.- Specified by:
setReadOnly
in interfaceBackend
- Parameters:
readOnly
- ignored
-
isPixelMouse
public boolean isPixelMouse()
Check if backend is reporting pixel-based mouse position.- Specified by:
isPixelMouse
in 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:
setPixelMouse
in 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:
setMouseStyle
in interfaceBackend
- Parameters:
mouseStyle
- the pointer style string, one of: "default", "none", "hand", "text", "move", or "crosshair"
-
-