|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
hades.models.special.VT52Canvas
VT52Canvas - an AWT component that displays a "VT-52" type terminal window with cursor.
This class is used by both the serial and the parallel interface HADES terminal models: hades.models.special.VT52, and hades.models.special.Terminal.
Text font and color can be specified via the "Hades.VT52Canvas.FontName", "...FontSize", and "Hades.VT52canvas.Color" properties. Call "setCursor(x,y)" to move the cursor, "clear()" to clear the display, and "setChar(c)" to add a character.
Note: somehow, Swing really wants to use its own default font, requiring lots of g.setFont() calls...
Nested Class Summary | |
protected class |
VT52Canvas.BlinkTimer
|
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 boolean |
auto_repaint_enable
|
protected int |
char_height
|
protected int |
char_width
|
protected int |
cursor_old_x
|
protected int |
cursor_old_y
|
protected boolean |
cursor_on
|
protected int |
cursor_x
|
protected int |
cursor_y
|
static boolean |
debug
|
protected java.lang.StringBuffer[] |
displayBuffer
|
protected int |
height
|
protected int |
max_ascent
|
protected int |
mode
|
static int |
MODE_ESCAPE_MOVETO
|
static int |
MODE_ESCAPE_MOVETO2
|
static int |
MODE_ESCAPE_SINGLE
|
static int |
MODE_NORMAL
|
protected int |
moveto_x
|
protected int |
moveto_y
|
static int |
n_chars
|
static int |
n_lines
|
protected int |
t_repaint
|
protected java.awt.Color |
textColor
|
protected java.awt.Font |
textFont
|
protected int |
width
|
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.Container |
|
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 | |
VT52Canvas()
|
Method Summary | |
void |
addChar(char c)
add one char to the VT52 emulation and interpret it. |
void |
addDummyListener()
|
void |
addDummyMouseListener()
since JDK 1.1.6, we won't receive the keyboard focus, unless we ask for it. |
void |
addNormalChar(char c)
|
void |
clear()
|
void |
clearRestOfDisplay()
|
void |
clearRestOfLine()
|
int |
clip(int value,
int minValue,
int maxValue)
|
boolean |
getAutoRepaintEnable()
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
void |
hideCursor(java.awt.Graphics g)
|
void |
identifyTerminal()
|
protected void |
initDisplayBuffer()
|
protected void |
initFontAndColors()
|
boolean |
isOpaque()
|
static void |
main(java.lang.String[] argv)
main(): simple selftest of the VT52Canvas |
static void |
message(java.lang.String s)
|
void |
moveCursorDown()
|
void |
moveCursorHome()
|
void |
moveCursorLeft()
|
void |
moveCursorRight()
|
void |
moveCursorTo(int x,
int y)
|
void |
moveCursorUp()
|
void |
moveCursorUpWithScrolling()
|
void |
moveNewline()
|
static void |
msg(java.lang.String s)
|
void |
paint(java.awt.Graphics g)
|
void |
paintCharAt(java.awt.Graphics g,
int x,
int y)
|
void |
resetMode()
|
void |
scrollUp()
|
void |
setAutoRepaintDelay(int millis)
|
void |
setAutoRepaintEnable(boolean b)
|
void |
setCursor(int x,
int y)
|
void |
setFont(java.awt.Font f)
|
void |
setTextFont(java.awt.Font f)
|
void |
showCursor(java.awt.Graphics g)
|
void |
startCursorBlinking()
|
void |
updateFontMetrics()
|
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, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, 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, 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 |
public static final int n_lines
public static final int n_chars
public static final int MODE_NORMAL
public static final int MODE_ESCAPE_SINGLE
public static final int MODE_ESCAPE_MOVETO
public static final int MODE_ESCAPE_MOVETO2
public static boolean debug
protected int cursor_x
protected int cursor_y
protected int cursor_old_x
protected int cursor_old_y
protected boolean cursor_on
protected int char_width
protected int char_height
protected int max_ascent
protected int width
protected int height
protected java.awt.Font textFont
protected java.awt.Color textColor
protected int t_repaint
protected boolean auto_repaint_enable
protected java.lang.StringBuffer[] displayBuffer
protected int mode
protected int moveto_x
protected int moveto_y
Constructor Detail |
public VT52Canvas()
Method Detail |
protected void initFontAndColors()
public void setFont(java.awt.Font f)
public void setTextFont(java.awt.Font f)
public void updateFontMetrics()
public void addDummyMouseListener()
protected void initDisplayBuffer()
public void resetMode()
public void setCursor(int x, int y)
public void moveNewline()
public void moveCursorUp()
public void moveCursorUpWithScrolling()
public void moveCursorDown()
public void moveCursorRight()
public void moveCursorLeft()
public void moveCursorHome()
public void moveCursorTo(int x, int y)
public void clearRestOfLine()
public void clearRestOfDisplay()
public void identifyTerminal()
public void addChar(char c)
public void addNormalChar(char c)
public void clear()
public void scrollUp()
public int clip(int value, int minValue, int maxValue)
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
public boolean isOpaque()
public void paint(java.awt.Graphics g)
public void paintCharAt(java.awt.Graphics g, int x, int y)
public void showCursor(java.awt.Graphics g)
public void hideCursor(java.awt.Graphics g)
public boolean getAutoRepaintEnable()
public void setAutoRepaintEnable(boolean b)
public void setAutoRepaintDelay(int millis)
public void startCursorBlinking()
public static void msg(java.lang.String s)
public void addDummyListener()
public static void message(java.lang.String s)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |