|
|||||||||
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
com.sun.emp.pathway.bean.Terminal
A 3270 terminal. It exposes a set of methods for direct manipulation, along with methods for interrogating and setting the Terminal's appearance.
Also defined are the constants, which consists of the following groups:
This class can either be used as a standard visible 3270 Terminal, or as an invisible 3270 Terminal. If it is used non-visible, there is a performance advantage since it is not necessary to draw any updates to the screen.
The visibility of the Terminal is rarely ever directly specified, but a Terminal becomes 'visible' when it is added to a Component hierarchy within a graphical Java application or applet.
Programming Notes |
The Terminal
class has a large number of methods that are
used to control the complete details of its operation. These methods can be
summarized into the following categories.
IllegalStateException
.
if the Terminal is not in a reasonable state to perform the operation.
Using these methods at their most basic level, a connection can be
established using code similar to the example below:
...
Terminal aTerminal = new Terminal();
aTerminal.setTN3270Host(myHost);
aTerminal.setTN3270Port(myPort);
aTerminal.connect();
aTerminal.waitUntilConnected();
...
There are several methods that allow the programmer to 'interact' with
the Terminal.
The methods provided map closely to the thought processes used by a operator
of a real 3270 device.
This means that there are calls such as pressPF(3)
, and
typeString("Something")
can be used to simulate the operations
that would normally be performed by the Terminal operator.
There are also methods that do the 'waiting' that a real 3270 Terminal operator has to do.
This functionality is best described in an example:
...
aTerminal.tab();
aTerminal.typeString("Something");
aTerminal.tab();
aTerminal.typeString("SomethingElse");
aTerminal.pressEnter();
aTerminal.waitUntilKeyboardUnlocked();
aTerminal.pressPF(3);
aTerminal.waitUntilKeyboardUnlocked();
...
These methods, in general, will throw an
IllegalStateException
if the Terminal is not in a reasonable
state to perform the operation.
A wide variety of mechanisms are available for querying the contents of the 3270 screen. The 3270 screen can be viewed as:
TerminalField
.
getReadableString()
method can be used.
If you choose to display a Terminal, its appearance can be extensively
customized. Such things as the font, text and background colors, etc. can
all be configured. For example:
...
aTerminal.setBackground(Color.red);
aTerminal.setFont(new Font("Monospaced",Font.PLAIN,15));
...
The Terminal is primarily designed as a TN3270 client, and as such deals primarily with 3270 datastreams. However, it is possible for the Terminal to deal with non-3270 datastreams. This non-3270 mode of operation is required in the following circumstances:
The majority of applications need not worry about the mode of operation since they will be communicating exclusively in 3270 mode.
When a Terminal is to be used to access a DBCS host, the programmer
must take this into consideration. In particular, the valid characters
that can be 'typed' into the Terminal varies according to the attributes
of the field into which it is being typed. Details of the DBCS requirements
can be found in the details of the methods such as
typeString()
.
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, 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 | |
Terminal()
Constructs a Terminal. |
|
Terminal(Terminal source)
Constructs a Terminal from an already existant Terminal. |
Method Summary | |
void |
addHighlightArea(int offset,
int length,
Color color)
Adds an area of the 3270 display to be highlighted in the given color. |
void |
addHighlightAreas(int[] offset,
int[] length,
Color[] color)
Adds multiple areas of the 3270 display to be highlighted in the given colors. |
void |
addNotify()
|
void |
addTerminalListener(TerminalListener l)
Adds a listener for Terminal events. |
void |
backspace()
Simulates the pressing of the Backspace key on a 3270 keyboard. |
void |
backtab()
Simulates the pressing of the Backtab key on a 3270 keyboard. |
int |
columnFromOffset(int offset)
Gets the column number from a given offset. |
void |
connect()
Attempts to establish a connection to the specified host system. |
void |
cursorDown()
Moves the cursor one character position down. |
void |
cursorLeft()
Moves the cursor one character position to the left. |
void |
cursorRight()
Moves the cursor one character position to the right. |
void |
cursorUp()
Moves the cursor one character position up. |
void |
delete()
Simulates the pressing of the Delete key on a 3270 keyboard. |
void |
disconnect()
Disconnects from the currently connected system. |
void |
disconnect(String msg)
Disconnects from the currently connected system. |
void |
dispose()
Disposes of the Terminal and releases any resources that
it is using. |
void |
dump(OutputStream os)
Performs a diagnostic dump of the state of the Terminal . |
void |
dump(PrintWriter pw)
Performs a diagnostic dump of the state of the Terminal . |
void |
eraseEndOfField()
Simulates the pressing of the EOF key on a 3270 keyboard. |
void |
eraseInput()
Simulates the pressing of the Erase Input key on a 3270 keyboard. |
TerminalField |
findField(int offset)
Gets the field that contains the given offset. |
AccessibleContext |
getAccessibleContext()
|
Color |
getBackground()
Gets the background color of the Terminal . |
Insets |
getBoundary()
Gets an Insets object representing the 'freespace' around
the Terminal . |
byte[] |
getCharSetBuffer()
Gets a copy of the charset buffer. |
byte[] |
getColorBuffer()
Gets a copy of the color buffer. |
int |
getColumns()
Gets the number of columns of the Terminal . |
int |
getColumnWidth()
Gets the width of a single column of the Terminal in pixels. |
int |
getConnectionState()
Gets the connection state of the Terminal . |
String |
getCopyrightString()
Obtains the Sun Microsystems copyright string. |
int |
getCursorColumn()
Gets the column number of the Terminal containing
the cursor. |
int |
getCursorOffset()
Gets the offset of the cursor in the current 3270 buffer. |
int |
getCursorRow()
Gets the row number of the Terminal containing the cursor. |
char[] |
getDisplayBuffer()
Gets a copy of the display buffer. |
int |
getDisplaySize()
Gets the display size of the Terminal in characters. |
byte[] |
getExtendedAttributeBuffer()
Gets a copy of the extended attribute buffer. |
Color[] |
getExtendedColors()
Gets the extended color map. |
Color |
getExtendedColors(int index)
Gets a single extended color map entry. |
Vector |
getFields()
Gets a Vector that contains representations of the fields. |
Font |
getFont()
Gets the font of the Terminal . |
boolean |
getForceEWA()
Determines whether all datastreams that come in are be treated as if they are for the alternate screen size. |
String |
getHostCodepage()
Gets the EBCDIC codepage used for conversion of characters to and from the 3270 host system. |
String |
getIdentifierString()
Gets a textual indicator of the version and build level of this Bean. |
Color |
getInsertCursorColor()
Gets the color of the insert cursor. |
int |
getInsertCursorStyle()
Gets the style of the insert cursor. |
int |
getLastDisconnectionReason()
Gets the reason for the last disconnection of the Terminal
as an int . |
String |
getLastDisconnectionString()
Gets a textual representation of the reason for the last disconnection of the Terminal . |
EventListener[] |
getListeners(Class listenerType)
|
int |
getMaximumColumns()
Gets the maximum number of columns of the Terminal . |
int |
getMaximumDisplaySize()
Gets the maximum display size of the Terminal in characters. |
int |
getMaximumRows()
Gets the maximum number of rows of the Terminal . |
Dimension |
getMinimumSize()
|
int |
getModel()
Gets the model of the Terminal |
String |
getNetname()
Gets the netname used for the current 3270 session. |
int |
getNetworkInactivityTimeout()
Gets the network inactivity timeout for the remote connection. |
boolean |
getNumericInputValidation()
Determines whether validation is performed of characters typed into numeric fields. |
Color |
getOvertypeCursorColor()
Gets the color of the overtype cursor. |
int |
getOvertypeCursorStyle()
Gets the style of the overtype cursor. |
String |
getPreferredNetname()
When connecting to a TN3270E server, it is possible to specify a netname that a Terminal wishes to connect as. |
Dimension |
getPreferredSize()
|
Printable |
getPrintable()
Obtains a Printable that will render the
Terminal to a page. |
int |
getPrintStyle()
Gets the style of printing. |
Color |
getProtectedIntenseColor()
Gets the color in which to render the text in protected intense fields. |
Color |
getProtectedNormalColor()
Gets the color in which to render the text in protected normal fields. |
String |
getReadableString(int offset,
int length)
Gets a portion of the screen as a human readable string. |
int |
getRowHeight()
Gets the height of a single row of the Terminal in pixels. |
int |
getRows()
Gets the number of rows of the Terminal . |
int |
getSOSIDisplayStyle()
Determine the current display style for SO and SI characters |
Color |
getStatusBarBackground()
Gets the background color of the status bar. |
Color |
getStatusBarForeground()
Gets the foreground color of the status bar. |
TerminalListener[] |
getTerminalListeners()
Gets all of the registered TerminalListener s. |
int |
getTerminalMode()
Gets the current Terminal mode. |
String |
getTN3270Host()
Gets the TN3270 host. |
int |
getTN3270Port()
Gets the TN3270 port. |
Color |
getUnprotectedIntenseColor()
Gets the color in which to render the text in unprotected intense fields. |
Color |
getUnprotectedNormalColor()
Gets the color in which to render the text in unprotected normal fields. |
void |
home()
Simulates the pressing of the Home key on a 3270 keyboard. |
boolean |
isAutoFontResizingEnabled()
Determines whether automatic font resizing is enabled. |
boolean |
isCapturingData()
Determines if the Terminal is to capture histories of data
for use in dumping at a future time. |
boolean |
isCharFlashing(int offset)
Determines if the character at the given offset is flashing. |
boolean |
isCharFlashing(int row,
int column)
Determines if the character is flashing. |
boolean |
isCharReversed(int offset)
Determines if the character at the given offset is reversed. |
boolean |
isCharReversed(int row,
int column)
Determines if the character is reversed. |
boolean |
isCharUnderlined(int offset)
Determines if the character at the given offset is underlined. |
boolean |
isCharUnderlined(int row,
int column)
Determines if the character is underlined. |
boolean |
isConnected()
Determines if the Terminal is in a connected state. |
boolean |
isConnecting()
Determines if the Terminal is in a connecting state. |
boolean |
isDisconnected()
Determines if the Terminal is in a disconnected state. |
boolean |
isDisconnecting()
Determines if the Terminal is in a disconnecting state. |
boolean |
isFormatted()
Determines if the Terminal display is formatted. |
boolean |
isInsertCursorFlashing()
Determines whether the insert cursor should flash or not. |
boolean |
isInserting()
Determines if insert mode is operational. |
boolean |
isKeyboardInitiallyUnlocked()
Determines whether to unlock the keyboard on receiving the first datastream from the host. |
boolean |
isKeyboardLocked()
Determines if the keyboard is locked. |
boolean |
isOvertypeCursorFlashing()
Determines whether the overtype cursor should flash or not. |
boolean |
isStatusBarShowing()
Determines whether the visible Terminal should have a
status bar on it. |
boolean |
isSysreqAllowed()
Determines if the use of the pressSysreq() method is
allowed. |
boolean |
isTN3270EAllowed()
Determines if the Terminal is to use the TN3270E protocol
(as defined in RFC 1647 and RFC 2355). |
void |
moveCursorToOffset(int offset)
Moves the cursor to the specified offset on the Terminal . |
void |
moveCursorToRowColumn(int row,
int column)
Moves the cursor to the specified row and column on the Terminal . |
void |
newline()
Simulates the pressing of the Newline key on a 3270 keyboard. |
int |
offsetFromPoint(int x,
int y)
Returns the offset value given x and y pixel position. |
int |
offsetFromPoint(Point p)
Returns the offset value given a Point. |
int |
offsetFromRowColumn(int row,
int column)
Returns the offset value given a row, column pair. |
void |
pressATTN()
Simulates the pressing of the ATTN key. |
void |
pressClear()
Simulates the pressing of the Clear key on a 3270 keyboard. |
void |
pressCursorSelect()
Simulates the pressing of the Cursor Select key on a 3270 keyboard. |
void |
pressDUP()
Simulates the pressing of the DUP key on a 3270 keyboard. |
void |
pressEnter()
Simulates the pressing of the Enter key on a 3270 keyboard. |
void |
pressFieldMark()
Simulates the pressing of the Field Mark key on a 3270 keyboard. |
void |
pressInsert()
Simulates the pressing of the Insert key on a 3270 keyboard. |
void |
pressPA(int key)
Simulates the pressing of the specified PA key on a 3270 keyboard. |
void |
pressPF(int key)
Simulates the pressing of the specified PF key on a 3270 keyboard. |
void |
pressReset()
Simulates the pressing of the Reset key on a 3270 keyboard. |
void |
pressSysreq()
Simulates the pressing of the SYSREQ key. |
void |
removeAllHighlightAreas()
Removes all the highlighted areas from the screen. |
void |
removeNotify()
|
void |
removeTerminalListener(TerminalListener l)
Removes a listener for Terminal events. |
int |
rowFromOffset(int offset)
Gets the row number from a given offset. |
void |
setAutoFontResizingEnabled(boolean b)
Sets whether the font should automatically resize if the Terminal is resized. |
void |
setBackground(Color c)
Sets the Terminal background color to the specified color. |
void |
setBounds(int x,
int y,
int w,
int h)
|
void |
setCapturingData(boolean b)
Defines if the Terminal is to capture histories of data
for use in dumping at a future time. |
void |
setDebugDestination(PrintWriter pw)
Defines the destination for debug information. |
void |
setEnabled(boolean b)
|
void |
setExtendedColors(Color[] c)
Sets a the colors in the color map for the colors as defined by the extended attributes on the screen. |
void |
setExtendedColors(int index,
Color c)
Sets a single color in the color map for the colors as defined by the extended attributes on the screen. |
void |
setFont(Font newFont)
Sets the font used to render the Terminal . |
void |
setForceEWA(boolean b)
Sets whether all datastreams that come in should be treated as if they are for the alternate screen size. |
void |
setForceInitialEW(boolean b)
This method causes a datastream to be generated internally that clears the screen and frees the keyboard. |
void |
setHostCodepage(String s)
Sets the EBCDIC codepage to use for conversion of characters to and from the 3270 host system. |
void |
setInsertCursorColor(Color c)
Sets the color of the insert cursor. |
void |
setInsertCursorFlashing(boolean b)
Sets whether the insert cursor should flash or not. |
void |
setInsertCursorStyle(int style)
Sets the style of the insert cursor. |
void |
setInserting(boolean insertMode)
Sets the insert mode. |
void |
setKeyboardInitiallyUnlocked(boolean b)
Determines whether to unlock the keyboard on receiving the first datastream from the host. |
void |
setLocale(Locale l)
|
void |
setModel(int newModel)
Sets the model to the specified value. |
void |
setNetworkInactivityTimeout(int seconds)
Sets the network inactivity timeout for the remote connection. |
void |
setNumericInputValidation(boolean b)
Controls whether validation is performed of characters typed into numeric fields. |
void |
setOvertypeCursorColor(Color c)
Sets the color of the overtype cursor. |
void |
setOvertypeCursorFlashing(boolean b)
Sets whether the overtype cursor should flash or not. |
void |
setOvertypeCursorStyle(int style)
Sets the style of the overtype cursor. |
void |
setPreferredNetname(String name)
When connecting to a TN3270E server, it is possible to specify a netname that a Terminal wishes to connect as. |
void |
setPrintStyle(int style)
Sets the style of printing to be used. |
void |
setProtectedIntenseColor(Color c)
Sets the color in which to render the text in protected intense fields. |
void |
setProtectedNormalColor(Color c)
Sets the color in which to render the text in protected normal fields. |
void |
setSOSIDisplayStyle(int style)
Define how the DBCS SO and SI characters are to be displayed. |
void |
setStatusBarBackground(Color c)
Sets the background color of the status bar. |
void |
setStatusBarForeground(Color c)
Sets the foreground color of the status bar. |
void |
setStatusBarShowing(boolean displayValue)
Sets whether the visible Terminal should have a status bar
on it. |
void |
setTN3270EAllowed(boolean b)
Allows the Terminal to use the TN3270E protocol
(as defined in RFC 1647 and RFC 2355). |
void |
setTN3270Host(String newHost)
Sets the name of the TN3270 host with which to communicate. |
void |
setTN3270Port(int newPort)
Sets the port number on which the TN3270 server is listening. |
void |
setUnprotectedIntenseColor(Color c)
Sets the color in which to render the text in unprotected intense fields. |
void |
setUnprotectedNormalColor(Color c)
Sets the color in which to render the text in unprotected normal fields. |
void |
tab()
Simulates the pressing of the Tab key on a 3270 keyboard. |
void |
typeChar(char c)
Types a character on the Terminal at the current cursor
position. |
void |
typeCharNVT(char c)
Types a character on the Terminal at the current cursor
position. |
void |
typeString(String s)
Types a set of characters on the Terminal at the current
cursor position. |
void |
waitCondition(TerminalCondition terminalCondition)
Waits until the condition specified in the TerminalCondition
class is met. |
void |
waitForReadableString(String readableString,
int offset)
Waits for the specified string to be displayed on the Terminal at the specified offset. |
void |
waitHeuristic(int timeInMillis)
Waits for a response from the host in a heuristic manner. |
void |
waitUntilConnected()
Waits until the Terminal is connected. |
void |
waitUntilDisconnected()
Waits until the Terminal is disconnected. |
void |
waitUntilKeyboardUnlocked()
Waits until the Terminal keyboard is unlocked. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte COLOR_DEFAULT
public static final byte COLOR_NEUTRAL_0
public static final byte COLOR_BLUE
public static final byte COLOR_RED
public static final byte COLOR_PINK
public static final byte COLOR_GREEN
public static final byte COLOR_TURQUOISE
public static final byte COLOR_YELLOW
public static final byte COLOR_NEUTRAL_1
public static final byte COLOR_BLACK
public static final byte COLOR_DEEP_BLUE
public static final byte COLOR_ORANGE
public static final byte COLOR_PURPLE
public static final byte COLOR_PALE_GREEN
public static final byte COLOR_PALE_TURQUOISE
public static final byte COLOR_GREY
public static final byte COLOR_WHITE
public static final int SOSI_DISPLAY_STYLE_LTGT
public static final int SOSI_DISPLAY_STYLE_BLANKS
public static final int SOSI_DISPLAY_STYLE_ARROWS
public static final int MODEL_3278_2
public static final int MODEL_3278_2_E
public static final int MODEL_3278_3
public static final int MODEL_3278_3_E
public static final int MODEL_3278_4
public static final int MODEL_3278_4_E
public static final int MODEL_3278_5
public static final int MODEL_3278_5_E
public static final int CONNECTION_STATE_CONNECTED
public static final int CONNECTION_STATE_CONNECTING
public static final int CONNECTION_STATE_DISCONNECTED
public static final int CONNECTION_STATE_DISCONNECTING
public static final int TERMINAL_MODE_NONE
public static final int TERMINAL_MODE_NVT
public static final int TERMINAL_MODE_3270_NORMAL
public static final int TERMINAL_MODE_3270_SUSPEND
public static final int PRINTSTYLE_NORMAL
public static final int PRINTSTYLE_WHITE_ON_BLACK
public static final int PRINTSTYLE_BLACK_ON_WHITE
public static final int PRINTSTYLE_COLOR_ON_WHITE
public static final int CURSOR_BLOCK
public static final int CURSOR_INVERSE
public static final int CURSOR_UNDERLINE
public static final int CURSOR_SIDELINE
public static final int DISC_REASON_NEVER_CONNECTED
public static final int DISC_REASON_NO_CONNECTION_ESTABLISHED
public static final int DISC_REASON_STOPPED_BY_USER
public static final int DISC_REASON_DROPPED
public static final int DISC_REASON_TIMED_OUT
public static final int DISC_REASON_SECURITY_FAILURE
public static final int DISC_REASON_DEVICE_IN_USE
public static final int DISC_REASON_INV_NAME
public static final int DISC_REASON_INV_DEVICE_TYPE
public static final int DISC_REASON_TYPE_NAME_ERROR
public static final int DISC_REASON_UNKNOWN_ERROR
public static final int DISC_REASON_UNSUPPORTED_REQ
public static final String CODEPAGE_IBM037
public static final String CODEPAGE_IBM273
public static final String CODEPAGE_IBM277
public static final String CODEPAGE_IBM278
public static final String CODEPAGE_IBM280
public static final String CODEPAGE_IBM284
public static final String CODEPAGE_IBM285
public static final String CODEPAGE_IBM297
public static final String CODEPAGE_IBM500
public static final String CODEPAGE_IBM870
public static final String CODEPAGE_IBM875
public static final String CODEPAGE_IBM930
public static final String CODEPAGE_IBM933
public static final String CODEPAGE_IBM935
public static final String CODEPAGE_IBM937
public static final String CODEPAGE_IBM939
public static final String CODEPAGE_IBM1025
public static final String CODEPAGE_IBM1026
public static final String CODEPAGE_IBM1047
public static final String CODEPAGE_IBM1140
public static final String CODEPAGE_IBM1141
public static final String CODEPAGE_IBM1142
public static final String CODEPAGE_IBM1143
public static final String CODEPAGE_IBM1144
public static final String CODEPAGE_IBM1145
public static final String CODEPAGE_IBM1146
public static final String CODEPAGE_IBM1147
public static final String CODEPAGE_IBM1148
public static final String CODEPAGE_IBM1149
Constructor Detail |
public Terminal()
public Terminal(Terminal source)
Operations of a non-display oriented nature on one of the
Terminal
objects will be reflected by the other.
Operations of a display oriented nature on one will not be reflected by the other.
source
- The Terminal
upon which the new one is to
be based.
IllegalArgumentException
- if source
is null
.Method Detail |
public void removeNotify()
public void addNotify()
public String getCopyrightString()
public String getIdentifierString()
public boolean isKeyboardLocked()
public void setTN3270Host(String newHost)
connect()
process.
newHost
- The TN3270 host.getTN3270Host()
localhost
"public String getTN3270Host()
setTN3270Host
method.
This method is typically used to obtain the name of the host for the
current connection.
setTN3270Host(java.lang.String)
public void setTN3270Port(int newPort)
connect()
process.
newPort
- The TN3270 port.getTN3270Port()
public int getTN3270Port()
setTN3270Port
method.
This method is typically used to obtain the port for the host for the
current connection.
setTN3270Port(int)
public void setModel(int newModel)
newModel
- The TN3270 model - this should be
to one of the MODEL
constant values defined in
this class.getModel()
MODEL_3278_2_E
public int getModel()
Terminal
MODEL
constant values defined in this class.setModel(int)
public void setNetworkInactivityTimeout(int seconds)
IMPORTANT NOTE: The calling of this method when the
Terminal
is CONNECTED is known to be unreliable in some
Java environments. It is highly recommended that this method is only
called when the Terminal
is DISCONNECTED. This restriction
may be imposed by this method in a future release.
seconds
- The network inactivity timeout value in seconds
after which the connection to the remote system may be dropped
if no activity has occurred.getNetworkInactivityTimeout()
public int getNetworkInactivityTimeout()
setNetworkInactivityTimeout(int)
public int getMaximumRows()
Terminal
.
public int getMaximumColumns()
Terminal
.
public int getMaximumDisplaySize()
Terminal
in characters.
This is equal to maximumRows * maximumColumns
public int getRows()
Terminal
.
This is dependent on the model.
public int getColumns()
Terminal
.
This is dependent on the model.
public int getDisplaySize()
Terminal
in characters.
This is dependent on the model.
public int getConnectionState()
Terminal
.
CONNECTION_STATE
constant values defined in this class.public boolean isConnected()
Terminal
is in a connected state.
isConnecting()
,
isDisconnected()
,
isDisconnecting()
public boolean isConnecting()
Terminal
is in a connecting state.
isConnected()
,
isDisconnected()
,
isDisconnecting()
public boolean isDisconnected()
Terminal
is in a disconnected state.
isConnected()
,
isConnecting()
,
isDisconnecting()
public boolean isDisconnecting()
Terminal
is in a disconnecting state.
isConnected()
,
isConnecting()
,
isDisconnected()
public int getLastDisconnectionReason()
Terminal
as an int
.
DISC_REASON
constant values defined in this class.public String getLastDisconnectionString()
Terminal
.
public void connect()
IllegalStateException
- if the Terminal is already connected to a host, or if this is an
EVALUATION copy of the Terminal Bean which has expired.disconnect()
,
disconnect(java.lang.String)
public void disconnect()
disconnect(null)
.
IllegalStateException
- if the Terminal
is not connected to a host.disconnect(java.lang.String)
,
connect()
public void disconnect(String msg)
msg
- The string to be displayed in the disconnection message on
a visible Terminal
.
If null
then the default message is used.
IllegalStateException
- if the Terminal
is not connected to a host.disconnect()
,
connect()
public int getCursorRow()
Terminal
containing the cursor.
public int getCursorColumn()
Terminal
containing
the cursor.
public int getCursorOffset()
public Vector getFields()
Vector
that contains representations of the fields.
The elements in the Vector
will be objects of class
TerminalField
and they
will be in ascending start offset order.
If this method is performed on an unformatted screen, an empty
Vector
is returned.
It should be noted that this method can successfully be called
against a disconnected Terminal
. The results then reflect
the state of the Terminal
at the time the disconnection
occurred.
Vector
containing all of the fields.
IllegalStateException
- if the Terminal
is
in NVT mode.findField(int)
public boolean isFormatted()
Terminal
display is formatted.
A screen is defined as formatted if it possesses fields.
public boolean isCharUnderlined(int offset)
offset
- The offset position.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.isCharUnderlined(int,int)
public boolean isCharUnderlined(int row, int column)
row
- The row of the character.column
- The column of the character.
IllegalArgumentException
- if row
or column
is less than zero or
greater than the current row or column.isCharUnderlined(int)
public boolean isCharReversed(int offset)
offset
- The offset position.
true
if the character at the specified offset is
reversed.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.isCharReversed(int,int)
public boolean isCharReversed(int row, int column)
row
- The row of the character.column
- The column of the character.
true
if the character at the specified
row, column
is reversed.
IllegalArgumentException
- if the supplied row
or column
is beyond the
boundaries of the screen.isCharReversed(int)
public boolean isCharFlashing(int offset)
offset
- The offset position.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.isCharFlashing(int,int)
public boolean isCharFlashing(int row, int column)
row
- The row of the character.column
- The column of the character.
IllegalArgumentException
- if the supplied row
or column
is beyond the
boundaries of the screen.isCharFlashing(int)
public void pressInsert()
isInserting()
,
setInserting(boolean)
public void setInserting(boolean insertMode)
insertMode
- The insert mode.
IllegalStateException
- if the keyboard is not unlocked.isInserting()
public boolean isInserting()
setInserting(boolean)
public void cursorLeft()
Terminal
screen.
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.cursorRight()
,
cursorDown()
,
cursorUp()
public void cursorRight()
Terminal
screen.
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.cursorLeft()
,
cursorDown()
,
cursorUp()
public void cursorUp()
Terminal
screen.
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.cursorLeft()
,
cursorRight()
,
cursorDown()
public void cursorDown()
Terminal
screen.
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.cursorLeft()
,
cursorRight()
,
cursorUp()
public void tab()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.backtab()
public void backtab()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.tab()
public void newline()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public void home()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public void typeChar(char c)
Terminal
at the current cursor
position.
It is not valid to call this method when the Terminal
mode
is NVT.
When not in insert mode, this succeeds if the cursor is in an unprotected field.
When in insert mode it succeeds if it is an an unprotected field and there is space for the extra character.
If it succeeds, the cursor position is normally moved right by one character. However, if the field is ASKIP and the cursor position is the last available position in the field, then the cursor ends up at the first character position of the next unprotected field.
c
- The character to be typed on the Terminal
.public void typeCharNVT(char c)
Terminal
at the current cursor
position.
It is only valid to call this method when the Terminal
mode
is NVT.
The operation of this method is as if the character were typed from a keyboard. There are however, some characters that have a special meaning:
0x00
0x0d
('\r'
)
0x0a
('\n'
)
c
- The character to be typed on the Terminal
.public void typeString(String s)
Terminal
at the current
cursor position.
This method simply calls typeChar()
for each character in
the String
.
Calls to this method are not valid when the Terminal
mode is NVT.
s
- The String
to be typed on the
Terminal
.public void eraseEndOfField()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public void eraseInput()
If there are no unprotected fields, the cursor is placed at the top left corner of the screen.
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public void delete()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public void backspace()
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public char[] getDisplayBuffer()
Terminal
.
public String getReadableString(int offset, int length)
offset
- The start offset of the desired display area.length
- The length of the desired display area.
IllegalArgumentException
- if the supplied offset
is beyond the boundaries of the
screen, or if the length
is less than 1 or greater than
the size of the screen.typeString(java.lang.String)
typeString(String)
routine
public byte[] getExtendedAttributeBuffer()
Terminal
.
public byte[] getColorBuffer()
Terminal
.
public byte[] getCharSetBuffer()
Terminal
.
public void pressEnter()
This method is not valid when the Terminal
is in
NVT mode.
typeCharNVT() should be used in that
case.
IllegalStateException
- if the Terminal
is not connected, the keyboard is locked,
or the Terminal
is in NVT mode.public void pressPF(int key)
key
- PF key to press.
IllegalArgumentException
- if key
is not in the range 1 to 24
IllegalStateException
- if the Terminal
is not connected, the keyboard is locked,
or the Terminal
is in NVT mode.public void pressPA(int key)
key
- PA key to press.
IllegalArgumentException
- if key
is not in the range 1 to 3.
IllegalStateException
- if the Terminal
is not connected, the keyboard is locked,
or the Terminal
is in NVT mode.public void pressClear()
IllegalStateException
- if the Terminal
is not connected, the keyboard is locked,
or the Terminal
is in NVT mode.public void pressCursorSelect()
The Cursor Select operation can only succeed if the field in which the cursor is situated is Cursor Select Capable, and the first character in that field is one of:
This method can be used in conjunction with the
moveCursorToOffset(int)
method to simulate a light-pen.
IllegalStateException
- if the Terminal
is not connected, the keyboard is locked,
or the field is not valid for CursorSelect.public void setFont(Font newFont)
Terminal
.
newFont
- the font.getFont()
public Font getFont()
Terminal
.
getFont
in interface MenuContainer
setFont(java.awt.Font)
public void setLocale(Locale l)
public void setBackground(Color c)
Terminal
background color to the specified color.
c
- The background color.getBackground()
Color.black
public Color getBackground()
Terminal
.
setBackground(java.awt.Color)
public void setUnprotectedNormalColor(Color c)
c
- The unprotected normal color.
NullPointerException
- if c
is
null
.getUnprotectedNormalColor()
public Color getUnprotectedNormalColor()
setUnprotectedNormalColor(java.awt.Color)
public void setProtectedNormalColor(Color c)
c
- The protected normal color.
NullPointerException
- if c
is
null
.getProtectedNormalColor()
public Color getProtectedNormalColor()
setProtectedNormalColor(java.awt.Color)
public void setUnprotectedIntenseColor(Color c)
c
- The unprotected intense color.
NullPointerException
- if c
is
null
.getUnprotectedIntenseColor()
public Color getUnprotectedIntenseColor()
setUnprotectedIntenseColor(java.awt.Color)
public void setProtectedIntenseColor(Color c)
c
- The protected intense color.
NullPointerException
- if c
is
null
.getProtectedIntenseColor()
public Color getProtectedIntenseColor()
setProtectedIntenseColor(java.awt.Color)
public void setStatusBarBackground(Color c)
c
- The status bar background color.
NullPointerException
- if c
is
null
.getStatusBarBackground()
Color.gray
public Color getStatusBarBackground()
setStatusBarBackground(java.awt.Color)
public void setStatusBarForeground(Color c)
c
- The status bar foreground color.
NullPointerException
- if c
is
null
.getStatusBarForeground()
Color.black
public Color getStatusBarForeground()
setStatusBarForeground(java.awt.Color)
public void setExtendedColors(Color[] c)
The supplied new colors can be an array of any length. Up to the first 16 elements from the array are used to populate the internal color map. Any item in the array being null causes the internal color map for that index to remain unchanged.
c
- The extended color map.
NullPointerException
- if c
is
null
.getExtendedColors()
public void setExtendedColors(int index, Color c)
index
- The index.c
- The color.
NullPointerException
- if c
is
null
.
IllegalArgumentException
- if the index < 0 or
index >15.getExtendedColors(int)
public Color[] getExtendedColors()
setExtendedColors(java.awt.Color[])
public Color getExtendedColors(int index)
index
- The index into the extended color map.
setExtendedColors(int,java.awt.Color)
public void setPrintStyle(int style)
PRINTSTYLE
values describe a set of ways that
printing can be handled.
style
- The print style - an int that should be
one of the PRINTSTYLE
constant values defined in this
class.
IllegalArgumentException
- if style
is not one of the defined print styles.getPrintStyle()
PRINTSTYLE_NORMAL
public int getPrintStyle()
PRINTSTYLE
constant values defined in this class.setPrintStyle(int)
public void setStatusBarShowing(boolean displayValue)
Terminal
should have a status bar
on it.
displayValue
- Whether the status bar should be displayed.isStatusBarShowing()
true
public boolean isStatusBarShowing()
Terminal
should have a
status bar on it.
setStatusBarShowing(boolean)
public void setOvertypeCursorStyle(int style)
style
- The overtype cursor style - an int that should be
one of the CURSOR
constant values defined in this class.
IllegalArgumentException
- if the style is not one of the
valid values.getOvertypeCursorStyle()
CURSOR_BLOCK
public int getOvertypeCursorStyle()
CURSOR
constant values defined in this class.setOvertypeCursorStyle(int)
public void setOvertypeCursorColor(Color c)
c
- The new overtype cursor color.
NullPointerException
- if c
is
null
.getOvertypeCursorColor()
Color.blue
public Color getOvertypeCursorColor()
setOvertypeCursorColor(java.awt.Color)
public void setOvertypeCursorFlashing(boolean b)
b
- true
to make the cursor flash.isOvertypeCursorFlashing()
false
public boolean isOvertypeCursorFlashing()
true
if the cursor is flashing.setOvertypeCursorFlashing(boolean)
public void setInsertCursorStyle(int style)
style
- The insert cursor style - this should be
one of the CURSOR
constant values defined in this
class.
IllegalArgumentException
- if the style is not one of the
valid values.getInsertCursorStyle()
CURSOR_SIDELINE
public int getInsertCursorStyle()
CURSOR
constant values defined in this
class.setInsertCursorStyle(int)
public void setInsertCursorColor(Color c)
c
- The insert cursor color.
NullPointerException
- if c
is
null
.getInsertCursorColor()
Color.blue
public Color getInsertCursorColor()
setInsertCursorColor(java.awt.Color)
public void setInsertCursorFlashing(boolean b)
b
- true
to make the cursor flash.isInsertCursorFlashing()
false
public boolean isInsertCursorFlashing()
true
if the cursor is flashing.setInsertCursorFlashing(boolean)
public TerminalField findField(int offset)
This method returns null
if the screen is unformatted.
offset
- The offset value.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.
IllegalStateException
- if the Terminal
is
in NVT mode.getFields()
public int offsetFromRowColumn(int row, int column)
The row and column are specified such that a value of 1,1 is the top left corner of the screen.
row
- The given row value.column
- The given column value.
IllegalArgumentException
- if the supplied row
or column
is beyond the
boundaries of the screen.rowFromOffset(int)
,
columnFromOffset(int)
public int rowFromOffset(int offset)
The row is specified such that a value of 1 is the top row on the screen.
offset
- The given offset.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.offsetFromRowColumn(int,int)
,
columnFromOffset(int)
public int columnFromOffset(int offset)
The column is specified such that a value of 1 is the left most column on the screen.
offset
- The given offset.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.offsetFromRowColumn(int,int)
,
rowFromOffset(int)
public int offsetFromPoint(int x, int y)
IllegalStateException
is
thrown.
x
- The x screen pixel position.y
- The y screen pixel position.
IllegalStateException
- if the Terminal
screen is not visible.offsetFromPoint(java.awt.Point)
public int offsetFromPoint(Point p)
IllegalStateException
is
thrown.
p
- The screen pixel position.
IllegalStateException
- if the Terminal
screen is not visible.offsetFromPoint(int, int)
public void addHighlightArea(int offset, int length, Color color)
offset
- The start offset of the area.length
- The length of the area.color
- The color of the area.
NullPointerException
- if color
is
null
.removeAllHighlightAreas()
public void addHighlightAreas(int[] offset, int[] length, Color[] color)
addHighlightArea
multiple times.
offset
- An array of start offsets of each area.length
- An array of lengths of each area.color
- An array of colors of each area.
NullPointerException
- if any of the parameters are
null
.
IllegalArgumentException
- if the lengths of the arrays
are not the same, or if any of the elements of the arrays is not valid.removeAllHighlightAreas()
public void removeAllHighlightAreas()
addHighlightArea(int,int,java.awt.Color)
public void setBounds(int x, int y, int w, int h)
public Dimension getMinimumSize()
public Dimension getPreferredSize()
public void addTerminalListener(TerminalListener l)
Terminal
events.
l
- The TerminalListener
to be added.removeTerminalListener(com.sun.emp.pathway.bean.TerminalListener)
public void removeTerminalListener(TerminalListener l)
Terminal
events.
l
- The TerminalListener
to be removed.addTerminalListener(com.sun.emp.pathway.bean.TerminalListener)
public TerminalListener[] getTerminalListeners()
TerminalListener
s.
addTerminalListener(com.sun.emp.pathway.bean.TerminalListener)
,
removeTerminalListener(com.sun.emp.pathway.bean.TerminalListener)
public EventListener[] getListeners(Class listenerType)
public void setEnabled(boolean b)
public void setForceEWA(boolean b)
b
- true
if datastream are all to be treated as
alternate.getForceEWA()
CAUTION: |
---|
This method is intended to allow connection to the
small number of TN3270 hosts (such as CICS/6000) that
always send their data in ALTERNATE mode, without sending the normal
EWA bytes.
Do not use this call unless you have such a host and you fully understand the implications of doing so. |
public boolean getForceEWA()
true
if datastream are all treated as alternate.setForceEWA(boolean)
public void setForceInitialEW(boolean b)
Terminal
has successfully entered 3270
mode, and is treated as if the datastream arrived from the 3270 host.
This method should be called before calling the connect()
method.
b
- Force or not.CAUTION: |
---|
This method is intended to allow connection to the
small number of TN3270 hosts that do not initially send any data to
the Terminal , but expect the first data flow to be from
Terminal to server.
Do not use this call unless you have such a host and you fully understand the implications of doing so. |
public void pressDUP()
IllegalStateException
- if this operation is performed when any one of the following conditions
are true:
public void pressFieldMark()
IllegalStateException
- if this operation is performed when any one of the following conditions
are true:
public void pressReset()
public void moveCursorToOffset(int offset)
Terminal
.
offset
- The cursor offset.
IllegalArgumentException
- if offset
is less than zero or greater than the current
screen size.
IllegalStateException
- if the Terminal
is
not connected, keyboard unlocked, and in 3270 or suspend mode.public void moveCursorToRowColumn(int row, int column)
Terminal
.
row
- The cursor row.column
- The cursor column.
IllegalArgumentException
- if the supplied row
or column
is beyond the
boundaries of the screen.public void waitUntilConnected()
Terminal
is connected. A call to this
method should only be made after a connect() is issued.
IllegalStateException
- if the Terminal
is in DISCONNECTED state when this call is
made, or if the Terminal
enters DISCONNECTED state during
the wait.connect()
public void waitUntilDisconnected()
Terminal
is disconnected.
public void waitUntilKeyboardUnlocked()
Terminal
keyboard is unlocked.
IllegalStateException
- if this method is called when the Terminal
is not in
connected state, or if the Terminal
leaves connected state
during the wait.public void waitHeuristic(int timeInMillis)
Terminal
) for the timeout period.
Terminal
, but where the
keyboard is unlocked BEFORE the last datastream is sent.
timeInMillis
- The time to wait for host activity before concluding that no further
sends from the host are going to occur.
IllegalStateException
- if this method is called when the Terminal
is not in
connected state, or if the Terminal
leaves connected
state during the wait.
IllegalArgumentException
- if timeInMillis
is negative.public void waitCondition(TerminalCondition terminalCondition) throws TerminalConditionException
TerminalCondition
class is met.
terminalCondition
- The TerminalCondition
object
defining the wait condition.
NullPointerException
- if terminalCondition
is null
.
TerminalConditionException
- if a runtime error occurs within the isSatisfied
method
of terminalCondition
.public void waitForReadableString(String readableString, int offset)
Terminal
at the specified offset.
readableString
- The String to wait for.offset
- The start offset of where the string is to be displayed.
IllegalStateException
- if the Terminal
is not in the connected state when this
call is made, or if the Terminal
leaves the connected state
during the wait.
NullPointerException
- if readableString
is null
.
IllegalArgumentException
- if the supplied offset
is negative.public void dispose()
Terminal
and releases any resources that
it is using.
Do not call any other methods in the Terminal
after it
has been disposed.
public int getRowHeight()
Terminal
in pixels.
This returns 0 if the Terminal
has not been shown.
getColumnWidth()
public int getColumnWidth()
Terminal
in pixels.
This returns 0 if the Terminal
has not been shown.
getRowHeight()
public Insets getBoundary()
Insets
object representing the 'freespace' around
the Terminal
.
A negative value for parts of the Insets
object represent
the Terminal
requiring more space to display itself
properly than has been provided by the setting of the size of this
component.
Insets
object.
IllegalStateException
- if the Terminal
screen is not visible.public boolean isKeyboardInitiallyUnlocked()
setKeyboardInitiallyUnlocked(boolean)
false
public void setKeyboardInitiallyUnlocked(boolean b)
b
- The new initial keyboard locked state.isKeyboardInitiallyUnlocked()
false
public void setHostCodepage(String s)
s
- The new codepage. This should be specified as one of the
CODEPAGE
constants.CODEPAGE_IBM1047
public String getHostCodepage()
CODEPAGE
constants.public int getTerminalMode()
Terminal
mode.
This can be one of the following values:
TERMINAL_MODE_NONE
TERMINAL_MODE_NVT
TERMINAL_MODE_3270_NORMAL
TERMINAL_MODE_3270_SUSPEND
public void pressSysreq()
isSysreqAllowed()
method is used to determine if this
method is allowed to be invoked.
isSysreqAllowed()
public void pressATTN()
public boolean isSysreqAllowed()
pressSysreq()
method is
allowed.
pressSysreq()
public String getNetname()
setPreferredNetname(java.lang.String)
public void setPreferredNetname(String name)
Terminal
wishes to connect as.
This method allows you to specify this netname.
Note that if the server does not request the use of the TN3270E
protocol, or if a call to
setTN3270EAllowed(false)
has been made, then this preferred netname has no effect.
The actual netname used is obtained using the
getNetname()
method.
name
- The preferred netname.getPreferredNetname()
public String getPreferredNetname()
Terminal
wishes to connect as.
This method allows you to determine this netname.
Note that if the server does not request the use of the TN3270E
protocol, or if a call to
setTN3270EAllowed(false)
has been made, then this preferred netname has no effect.
The actual netname used is obtained using the
getNetname()
method.
setPreferredNetname(java.lang.String)
public void setTN3270EAllowed(boolean b)
Terminal
to use the TN3270E protocol
(as defined in RFC 1647 and RFC 2355).
b
- Allow TN3270E.
IllegalStateException
- if the Terminal
is in a DISCONNECTED state when this call
is made.getPreferredNetname()
true
public boolean isTN3270EAllowed()
Terminal
is to use the TN3270E protocol
(as defined in RFC 1647 and RFC 2355).
getPreferredNetname()
true
public void setDebugDestination(PrintWriter pw)
The information contains information such as a snapshot of the
screen after significant events. Debugging can be turned off by
supplied a parameter of null
.
pw
- The PrintWriter to use.public boolean getNumericInputValidation()
When this value is true, only a restricted set of characters may be input to a numeric field. When this value is false, any character may be entered into an unprotected numeric field.
public void setNumericInputValidation(boolean b)
When this value is set to true, only a restricted set of characters may be input to a numeric field. When this value is set to false, any character may be entered into an unprotected numeric field.
Note that setting this value will also set it for any
Terminal
s
that share the same connection, i.e. those created using the
constructor 'public Terminal(Terminal)
'
b
- The new value.true
public void setCapturingData(boolean b)
Terminal
is to capture histories of data
for use in dumping at a future time.
This method should be used under the direction of the support organization.
b
- true if data is to be captured.dump(java.io.PrintWriter)
false
public boolean isCapturingData()
Terminal
is to capture histories of data
for use in dumping at a future time.
This method should be used under the direction of the support organization.
true
if data is being captured.dump(java.io.PrintWriter)
public void dump(PrintWriter pw)
Terminal
.
The information produced by this dump is primarily intended for use by the 3270 Pathway Support Organization.
This method should be used under the direction of the support organization.
The format and details of the output produced by this command is liable to change and should not be relied upon.
pw
- The destination for the dump.public void dump(OutputStream os)
Terminal
.
The information produced by this dump is primarily intended for use by the 3270 Pathway Support Organization. This method should be used under the direction of the support organization.
The format and details of the output produced by this command is liable to change and should not be relied upon.
os
- The destination for the dump.public void setAutoFontResizingEnabled(boolean b)
Terminal
is resized.
b
- true
to enable automatic font resizing.isAutoFontResizingEnabled()
true
public boolean isAutoFontResizingEnabled()
setAutoFontResizingEnabled(boolean)
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
public Printable getPrintable()
Printable
that will render the
Terminal
to a page.
This method returns an object that is suitable for use with the JDK 1.4 Printing APIs.
public void setSOSIDisplayStyle(int style)
style
- One of the following:
getSOSIDisplayStyle()
SOSI_DISPLAY_STYLE_LTGT
public int getSOSIDisplayStyle()
setSOSIDisplayStyle(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |