com.sshtools.terminal.swing
Class SwingTerminal

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.sshtools.terminal.swing.SwingTerminal
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, Terminal, VirtualSessionManager

public class SwingTerminal
extends javax.swing.JPanel
implements Terminal

Version:
$Revision: 1.1 $
Author:
Lee David Painter
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ClosableTabbedPane tabs
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SwingTerminal()
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Add a listener of ActionEvents fired when the use clicks on the close icon on the tab header.
protected  void addImpl(VirtualSession session)
           
 void addTerminalComponent(TerminalComponent component, java.lang.String position, int ring)
          Add a component to this terminal.
 void addVirtualSession(VirtualSession vt)
          Add a new VirtualSession to this manager.
 void addVirtualSessionManagerListener(VirtualSessionManagerListener listener)
          Add a VirtualSessionManagerListener to the list that should receive events about changes in the state of the virtual sessions managed by this virtual session manager.
protected  void fireAdded(VirtualSession session)
           
protected  void fireChanged(VirtualSession session)
           
protected  void fireDeselected(VirtualSession session)
           
protected  void fireRemoved(VirtualSession session)
           
protected  void fireSelected(VirtualSession session)
           
 int getRingCount()
          This terminal implementation allows components to be added to one panel in a "ring" of nested panels each with a border layout and the child panel being in the center.
 VirtualSession getSelectedVirtualSession()
          Return the currently selected virtual session
 int getSelectedVirtualSessionIndex()
          Return the currently selected virtual index
 VirtualSession getVirtualSession(int i)
          Return the virtual session at the specified index
 int getVirtualSessionCount()
          Return the number of virtual sessions.
 boolean isHideSingleTabHeading()
          Get whether a single virtual terminal tab header should be hidden until more virtual terminals are added.
 void removeActionListener(java.awt.event.ActionListener l)
          Remove a listener of ActionEvents fired when the use clicks on the close icon on the tab header.
 void removeVirtualSession(VirtualSession vt)
          Remove a VirtualSession from this terminal
 void removeVirtualSessionManagerListener(VirtualSessionManagerListener listener)
          Removes a VirtualSessionManagerListener from the list that should receive events about changes in the state of the virtual sessions managed by this virtual session manager.
 void setHideSingleTabHeading(boolean hideSingleTabHeading)
          Set whether a single virtual terminal tab header should be hidden until more virtual terminals are added.
 void setSelectedVirtualSession(VirtualSession vt)
          Make the provided virtual session the selected one
protected  void tabSelected(VirtualSession session)
           
 java.util.Enumeration virtualSessions()
          Return an enumeration of virtual sessions
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tabs

protected ClosableTabbedPane tabs
Constructor Detail

SwingTerminal

public SwingTerminal()
Method Detail

setHideSingleTabHeading

public void setHideSingleTabHeading(boolean hideSingleTabHeading)
Set whether a single virtual terminal tab header should be hidden until more virtual terminals are added. By default this is false


isHideSingleTabHeading

public boolean isHideSingleTabHeading()
Get whether a single virtual terminal tab header should be hidden until more virtual terminals are added. By default this is false

Returns:
hide a single tabs heading

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Add a listener of ActionEvents fired when the use clicks on the close icon on the tab header.

Parameters:
l - listener to add

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Remove a listener of ActionEvents fired when the use clicks on the close icon on the tab header.

Parameters:
l - listener to add

setSelectedVirtualSession

public void setSelectedVirtualSession(VirtualSession vt)
Description copied from interface: VirtualSessionManager
Make the provided virtual session the selected one

Specified by:
setSelectedVirtualSession in interface VirtualSessionManager
Parameters:
vt - virtual session to select

addVirtualSessionManagerListener

public void addVirtualSessionManagerListener(VirtualSessionManagerListener listener)
Description copied from interface: VirtualSessionManager
Add a VirtualSessionManagerListener to the list that should receive events about changes in the state of the virtual sessions managed by this virtual session manager.

Specified by:
addVirtualSessionManagerListener in interface VirtualSessionManager
Parameters:
listener - listener to add

removeVirtualSessionManagerListener

public void removeVirtualSessionManagerListener(VirtualSessionManagerListener listener)
Description copied from interface: VirtualSessionManager
Removes a VirtualSessionManagerListener from the list that should receive events about changes in the state of the virtual sessions managed by this virtual session manager.

Specified by:
removeVirtualSessionManagerListener in interface VirtualSessionManager
Parameters:
listener - listener to remove

addTerminalComponent

public void addTerminalComponent(TerminalComponent component,
                                 java.lang.String position,
                                 int ring)
Description copied from interface: Terminal

Add a component to this terminal. The position field should be one of

This terminal implementation should allow components to be added to one panel in a "ring" of nested panels each with a border layout and the child panel being in the center. The very innermost ring contains the actual terminal display.

The ring number should be the index of the ring from 0 up to getRingCount()

The Terminal will also invoke TerminalComponent.init(Terminal) to initialise the component (adding of listeners etc should be done here)

Specified by:
addTerminalComponent in interface Terminal
Parameters:
component - component to add
position - border position
ring - ring number

getRingCount

public int getRingCount()
Description copied from interface: Terminal

This terminal implementation allows components to be added to one panel in a "ring" of nested panels each with a border layout and the child panel being in the center. The very innermost ring contains the actual terminal display.

This method returns the number of rings that are available for use

Specified by:
getRingCount in interface Terminal
Returns:
number of available rings

getSelectedVirtualSession

public VirtualSession getSelectedVirtualSession()
Description copied from interface: VirtualSessionManager
Return the currently selected virtual session

Specified by:
getSelectedVirtualSession in interface VirtualSessionManager
Returns:
selected session

addVirtualSession

public void addVirtualSession(VirtualSession vt)
Description copied from interface: VirtualSessionManager
Add a new VirtualSession to this manager.

Specified by:
addVirtualSession in interface VirtualSessionManager
Parameters:
vt - virtual session to add

addImpl

protected void addImpl(VirtualSession session)

removeVirtualSession

public void removeVirtualSession(VirtualSession vt)
Description copied from interface: VirtualSessionManager
Remove a VirtualSession from this terminal

Specified by:
removeVirtualSession in interface VirtualSessionManager
Parameters:
vt - virtual session to remove

getSelectedVirtualSessionIndex

public int getSelectedVirtualSessionIndex()
Description copied from interface: VirtualSessionManager
Return the currently selected virtual index

Specified by:
getSelectedVirtualSessionIndex in interface VirtualSessionManager
Returns:
selected terminal index

getVirtualSessionCount

public int getVirtualSessionCount()
Description copied from interface: VirtualSessionManager
Return the number of virtual sessions.

Specified by:
getVirtualSessionCount in interface VirtualSessionManager
Returns:
virtual sessions

getVirtualSession

public VirtualSession getVirtualSession(int i)
Description copied from interface: VirtualSessionManager
Return the virtual session at the specified index

Specified by:
getVirtualSession in interface VirtualSessionManager
Parameters:
i - index
Returns:
virtual terminal

tabSelected

protected void tabSelected(VirtualSession session)

fireSelected

protected void fireSelected(VirtualSession session)

fireDeselected

protected void fireDeselected(VirtualSession session)

fireAdded

protected void fireAdded(VirtualSession session)

fireRemoved

protected void fireRemoved(VirtualSession session)

fireChanged

protected void fireChanged(VirtualSession session)

virtualSessions

public java.util.Enumeration virtualSessions()
Description copied from interface: VirtualSessionManager
Return an enumeration of virtual sessions

Specified by:
virtualSessions in interface VirtualSessionManager
Returns:
enumeration of virtual session


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