Package jexer.backend

Class 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.
    • 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.
    • 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 in
        input - 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 with
        windowHeight - the number of text rows to start with
        fontSize - 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 in
        input - 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 in
        input - 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 in
        input - 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 in
        input - 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.