com.mindbright.terminal
Class TerminalFrameTitle

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

public class TerminalFrameTitle
extends TerminalInputAdapter

A terminal listener which handles the title of the window and makes sure that the current size is always displayed therein (as [COLSxROWS]).

See Also:
TerminalWindow

Constructor Summary
TerminalFrameTitle(java.awt.Frame frame, java.lang.String titleName)
          Creates a new instance tied to a specified Frame and with a give starting title.
 
Method Summary
 void attach(TerminalWindow terminal)
          Attach this to the given terminal
 void detach()
          Detach from the terminal window
 void setTitleName(java.lang.String titleName)
          Set the title text.
 void signalWindowChanged(int rows, int cols, int vpixels, int hpixels)
          Called when the size of the terminal window has changed.
 
Methods inherited from class com.mindbright.terminal.TerminalInputAdapter
sendBreak, sendBytes, sendBytesDirect, signalTermTypeChanged, typedChar, typedChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminalFrameTitle

public TerminalFrameTitle(java.awt.Frame frame,
                          java.lang.String titleName)
Creates a new instance tied to a specified Frame and with a give starting title.

Parameters:
frame - the frame whose title should be updated
titleName - initial title
Method Detail

attach

public void attach(TerminalWindow terminal)
Attach this to the given terminal

Parameters:
terminal - terminal window to check for size changes

detach

public void detach()
Detach from the terminal window


setTitleName

public void setTitleName(java.lang.String titleName)
Set the title text.

Parameters:
titleName - title text

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
Overrides:
signalWindowChanged in class TerminalInputAdapter
Parameters:
rows - new number of rows
cols - new number of columns
vpixels - new number of vertical pixels
hpixels - new number of horizontal pixels