public class JTerminalScreen extends JPanel implements RWTnAction, KeyListener, Printable
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 FormJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static Color |
DEFAULT_BG_COLOR
Default terminal background color.
|
static Color |
DEFAULT_BOLD_COLOR
Default font color used to render bold text.
|
static Color |
DEFAULT_CURSOR_COLOR
Default color used to render cursor pointer on the terminal screen.
|
static Color |
DEFAULT_FG_COLOR
Default terminal foreground color.
|
static Color |
DEFAULT_FIELD_BG_COLOR
Default input field background color.
|
static 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 |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCONNECTION_ERROR, DISCONNECTED_BY_REMOTE_HOST, READY, X_WAITNO_SUCH_PAGE, PAGE_EXISTSABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
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,
String terminalType)
Construct a new GUI session with the specified terminalModel and terminalType.
|
JTerminalScreen(String terminalType)
Construct a new GUI session with a model 2 (24x80) screen using either a
3278, 3279, or 3279-E terminalType.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beep()
This method is called when the host application sends the beep command.
|
void |
broadcastMessage(String msg)
This method is called when the SessionServer admin sends a broadcast
message to all currently connected clients.
|
void |
clear() |
void |
connect(String host,
int port) |
void |
connect(String host,
int port,
boolean encryption) |
void |
connect(String host,
int port,
String host3270,
int port3270,
boolean encryption)
Opens a connection to the destination terminal server host.
|
void |
cursorMove(int oldPos,
int newPos)
This method is called when the cursor position (current buffer
position) of the 3270 engine is changed by host commands or by user
input.
|
void |
disconnect() |
void |
enter() |
RW3270 |
getRW3270() |
void |
incomingData()
Is called by the 3270 telnet engine when it has received new data.
|
void |
keyPressed(KeyEvent evt)
Processess non-character keyboard events.
|
void |
keyReleased(KeyEvent evt)
To satisfy interface declarations.
|
void |
keyTyped(KeyEvent evt) |
void |
mouseClicked(MouseEvent e)
Dispatches mouse event.
|
void |
mouseDragged(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
PA(int paKey) |
protected void |
paintChar(RW3270Char c)
Paints a char on the terminal panel.
|
protected void |
paintComponent(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(Graphics graphics,
PageFormat pageFormat,
int pageIndex) |
void |
renderScreen()
Renders a terminal screen on the buffered image graphics context.
|
void |
run() |
void |
setBackgroundColor(Color c) |
void |
setBoldColor(Color c) |
void |
setCurrentPosition(int newPos) |
void |
setFont(Font newFont)
Sets the font used to draw the screen.
|
void |
setForegroundColor(Color c) |
void |
setStatus(String statusMessage)
Sets current status message and calls components
repaint
method to make the new status message visible. |
void |
setWindowMessage(int msg) |
void |
setWindowMessage(String msg) |
void |
status(int status)
This method is called by the 3270 engine to communicate status changes
to the client.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, isPaintingOrigin, 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, updateadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, transferFocusBackward, transferFocusUpCyclepublic 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 Font DEFAULT_FONT
public static final Color DEFAULT_FG_COLOR
public static final Color DEFAULT_BG_COLOR
public static final Color DEFAULT_BOLD_COLOR
public static final Color DEFAULT_CURSOR_COLOR
public static final Color DEFAULT_FIELD_BG_COLOR
public static final int MARGIN_LEFT
public static final int MARGIN_TOP
public JTerminalScreen()
public JTerminalScreen(int terminalModel,
String terminalType)
terminalModel - terminalType - public JTerminalScreen(int terminalModel)
terminalModel - public JTerminalScreen(String terminalType)
terminalType - public void beep()
RWTnAction
public void beep() {
Toolkit.getDefaultToolkit().beep();
}
beep in interface RWTnActionpublic void broadcastMessage(String msg)
RWTnAction
If you're implementing Broadcast Messaging in your client, this method
should paint String msg to the client's screen.
broadcastMessage in interface RWTnActionmsg - The broadcast message from the system administrator.public void connect(String host, int port, String host3270, int port3270, boolean encryption)
host - the host name or IP address of the SessionServerport - the SessionServer's porthost3270 - the host name or IP address of the 3270 host. (If using
SessionServer)port3270 - the port of the 3270 hostencryption - true if encryption should be used, false
otherwise.public void connect(String host, int port) throws IOException, UnknownHostException
IOExceptionUnknownHostExceptionpublic void connect(String host, int port, boolean encryption) throws IOException, UnknownHostException
IOExceptionUnknownHostExceptionpublic void cursorMove(int oldPos,
int newPos)
RWTnAction
This is useful for 'undrawing' the cursor before drawing it in its new
position. The position is returned as an integer value between 0
(first character position) and len(dataBuffer) - 1 (last
character position). For example using 3270 Model 2. The value would
be between 0 and 1919.
cursorMove in interface RWTnActionoldPos - The previous cursor position.newPos - The new (current) cursor position.public void disconnect()
public RW3270 getRW3270()
public void incomingData()
RWTnActionThis method would usually call a paint() method or other display update. Note: this method is useful when the client implementation is stateful. If the 3270 engine does not have direct access to the user's display, the RW3270.waitForNewData() method will suspend the calling thread until new data arrives.
incomingData in interface RWTnActionpublic void PA(int paKey)
public void enter()
public void clear()
public void keyPressed(KeyEvent evt)
keyPressed in interface KeyListenerevt - DOCUMENT ME!public void keyReleased(KeyEvent evt)
keyReleased in interface KeyListenerevt - DOCUMENT ME!public void keyTyped(KeyEvent evt)
keyTyped in interface KeyListenerpublic void mouseClicked(MouseEvent e)
BUTTON1 is clicked,
moves terminal cursor to the character, on which the mouse event
occured.e - DOCUMENT ME!public void mousePressed(MouseEvent e)
public void mouseReleased(MouseEvent e)
public void mouseDragged(MouseEvent e)
public void paintCursor(int pos)
public void paintStatus()
public void paintWindowMessage()
public void renderScreen()
public void run()
public void setBackgroundColor(Color c)
public void setBoldColor(Color c)
public void setFont(Font newFont)
setFont in class JComponentnewFont - the new font to use for rendering terminal screen.public void setForegroundColor(Color c)
public void setStatus(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(String msg)
public void status(int status)
RWTnActionstatus in interface RWTnActionstatus - The status messageprotected void paintChar(RW3270Char c)
c - DOCUMENT ME!protected void paintComponent(Graphics g)
paintComponent in class JComponentg - DOCUMENT ME!public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException
print in interface PrintablePrinterExceptionCopyright © 2013. All Rights Reserved.