Package jexer.backend
Class ECMA48Backend
- java.lang.Object
-
- jexer.backend.GenericBackend
-
- jexer.backend.ECMA48Backend
-
- All Implemented Interfaces:
Backend
public class ECMA48Backend extends GenericBackend
This class uses an xterm/ANSI X3.64/ECMA-48 type terminal to provide a screen, keyboard, and mouse to TApplication.
-
-
Field Summary
-
Fields inherited from class jexer.backend.GenericBackend
lastUserInputTime, readOnly, screen, sessionInfo, terminal
-
-
Constructor Summary
Constructors Constructor Description ECMA48Backend()
Public constructor will use System.in and System.out and UTF-8 encoding.ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output)
Public constructor.ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output, boolean readOnly)
Public constructor.ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output, int windowWidth, int windowHeight, int fontSize)
Public constructor.ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer)
Public constructor.ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer, boolean setRawMode)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isImagesOverText()
Check if backend will support incomplete image fragments over text display.boolean
isPixelMouse()
Check if backend is reporting pixel-based mouse position.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.-
Methods inherited from class jexer.backend.GenericBackend
flushScreen, getEvents, getScreen, getSessionInfo, hasEvents, isReadOnly, reloadOptions, setListener, setReadOnly, setTitle, shutdown
-
-
-
-
Constructor Detail
-
ECMA48Backend
public ECMA48Backend() throws java.io.UnsupportedEncodingException
Public constructor will use System.in and System.out and UTF-8 encoding. On non-Windows systems System.in will be put in raw mode; shutdown() will (blindly!) put System.in in cooked mode.- Throws:
java.io.UnsupportedEncodingException
- if an exception is thrown when creating the InputStreamReader
-
ECMA48Backend
public ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output, int windowWidth, int windowHeight, int fontSize) throws java.io.UnsupportedEncodingException
Public constructor.- Parameters:
listener
- the object this backend needs to wake up when new input comes ininput
- an InputStream connected to the remote user, or null for System.in. If System.in is used, then on non-Windows systems it will be put in raw mode; shutdown() will (blindly!) put System.in in cooked mode. input is always converted to a Reader with UTF-8 encoding.output
- an OutputStream connected to the remote user, or null for System.out. output is always converted to a Writer with UTF-8 encoding.windowWidth
- the number of text columns to start withwindowHeight
- the number of text rows to start withfontSize
- the size in points. ECMA48 cannot set it, but it is here to match the Swing API.- Throws:
java.io.UnsupportedEncodingException
- if an exception is thrown when creating the InputStreamReader
-
ECMA48Backend
public ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output) throws java.io.UnsupportedEncodingException
Public constructor.- Parameters:
listener
- the object this backend needs to wake up when new input comes ininput
- an InputStream connected to the remote user, or null for System.in. If System.in is used, then on non-Windows systems it will be put in raw mode; shutdown() will (blindly!) put System.in in cooked mode. input is always converted to a Reader with UTF-8 encoding.output
- an OutputStream connected to the remote user, or null for System.out. output is always converted to a Writer with UTF-8 encoding.- Throws:
java.io.UnsupportedEncodingException
- if an exception is thrown when creating the InputStreamReader
-
ECMA48Backend
public ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output, boolean readOnly) throws java.io.UnsupportedEncodingException
Public constructor.- Parameters:
listener
- the object this backend needs to wake up when new input comes ininput
- an InputStream connected to the remote user, or null for System.in. If System.in is used, then on non-Windows systems it will be put in raw mode; shutdown() will (blindly!) put System.in in cooked mode. input is always converted to a Reader with UTF-8 encoding.output
- an OutputStream connected to the remote user, or null for System.out. output is always converted to a Writer with UTF-8 encoding.readOnly
- if true, start this backend as read-only- Throws:
java.io.UnsupportedEncodingException
- if an exception is thrown when creating the InputStreamReader
-
ECMA48Backend
public ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer, boolean setRawMode)
Public constructor.- Parameters:
listener
- the object this backend needs to wake up when new input comes ininput
- the InputStream underlying 'reader'. Its available() method is used to determine if reader.read() will block or not.reader
- a Reader connected to the remote user.writer
- a PrintWriter connected to the remote user.setRawMode
- if true, set System.in into raw mode with stty. This should in general not be used. It is here solely for Demo3, which uses System.in.- Throws:
java.lang.IllegalArgumentException
- if input, reader, or writer are null.
-
ECMA48Backend
public ECMA48Backend(java.lang.Object listener, java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer)
Public constructor.- Parameters:
listener
- the object this backend needs to wake up when new input comes ininput
- the InputStream underlying 'reader'. Its available() method is used to determine if reader.read() will block or not.reader
- a Reader connected to the remote user.writer
- a PrintWriter connected to the remote user.- Throws:
java.lang.IllegalArgumentException
- if input, reader, or writer are null.
-
-
Method Detail
-
isImagesOverText
public boolean isImagesOverText()
Check if backend will support incomplete image fragments over text display.- Specified by:
isImagesOverText
in interfaceBackend
- Overrides:
isImagesOverText
in classGenericBackend
- Returns:
- true if images can partially obscure text
-
isPixelMouse
public boolean isPixelMouse()
Check if backend is reporting pixel-based mouse position.- Specified by:
isPixelMouse
in interfaceBackend
- Overrides:
isPixelMouse
in classGenericBackend
- 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
- Overrides:
setPixelMouse
in classGenericBackend
- 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
- Overrides:
setMouseStyle
in classGenericBackend
- Parameters:
mouseStyle
- the pointer style string, one of: "default", "none", "hand", "text", "move", or "crosshair"
-
-