|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--com.sshtools.sshterm.emulation.TerminalPanel
Video Display Unit emulation for Swing/AWT. This class implements all necessary features of a character display unit, but not the actual terminal emulation. It can be used as the base for terminal emulations of any kind.
This is a lightweight component. It will render very badly if used in standard AWT components without overloaded update() method. The update() method must call paint() immediately without clearing the components graphics context or parts of the screen will simply disappear.
Maintainer: Matthias L. Jugel
| Nested Class Summary |
| 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 | |
static int |
COLOR_BOLD
Description of the Field |
static int |
COLOR_INVERT
Description of the Field |
static int |
RESIZE_FONT
Description of the Field |
static int |
RESIZE_NONE
Description of the Field |
static int |
RESIZE_SCREEN
Description of the Field |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, 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 | |
TerminalPanel(VDUBuffer buffer)
Create a display unit with size 80x24 and Font "Monospaced", size 12. |
|
TerminalPanel(VDUBuffer buffer,
java.awt.Font font)
Create a new video display unit with the passed width and height in characters using a special font and font size. |
|
| Method Summary | |
void |
addFocusListener(java.awt.event.FocusListener listener)
Adds a feature to the FocusListener attribute of the SwingTerminal object |
void |
addKeyListener(java.awt.event.KeyListener listener)
Add a key listener to the VDU. |
void |
addMouseListener(java.awt.event.MouseListener listener)
Add a mouse listener to the VDU. |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener listener)
Add a mouse motion listener to the VDU. |
void |
clearSelection()
Description of the Method |
java.awt.Color[] |
getColorSet()
Get current color set. |
java.awt.Insets |
getInsets()
The insets of the character display define the border. |
java.awt.Dimension |
getPreferredSize()
Return the preferred Size of the character display. |
java.lang.String |
getSelection()
Gets the selection attribute of the SwingTerminal object |
java.awt.Dimension |
getSize()
Return the real size in points of the character display. |
VDUBuffer |
getVDUBuffer()
Return the currently associated VDUBuffer. |
void |
keyPressed(java.awt.event.KeyEvent e)
Description of the Method |
void |
keyReleased(java.awt.event.KeyEvent e)
Description of the Method |
void |
keyTyped(java.awt.event.KeyEvent e)
Description of the Method |
protected double |
max(double f1,
double f2)
Description of the Method |
protected double |
min(double f1,
double f2)
Description of the Method |
void |
mouseClicked(java.awt.event.MouseEvent evt)
Description of the Method |
void |
mouseDragged(java.awt.event.MouseEvent evt)
Description of the Method |
void |
mouseEntered(java.awt.event.MouseEvent evt)
Description of the Method |
void |
mouseExited(java.awt.event.MouseEvent evt)
Description of the Method |
java.awt.Point |
mouseGetPos(java.awt.Point evtpt)
Convert Mouse Event coordinates into character cell coordinates |
void |
mouseMoved(java.awt.event.MouseEvent evt)
Description of the Method |
void |
mousePressed(java.awt.event.MouseEvent evt)
Handle mouse pressed events for copy & paste. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
Handle mouse released events for copy & paste. |
void |
paint(java.awt.Graphics g)
Paint the current screen using the backing store image. |
void |
print(java.awt.Graphics g)
Description of the Method |
void |
processFocusEvent(java.awt.event.FocusEvent evt)
Description of the Method |
void |
processKeyEvent(java.awt.event.KeyEvent evt)
Process key events for this component. |
void |
processMouseEvent(java.awt.event.MouseEvent evt)
Process mouse events for this component. |
void |
processMouseMotionEvent(java.awt.event.MouseEvent evt)
Process mouse motion events for this component. |
void |
redraw()
Redraw marked lines. |
protected void |
redraw(java.awt.Graphics g)
Description of the Method |
void |
removeFocusListener(java.awt.event.FocusListener listener)
Description of the Method |
void |
removeKeyListener(java.awt.event.KeyListener listener)
Remove key listener from the VDU. |
void |
removeMouseListener(java.awt.event.MouseListener listener)
Remove a mouse listener to the VDU. |
void |
removeMouseMotionListener(java.awt.event.MouseMotionListener listener)
Remove a mouse motion listener to the VDU. |
void |
setBorder(int thickness,
boolean raised)
Set the border thickness and the border type. |
void |
setBounds(int x,
int y,
int w,
int h)
Reshape character display according to resize strategy. |
void |
setColorPrinting(boolean colorPrint)
Set default for printing black&white or colorized as displayed on screen. |
void |
setColorSet(java.awt.Color[] colorset)
Set new color set for the display. |
void |
setCursorColors(java.awt.Color fg,
java.awt.Color bg)
Set cursor FG and BG colors |
void |
setFont(java.awt.Font font)
Set the font to be used for rendering the characters on screen. |
void |
setResizeStrategy(int strategy)
Set the strategy when window is resized. |
void |
setScrollbar(javax.swing.JScrollBar scrollBar)
Connect a scrollbar to the VDU. |
void |
setVDUBuffer(VDUBuffer buffer)
Set a new terminal (VDU) buffer. |
| 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, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| 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, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, 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, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, 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 |
public static final int RESIZE_NONE
public static final int RESIZE_FONT
public static final int RESIZE_SCREEN
public static final int COLOR_BOLD
public static final int COLOR_INVERT
| Constructor Detail |
public TerminalPanel(VDUBuffer buffer,
java.awt.Font font)
buffer - a VDU buffer to be associated with the displayfont - the font to be used (usually Monospaced)public TerminalPanel(VDUBuffer buffer)
buffer - Description of the Parameter| Method Detail |
protected double max(double f1,
double f2)
f1 - Description of the Parameterf2 - Description of the Parameter
protected double min(double f1,
double f2)
f1 - Description of the Parameterf2 - Description of the Parameter
public void setVDUBuffer(VDUBuffer buffer)
setVDUBuffer in interface VDUDisplaybuffer - new bufferpublic VDUBuffer getVDUBuffer()
getVDUBuffer in interface VDUDisplaypublic void setColorSet(java.awt.Color[] colorset)
colorset - new color setpublic java.awt.Color[] getColorSet()
public void setFont(java.awt.Font font)
setFont in class javax.swing.JComponentfont - the new font to be used.public void setResizeStrategy(int strategy)
strategy - the strategyRESIZE_NONE,
RESIZE_FONT,
RESIZE_SCREEN
public void setBorder(int thickness,
boolean raised)
thickness - border thickness in pixels, zero means no borderraised - a boolean indicating a raised or embossed borderpublic void setScrollbar(javax.swing.JScrollBar scrollBar)
scrollBar - the scroll barpublic void redraw()
redraw in interface VDUDisplayprotected void redraw(java.awt.Graphics g)
g - Description of the Parameterpublic void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - Description of the Parameterpublic void setColorPrinting(boolean colorPrint)
colorPrint - true = print in full color, default b&w onlypublic void print(java.awt.Graphics g)
print in class javax.swing.JComponentg - Description of the Parameterpublic java.awt.Point mouseGetPos(java.awt.Point evtpt)
evtpt - the mouse point to be converted
public void setCursorColors(java.awt.Color fg,
java.awt.Color bg)
fg - foreground color or nullbg - background color or null
public void setBounds(int x,
int y,
int w,
int h)
setBounds in class java.awt.Componentx - The new bounds valuey - The new bounds valuew - The new bounds valueh - The new bounds valuesetResizeStrategy(int)public java.awt.Dimension getSize()
getSize in class java.awt.ComponentDimensionpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentComponent.size()public java.awt.Insets getInsets()
getInsets in class javax.swing.JComponentpublic void clearSelection()
public java.lang.String getSelection()
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved in interface java.awt.event.MouseMotionListenerevt - Description of the Parameterpublic void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged in interface java.awt.event.MouseMotionListenerevt - Description of the Parameterpublic void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked in interface java.awt.event.MouseListenerevt - Description of the Parameterpublic void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered in interface java.awt.event.MouseListenerevt - Description of the Parameterpublic void mouseExited(java.awt.event.MouseEvent evt)
mouseExited in interface java.awt.event.MouseListenerevt - Description of the Parameterpublic void mousePressed(java.awt.event.MouseEvent evt)
mousePressed in interface java.awt.event.MouseListenerevt - the event that occuredMouseEventpublic void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased in interface java.awt.event.MouseListenerevt - the mouse eventpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenere - Description of the Parameterpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenere - Description of the Parameterpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenere - Description of the Parameterpublic void addMouseListener(java.awt.event.MouseListener listener)
addMouseListener in class java.awt.Componentlistener - the new mouse listenerpublic void removeMouseListener(java.awt.event.MouseListener listener)
removeMouseListener in class java.awt.Componentlistener - the mouse listener to removepublic void addMouseMotionListener(java.awt.event.MouseMotionListener listener)
addMouseMotionListener in class java.awt.Componentlistener - the mouse motion listenerpublic void removeMouseMotionListener(java.awt.event.MouseMotionListener listener)
removeMouseMotionListener in class java.awt.Componentlistener - the mouse motion listener to removepublic void processMouseEvent(java.awt.event.MouseEvent evt)
processMouseEvent in class java.awt.Componentevt - the dispatched mouse eventpublic void processMouseMotionEvent(java.awt.event.MouseEvent evt)
processMouseMotionEvent in class javax.swing.JComponentevt - the dispatched mouse eventpublic void addKeyListener(java.awt.event.KeyListener listener)
addKeyListener in class java.awt.Componentlistener - the key listenerpublic void removeKeyListener(java.awt.event.KeyListener listener)
removeKeyListener in class java.awt.Componentlistener - the key listener to removepublic void processKeyEvent(java.awt.event.KeyEvent evt)
processKeyEvent in class javax.swing.JComponentevt - the dispatched key eventpublic void addFocusListener(java.awt.event.FocusListener listener)
addFocusListener in class java.awt.Componentlistener - The feature to be added to the FocusListener attributepublic void removeFocusListener(java.awt.event.FocusListener listener)
removeFocusListener in class java.awt.Componentlistener - Description of the Parameterpublic void processFocusEvent(java.awt.event.FocusEvent evt)
processFocusEvent in class java.awt.Componentevt - Description of the Parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||