com.mindbright.terminal
Class TerminalInputAdapter

java.lang.Object
  extended by com.mindbright.terminal.TerminalInputAdapter
All Implemented Interfaces:
TerminalInputListener
Direct Known Subclasses:
TerminalFrameTitle

public class TerminalInputAdapter
extends java.lang.Object
implements TerminalInputListener

An abstract adapter class for receiving terminal input events. The methods in this class are empty. This class exists as convenience for creating listener objects.


Constructor Summary
TerminalInputAdapter()
           
 
Method Summary
 void sendBreak()
          Called when the user sends a break to the terminal
 void sendBytes(byte[] b)
          May be called when the user pastes data.
 void sendBytesDirect(byte[] b)
          Send some bytes directly to the host.
 void signalTermTypeChanged(java.lang.String newTermType)
          Called when the terminal type has changed.
 void signalWindowChanged(int rows, int cols, int vpixels, int hpixels)
          Called when the size of the terminal window has changed.
 void typedChar(byte[] b)
          Called when the user types a character
 void typedChar(char c)
          Called when the user types a character
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminalInputAdapter

public TerminalInputAdapter()
Method Detail

typedChar

public void typedChar(char c)
Description copied from interface: TerminalInputListener
Called when the user types a character

Specified by:
typedChar in interface TerminalInputListener
Parameters:
c - typed character

typedChar

public void typedChar(byte[] b)
Description copied from interface: TerminalInputListener
Called when the user types a character

Specified by:
typedChar in interface TerminalInputListener
Parameters:
b - byte code representation fo the character encoded in the current encoding.

sendBytes

public void sendBytes(byte[] b)
Description copied from interface: TerminalInputListener
May be called when the user pastes data. It may also be called by some external entity whishing to simulate multiple key presses.

Specified by:
sendBytes in interface TerminalInputListener
Parameters:
b - array of bytes representing characters to input

sendBytesDirect

public void sendBytesDirect(byte[] b)
Description copied from interface: TerminalInputListener
Send some bytes directly to the host. This does not echo the characters and bypasses any line buffering. This is typically used when replying to some query from the host.

Specified by:
sendBytesDirect in interface TerminalInputListener
Parameters:
b - array of bytes representing characters to send

signalWindowChanged

public void signalWindowChanged(int rows,
                                int cols,
                                int vpixels,
                                int hpixels)
Description copied from interface: TerminalInputListener
Called when the size of the terminal window has changed.

Specified by:
signalWindowChanged in interface TerminalInputListener
Parameters:
rows - new number of rows
cols - new number of columns
vpixels - new number of vertical pixels
hpixels - new number of horizontal pixels

signalTermTypeChanged

public void signalTermTypeChanged(java.lang.String newTermType)
Description copied from interface: TerminalInputListener
Called when the terminal type has changed. That is when the user has changed which terminal type this terminal window should emulate.

Specified by:
signalTermTypeChanged in interface TerminalInputListener
Parameters:
newTermType - new terminal type to emulate

sendBreak

public void sendBreak()
Description copied from interface: TerminalInputListener
Called when the user sends a break to the terminal

Specified by:
sendBreak in interface TerminalInputListener