com.sshtools.terminal.swing
Class SwingComponentTerminalComponentAdapter

java.lang.Object
  extended bycom.sshtools.terminal.swing.SwingComponentTerminalComponentAdapter
All Implemented Interfaces:
TerminalComponent

public class SwingComponentTerminalComponentAdapter
extends java.lang.Object
implements TerminalComponent

Implementation of a TerminalComponent that wraps a Swing component so it can be added to a Terminal.

This could be used for example to add a JLabel to a terminal displaying some text

AWTComponentTerminalComponentAdapter adapter = new AWTComponentTerminalComponentAdapter( new JLabel("Your are currently connected to foo.3sp.com")); terminal.addTerminalComponent(adapter, BorderLayout.NORTH, 0);

Version:
$Revision: 1.1 $
Author:
$Author: richard $

Constructor Summary
SwingComponentTerminalComponentAdapter(javax.swing.JComponent component)
          Construct a new SwingComponentTerminalComponentAdapter given a Component to wrap
 
Method Summary
 java.awt.Component getComponent()
          Return the AWT / Swing component this terminal component provides.
 Terminal getTerminalDisplay()
          Return the TerminalDisplay this componet has been added to.
 void init(Terminal display)
          Invoked when the terminal adds the component to its UI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingComponentTerminalComponentAdapter

public SwingComponentTerminalComponentAdapter(javax.swing.JComponent component)
Construct a new SwingComponentTerminalComponentAdapter given a Component to wrap

Parameters:
component -
Method Detail

init

public void init(Terminal display)
Description copied from interface: TerminalComponent
Invoked when the terminal adds the component to its UI.

Specified by:
init in interface TerminalComponent
Parameters:
display - display implementation

getTerminalDisplay

public Terminal getTerminalDisplay()
Description copied from interface: TerminalComponent
Return the TerminalDisplay this componet has been added to. Before init(TerminalDisplay) is called this method should return null.

Specified by:
getTerminalDisplay in interface TerminalComponent
Returns:
terminal display

getComponent

public java.awt.Component getComponent()
Description copied from interface: TerminalComponent
Return the AWT / Swing component this terminal component provides. If the terminal component is not visual it will just return null

Specified by:
getComponent in interface TerminalComponent
Returns:
component


Copyright © 2003-2004 3SP LTD. All Rights Reserved.