|
|||||||||
| 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
net.sf.freehost3270.gui.JTerminalScreen
public class JTerminalScreen
A SWING component that interactively renders terminal screen contents and handles user to terminal interaction.
The terminal is first rendered to a buffered image and then, whan a
component repaint is requested this buffered image is painted on the given
component's graphics context. In case if a default font size is changed,
the JTerminalScreen adjusts it size in order to feed the
grown terminal screen size.
paintComponent(Graphics),
setFont(Font),
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static java.awt.Color |
DEFAULT_BG_COLOR
Default terminal background color. |
static java.awt.Color |
DEFAULT_BOLD_COLOR
Default font color used to render bold text. |
static java.awt.Color |
DEFAULT_CURSOR_COLOR
Default color used to render cursor pointer on the terminal screen. |
static java.awt.Color |
DEFAULT_FG_COLOR
Default terminal foreground color. |
static java.awt.Color |
DEFAULT_FIELD_BG_COLOR
Default input field background color. |
static java.awt.Font |
DEFAULT_FONT
Default font used to draw terminal. |
static int |
DEFAULT_FONT_SIZE
Default size of the screen font. |
static int |
DEFAULT_HEIGHT
The default height of the panel. |
static int |
DEFAULT_WIDTH
The default width of the panel. |
static int |
MARGIN_LEFT
|
static int |
MARGIN_TOP
|
| 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 net.sf.freehost3270.client.RWTnAction |
|---|
CONNECTION_ERROR, DISCONNECTED_BY_REMOTE_HOST, READY, X_WAIT |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JTerminalScreen()
Construct a new GUI session with a terminalModel of 2, and a terminalType of 3279-E. |
|
JTerminalScreen(int terminalModel)
Construct a new GUI session with a 3279-E terminalType and the specified model where 2 <= terminalModel <= 5. |
|
JTerminalScreen(int terminalModel,
java.lang.String terminalType)
Construct a new GUI session with the specified terminalModel and terminalType. |
|
JTerminalScreen(java.lang.String terminalType)
Construct a new GUI session with a model 2 (24x80) screen using either a 3278, 3279, or 3279-E terminalType. |
|
| Method Summary | |
|---|---|
void |
beep()
|
void |
broadcastMessage(java.lang.String msg)
|
void |
clear()
|
void |
connect(java.lang.String host,
int port)
|
void |
connect(java.lang.String host,
int port,
boolean encryption)
|
void |
connect(java.lang.String host,
int port,
java.lang.String host3270,
int port3270,
boolean encryption)
Opens a connection to the destination terminal server host. |
void |
cursorMove(int oldPos,
int newPos)
|
void |
disconnect()
|
void |
enter()
|
net.sf.freehost3270.client.RW3270 |
getRW3270()
|
void |
incomingData()
|
void |
keyPressed(java.awt.event.KeyEvent evt)
Processess non-character keyboard events. |
void |
keyReleased(java.awt.event.KeyEvent evt)
To satisfy interface declarations. |
void |
keyTyped(java.awt.event.KeyEvent evt)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Dispatches mouse event. |
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
PA(int paKey)
|
protected void |
paintChar(net.sf.freehost3270.client.RW3270Char c)
Paints a char on the terminal panel. |
protected void |
paintComponent(java.awt.Graphics g)
Paints backgoround buffered image on the given graphics context. |
void |
paintCursor(int pos)
|
void |
paintStatus()
|
void |
paintWindowMessage()
Paints a message on the screen. |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
|
void |
renderScreen()
Renders a terminal screen on the buffered image graphics context. |
void |
run()
|
void |
setBackgroundColor(java.awt.Color c)
|
void |
setBoldColor(java.awt.Color c)
|
void |
setCurrentPosition(int newPos)
|
void |
setFont(java.awt.Font newFont)
Sets the font used to draw the screen. |
void |
setForegroundColor(java.awt.Color c)
|
void |
setStatus(java.lang.String statusMessage)
Sets current status message and calls components repaint
method to make the new status message visible. |
void |
setWindowMessage(int msg)
|
void |
setWindowMessage(java.lang.String msg)
|
void |
status(int status)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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 DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
DEFAULT_WIDTH,
Constant Field Valuespublic static final int DEFAULT_FONT_SIZE
public static final java.awt.Font DEFAULT_FONT
public static final java.awt.Color DEFAULT_FG_COLOR
public static final java.awt.Color DEFAULT_BG_COLOR
public static final java.awt.Color DEFAULT_BOLD_COLOR
public static final java.awt.Color DEFAULT_CURSOR_COLOR
public static final java.awt.Color DEFAULT_FIELD_BG_COLOR
public static final int MARGIN_LEFT
public static final int MARGIN_TOP
| Constructor Detail |
|---|
public JTerminalScreen()
public JTerminalScreen(int terminalModel,
java.lang.String terminalType)
terminalModel - terminalType - public JTerminalScreen(int terminalModel)
terminalModel - public JTerminalScreen(java.lang.String terminalType)
terminalType - | Method Detail |
|---|
public void beep()
beep in interface net.sf.freehost3270.client.RWTnActionpublic void broadcastMessage(java.lang.String msg)
broadcastMessage in interface net.sf.freehost3270.client.RWTnAction
public void connect(java.lang.String host,
int port,
java.lang.String host3270,
int port3270,
boolean encryption)
host - port - host3270 - port3270 - encryption - DOCUMENT ME!
public void connect(java.lang.String host,
int port)
throws java.io.IOException,
java.net.UnknownHostException
java.io.IOException
java.net.UnknownHostException
public void connect(java.lang.String host,
int port,
boolean encryption)
throws java.io.IOException,
java.net.UnknownHostException
java.io.IOException
java.net.UnknownHostException
public void cursorMove(int oldPos,
int newPos)
cursorMove in interface net.sf.freehost3270.client.RWTnActionpublic void disconnect()
public net.sf.freehost3270.client.RW3270 getRW3270()
public void incomingData()
incomingData in interface net.sf.freehost3270.client.RWTnActionpublic void PA(int paKey)
public void enter()
public void clear()
public void keyPressed(java.awt.event.KeyEvent evt)
keyPressed in interface java.awt.event.KeyListenerevt - DOCUMENT ME!public void keyReleased(java.awt.event.KeyEvent evt)
keyReleased in interface java.awt.event.KeyListenerevt - DOCUMENT ME!public void keyTyped(java.awt.event.KeyEvent evt)
keyTyped in interface java.awt.event.KeyListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
BUTTON1 is clicked,
moves terminal cursor to the character, on which the mouse event
occured.
e - DOCUMENT ME!public void mousePressed(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void mouseDragged(java.awt.event.MouseEvent e)
public void paintCursor(int pos)
public void paintStatus()
public void paintWindowMessage()
public void renderScreen()
public void run()
public void setBackgroundColor(java.awt.Color c)
public void setBoldColor(java.awt.Color c)
public void setFont(java.awt.Font newFont)
setFont in class javax.swing.JComponentnewFont - the new font to use for rendering terminal screen.public void setForegroundColor(java.awt.Color c)
public void setStatus(java.lang.String statusMessage)
repaint
method to make the new status message visible.
statusMessage - DOCUMENT ME!public void setCurrentPosition(int newPos)
public void setWindowMessage(int msg)
public void setWindowMessage(java.lang.String msg)
public void status(int status)
status in interface net.sf.freehost3270.client.RWTnActionprotected void paintChar(net.sf.freehost3270.client.RW3270Char c)
c - DOCUMENT ME!protected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - DOCUMENT ME!
public int print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablejava.awt.print.PrinterException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||