|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--unikix.clientapis.emulator.KixEmulator
A 3270 terminal emulator. It exposes a set of methods for direct emulator manipulation, along with methods for interrogating and setting the emulators appearance.
Also defined are the constants, which consists of the following groups:
This class can either be used as a standard visible 3270 emulator, or as an invisible 3270 emulator. If it is used as an invisible emulator, there is a performance advantage since it is not necessary to draw any updates to the screen.
The visibility of the emulator is rarely ever directly specified, but a KixEmulator becomes 'visible' when it is added to a Component hierarchy within a graphical java application/applet.
Programming Notes |
The KixEmulator 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.
Using these methods at their most basic level, a connection can be
established using code similar to the example below:
...
KixEmulator ke = new KixEmulator();
ke.setTN3270Host(myHost);
ke.setTN3270Port(myPort);
ke.connect();
ke.waitUntilConnected();
...
There are several methods that allow the programmer to 'interact' with
the emulator.
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:
...
ke.tab();
ke.typeString("Something");
ke.tab();
ke.typeString("SomethingElse");
ke.pressEnter();
ke.waitUntilKeyboardUnlocked();
ke.pressPF(3);
ke.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:
If you choose to display a KixEmulator, its appearance can be extensively
customized. Such things as the font, text and background colors, etc can
all be configured. For example:
...
ke.setBackground(Color.red);
ke.setFont(new Font("Monospaced",Font.PLAIN,15));
...
The KixEmulator is primarily designed as a TN3270 client, and as such deals primarily with 3270 datastreams. However, it is possible for the KixEmulator 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 KixEmulator 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 KixEmulator 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().
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
KixEmulator()
Construct a KixEmulator. |
|
KixEmulator(KixEmulator source)
Construct a KixEmulator. |
Method Summary | |
void |
addHighlightArea(int offset,
int length,
Color color)
Add an area of the 3270 display to be highlighted in the given Color. |
void |
addHighlightAreas(int[] offset,
int[] length,
Color[] color)
Add multiple areas of the 3270 display to be highlighted in the given Colors. |
void |
addKixEmulatorListener(KixEmulatorListener l)
Add a KixEmulatorListener. |
void |
addNotify()
|
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeListener to the listener list. |
void |
backspace()
Simulates the pressing of the backspace key on the keyboard. |
void |
backtab()
Simulates the pressing of the backtab key on the keyboard. |
int |
columnFromOffset(int offset)
Gets the column from a given offset. |
void |
connect()
Attempts to establish a connection to the specified host system. |
void |
cursorDown()
Moves the cursor down one character position. |
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 up one character position. |
void |
delete()
Simulates the pressing of the delete key on the keyboard. |
void |
disconnect()
Disconnects from the currently connected system. |
void |
disconnect(String msg)
Disconnects from the currently connected system. |
void |
dispose()
Disposes of the emulator and releases any resources that it is using. |
void |
dump(OutputStream os)
Perform a diagnostic dump of the state of the Emulator. |
void |
dump(PrintWriter pw)
Perform a diagnostic dump of the state of the Emulator. |
void |
eraseEndOfField()
Simulates the pressing of the EOF key on the keyboard. |
void |
eraseInput()
Simulates the pressing of the Erase Input key on the keyboard. |
KixField |
findField(int offset)
Get the field that contains the given offset. |
void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
Color |
getBackground()
Get the Background Color of the terminal. |
Insets |
getBoundary()
Returns an Insets object representing the 'freespace' around the emulator. |
short[] |
getCharSetBuffer()
Gets a copy of the charset buffer. |
char[] |
getColorBuffer()
Gets a copy of the color buffer. |
int |
getColumns()
Get the number of columns of the terminal. |
int |
getColumnWidth()
Returns the width of a single column of the emulator in pixels. |
int |
getConnectionState()
Gets the connection state of the terminal. |
String |
getCopyrightString()
This method returns the Sun Copyright String. |
int |
getCursorColumn()
Get the column of the emulator containing the cursor. |
int |
getCursorOffset()
Get the offset of the cursor in the current 3270 buffer. |
int |
getCursorRow()
Get the row of the emulator containing the cursor. |
char[] |
getDisplayBuffer()
Gets a copy of the display buffer. |
int |
getDisplaySize()
Get the display size of the terminal in characters. |
char[] |
getExtendedAttributeBuffer()
Gets a copy of the extended attribute buffer. |
Color[] |
getExtendedColors()
Get the Extended Color Map. |
Color |
getExtendedColors(int index)
Get 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()
Gets the boolean value of whether ForceEWA is set or not. |
String |
getHostCodepage()
Gets the EBCDIC codepage used for conversion of characters to and from the 3270 host system. |
String |
getIdentifierString()
This method returns a String that identifies the version and build level of this Bean. |
Color |
getInsertCursorColor()
Get the Insert Cursor Color. |
int |
getInsertCursorStyle()
Get the Insert Cursor Style. |
boolean |
getKeyHandling()
Determine if the emulator is to use the default keyboard handling. |
int |
getLastDisconnectionReason()
Gets the reason for the last disconnection of the terminal. |
String |
getLastDisconnectionString()
Gets the reason for the last disconnection of the terminal as a String. |
int |
getMaximumColumns()
Get the maximum number of columns of the terminal. |
int |
getMaximumDisplaySize()
Get the maximum display size of the terminal in characters. |
int |
getMaximumRows()
Get the maximum number of rows of the terminal. |
Dimension |
getMinimumSize()
|
int |
getModel()
Get the Model of the terminal. |
String |
getNetname()
Get the Netname used for the current 3270 session. |
int |
getNetworkInactivityTimeout()
Get the Network Inactivity Timeout for the remote connection. |
boolean |
getNumericInputValidation()
Determine whether validation is performed of characters typed in numeric fields |
Color |
getOvertypeCursorColor()
Get the Overtype Cursor Color. |
int |
getOvertypeCursorStyle()
Get the Overtype Cursor Style. |
String |
getPreferredNetname()
When connecting to a TN3270E server, it is possible to specify a netname that a terminal wishes to connect as. |
Dimension |
getPreferredSize()
|
int |
getPrintStyle()
Get the style of printing. |
Color |
getProtectedIntenseColor()
Get the Protected Intense Color. |
Color |
getProtectedNormalColor()
Get the Protected Normal Color of the terminal. |
String |
getReadableString(int offset,
int length)
Get a portion of the screen as a human readable string. |
int |
getRowHeight()
Returns the height of a single row of the emulator in pixels. |
int |
getRows()
Get the number of rows of the terminal. |
Color |
getStatusBarBackground()
Get the Status Bar Background. |
Color |
getStatusBarForeground()
Get the Status Bar Foreground. |
int |
getTerminalMode()
Gets the current terminal mode. |
String |
getTN3270Host()
Gets the TN3270 Host value of the terminal. |
int |
getTN3270Port()
Get the TN3270 Port value of the terminal. |
Color |
getUnprotectedIntenseColor()
Get the Unprotected Intense Color of the terminal. |
Color |
getUnprotectedNormalColor()
Get the Unprotected Normal Color of the terminal. |
void |
home()
Simulates the pressing of the home key on the keyboard. |
boolean |
isCapturingData()
Determine if the emulator is to capture histories of data for use in dumping at a future time. |
boolean |
isCharFlashing(int offset)
Return true if the character is flashing. |
boolean |
isCharFlashing(int row,
int column)
Return true if the character is flashing. |
boolean |
isCharReversed(int offset)
Return true if the character is reversed. |
boolean |
isCharReversed(int row,
int column)
Return true if the character is reversed. |
boolean |
isCharUnderlined(int offset)
Return true if the character is underlined. |
boolean |
isCharUnderlined(int row,
int column)
Return true if the character is underlined. |
boolean |
isConnected()
Return true if the terminal is in a connected state. |
boolean |
isConnecting()
Return true if the terminal is in a connecting state. |
boolean |
isDisconnected()
Return true if the terminal is in a disconnected state. |
boolean |
isDisconnecting()
Return true if the terminal is in a disconnecting state. |
boolean |
isFormatted()
Return true if the terminal display is formatted. |
boolean |
isInsertCursorFlashing()
Determine whether the Insert Cursor should flash or not. |
boolean |
isInserting()
Return true if insert mode is operational. |
boolean |
isKeyboardInitiallyUnlocked()
This determines whether to unlock the keyboard on receiving the first datastream from the host. |
boolean |
isKeyboardLocked()
Return true if the keyboard is locked. |
boolean |
isOvertypeCursorFlashing()
Determine whether the Overtype Cursor should flash or not. |
boolean |
isStatusBarShowing()
Determine whether the visible emulator should have a Status Bar on it. |
boolean |
isSysreqAllowed()
This method is used to determine if the use of pressSysreq() is allowed. |
boolean |
isTN3270EAllowed()
Allow the KixEmulator 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 screen. |
void |
moveCursorToRowColumn(int row,
int column)
Moves the cursor to the specified row,column on the screen. |
void |
newline()
Simulates the pressing of the newline key on the keyboard. |
int |
offsetFromPoint(int x,
int y)
Return the offset value given the x,y screen pixel position. |
int |
offsetFromPoint(Point p)
Return the offset value given a Point p screen pixel position. |
int |
offsetFromRowColumn(int row,
int column)
Return the offset value given a row, column pair. |
void |
paint(Graphics g)
|
void |
pressATTN()
Simulate the pressing of the ATTN key. |
void |
pressClear()
Simulates the pressing of the clear key on the keyboard. |
void |
pressCursorSelect()
Simulates the pressing of the Cursor Select key on the keyboard. |
void |
pressDUP()
Simulates the pressing of the DUP key on the keyboard. |
void |
pressEnter()
Simulates the pressing of the enter key on the keyboard. |
void |
pressFieldMark()
Simulates the pressing of the Field Mark key on the keyboard. |
void |
pressPA(int key)
Simulates the pressing of the specified PA key on the keyboard. |
void |
pressPF(int key)
Simulates the pressing of the specified PF key on the keyboard. |
void |
pressReset()
Simulates the pressing of the Reset key on the keyboard. |
void |
pressSysreq()
Simulate the pressing of the SYSREQ key. |
void |
print(Graphics g)
|
void |
printAll(Graphics g)
|
void |
removeAllHighlightAreas()
Remove all the highlighted areas from the screen. |
void |
removeKixEmulatorListener(KixEmulatorListener l)
Remove a KixEmulatorListener. |
void |
removeNotify()
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeListener from the listener list. |
int |
rowFromOffset(int offset)
Gets the row from a given offset. |
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)
Define if the emulator is to capture histories of data for use in dumping at a future time. |
void |
setDebugDestination(PrintWriter pw)
Output debug information to the supplied PrintWriter |
void |
setEnabled(boolean b)
|
void |
setExtendedColors(Color[] c)
Set 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)
Set 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 terminal font to the specified font. |
void |
setForceEWA(boolean b)
Treat all datastreams that come in as being 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)
Set the Insert Cursor Color. |
void |
setInsertCursorFlashing(boolean b)
Set whether the Insert Cursor should flash or not. |
void |
setInsertCursorStyle(int style)
Set the Insert Cursor Style. |
void |
setInserting(boolean insertMode)
Set the insert mode. |
void |
setKeyboardInitiallyUnlocked(boolean b)
This determines whether to unlock the keyboard on receiving the first datastream from the host. |
void |
setKeyHandling(boolean b)
Set whether the emulator is to use the default keyboard handling or not. |
void |
setModel(int newModel)
Set the Model to the specified int. |
void |
setNetworkInactivityTimeout(int seconds)
Set the Network Inactivity Timeout for the remote connection. |
void |
setNumericInputValidation(boolean b)
Control whether validation is performed of characters typed in numeric fields |
void |
setOvertypeCursorColor(Color c)
Set the overtype cursor color. |
void |
setOvertypeCursorFlashing(boolean b)
Set whether the Overtype Cursor should flash or not. |
void |
setOvertypeCursorStyle(int style)
Set the Overtype Cursor Style. |
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)
Set the style of printing to be used. |
void |
setProtectedIntenseColor(Color c)
Set the Protected Intense Color to the specified color. |
void |
setProtectedNormalColor(Color c)
Sets the Protected Normal Color to the specified color. |
void |
setStatusBarBackground(Color c)
Set the Status Bar Background to the specified color. |
void |
setStatusBarForeground(Color c)
Set the Status Bar Foreground to the specified color. |
void |
setStatusBarShowing(boolean displayValue)
Set whether the visible emulator should have a Status Bar on it. |
void |
setTN3270EAllowed(boolean b)
Allow the KixEmulator to use the TN3270E protocol (as defined in RFC 1647 and RFC 2355). |
void |
setTN3270Host(String newHost)
Set the TN3270 Host to the specified String. |
void |
setTN3270Port(int newPort)
Set the TN3270 Port to the specified int. |
void |
setUnprotectedIntenseColor(Color c)
Set the Unprotected Intense Color to the specified color. |
void |
setUnprotectedNormalColor(Color c)
Sets the terminal Unprotected Normal Color to the specified color. |
void |
tab()
Simulates the pressing of the tab key on the keyboard. |
void |
typeChar(char c)
Types a character on the emulator at the current cursor position. |
void |
typeCharNVT(char c)
Types a character on the emulator at the current cursor position. |
void |
typeString(String s)
Types a string on the emulator at the current cursor position. |
void |
update(Graphics g)
|
void |
waitHeuristic(int timeInMillis)
Wait for a response from the host in a heuristic manner. |
void |
waitUntilConnected()
Wait until the emulator is connected. |
void |
waitUntilDisconnected()
Wait until the emulator is disconnected. |
void |
waitUntilKeyboardUnlocked()
Wait until the emulator keyboard is unlocked. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
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_REVERSE
public static final int PRINTSTYLE_WHITE_ON_BLACK
public static final int PRINTSTYLE_BLACK_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_NOT_TN3270_HOST
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_DEFAULT
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 KixEmulator()
public KixEmulator(KixEmulator source)
Operations of a non-display oriented nature on one of the KixEmulator objected will be reflected by the other.
Operations of a display oriented nature on one will not be reflected by the other.
source
- The KixEmulator upon which the new one is to be based.Method Detail |
public void update(Graphics g)
public void paint(Graphics g)
public void print(Graphics g)
public void printAll(Graphics g)
public void removeNotify()
public void addNotify()
public String getCopyrightString()
public String getIdentifierString()
public boolean isKeyboardLocked()
public void setTN3270Host(String newHost)
newHost
- The TN3270 HostgetTN3270Host()
public String getTN3270Host()
setTN3270Host(java.lang.String)
public void setTN3270Port(int newPort)
newPort
- The TN3270 portgetTN3270Port()
public int getTN3270Port()
setTN3270Port(int)
public void setModel(int newModel)
MODEL_3278_2_E
.newModel
- The TN3270 model - this should be
to one of the MODEL_XXXX
constant values defined in
this class.getModel()
public int getModel()
MODEL_XXXX
constant values defined in
this class.setModel(int)
public void setNetworkInactivityTimeout(int seconds)
IMPORTANT NOTE: The calling of this method when the KixEmulator is CONNECTED is known to be unreliable in some Java environments. It is highly recommended that this method is only called when the KixEmulator 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()
public int getMaximumColumns()
public int getMaximumDisplaySize()
public int getRows()
public int getColumns()
public int getDisplaySize()
public int getConnectionState()
CONNECTION_STATE_XXXX
constant values defined
in this class.public boolean isConnected()
isConnecting()
,
isDisconnected()
,
isDisconnecting()
public boolean isConnecting()
isConnected()
,
isDisconnected()
,
isDisconnecting()
public boolean isDisconnected()
isConnected()
,
isConnecting()
,
isDisconnecting()
public boolean isDisconnecting()
isConnected()
,
isConnecting()
,
isDisconnected()
public int getLastDisconnectionReason()
DISC_REASON_XXXX
constant values defined
in this class.public String getLastDisconnectionString()
public void connect()
disconnect()
,
disconnect(java.lang.String)
public void disconnect()
disconnect(java.lang.String)
,
connect()
public void disconnect(String msg)
msg
- The string to be displayed in the disconnection message on
a visible KixEmulator. If null then the default message is used.disconnect()
,
connect()
public int getCursorRow()
public int getCursorColumn()
public int getCursorOffset()
public Vector getFields()
If this method is performed on an unformatted screen, an empty vector is returned.
findField(int)
public boolean isFormatted()
public boolean isCharUnderlined(int offset)
offset
- The offset positionisCharUnderlined(int, int)
public boolean isCharUnderlined(int row, int column)
row
- The row of the charactercolumn
- The column of the characterisCharUnderlined(int)
public boolean isCharReversed(int offset)
offset
- The offset positionisCharReversed(int, int)
public boolean isCharReversed(int row, int column)
row
- The row of the charactercolumn
- The column of the characterisCharReversed(int)
public boolean isCharFlashing(int offset)
offset
- The offset positionisCharFlashing(int, int)
public boolean isCharFlashing(int row, int column)
row
- The row of the charactercolumn
- The column of the characterisCharFlashing(int)
public void setInserting(boolean insertMode)
insertMode
- The insert modeisInserting()
public boolean isInserting()
setInserting(boolean)
public void cursorLeft()
cursorRight()
,
cursorDown()
,
cursorUp()
public void cursorRight()
cursorLeft()
,
cursorDown()
,
cursorUp()
public void cursorUp()
DBCS Considerations: If an attempt is made to move the cursor up onto the second display position of a DBCS character, then this fact is logged and the cursor is moved onto the first character of the DBCS character. If the cursor is subsequently moved off the DBCS character, this cursor-adjustment is undone where appropriate, e.g. if the cursor is moved back down.
cursorLeft()
,
cursorRight()
,
cursorDown()
public void cursorDown()
DBCS Considerations: If an attempt is made to move the cursor down onto the second display position of a DBCS character, then this fact is logged and the cursor is moved onto the first character of the DBCS character. If the cursor is subsequently moved off the DBCS character, this cursor-adjustment is undone where appropriate, e.g. if the cursor is moved back up.
cursorLeft()
,
cursorRight()
,
cursorUp()
public void tab()
backtab()
public void backtab()
tab()
public void newline()
public void home()
public void typeChar(char c)
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.
DBCS Considerations:
c
- The character to be typed on the emulatorpublic void typeCharNVT(char c)
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 emulatorpublic void typeString(String s)
Calls to this method are not valid when the Terminal Mode is NVT.
DBCS Considerations:
s
- The String to be typed on the emulatorpublic void eraseEndOfField()
public void eraseInput()
public void delete()
public void backspace()
public char[] getDisplayBuffer()
public String getReadableString(int offset, int length)
DBCS Considerations:
offset
- The start offset of the desired display arealength
- The length of the desired display areatypeString(java.lang.String)
public char[] getExtendedAttributeBuffer()
public char[] getColorBuffer()
public short[] getCharSetBuffer()
public void pressEnter()
This method is not valid when the terminal is in NVT mode. typeCharNVT() should be used in that case.
public void pressPF(int key)
key
- PF key to presspublic void pressPA(int key)
key
- PA key to presspublic void pressClear()
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() method to simulate a light-pen.
public void setFont(Font NewFont)
newFont
- The fontgetFont()
public Font getFont()
setFont(java.awt.Font)
public void setBackground(Color c)
c
- The Background ColorgetBackground()
public Color getBackground()
setBackground(java.awt.Color)
public void setUnprotectedNormalColor(Color c)
c
- The Unprotected Normal ColorgetUnprotectedNormalColor()
public Color getUnprotectedNormalColor()
setUnprotectedNormalColor(java.awt.Color)
public void setProtectedNormalColor(Color c)
c
- The Protected Normal ColorgetProtectedNormalColor()
public Color getProtectedNormalColor()
setProtectedNormalColor(java.awt.Color)
public void setUnprotectedIntenseColor(Color c)
c
- The Unprotected Intense ColorgetUnprotectedIntenseColor()
public Color getUnprotectedIntenseColor()
setUnprotectedIntenseColor(java.awt.Color)
public void setProtectedIntenseColor(Color c)
c
- The Protected Intense ColorgetProtectedIntenseColor()
public Color getProtectedIntenseColor()
setProtectedIntenseColor(java.awt.Color)
public void setStatusBarBackground(Color c)
c
- The Status Bar Background ColorgetStatusBarBackground()
public Color getStatusBarBackground()
setStatusBarBackground(java.awt.Color)
public void setStatusBarForeground(Color c)
c
- The Status Bar Foreground colorgetStatusBarForeground()
public Color getStatusBarForeground()
setStatusBarForeground(java.awt.Color)
public void setExtendedColors(Color[] c)
c
- The extended color map.getExtendedColors()
public void setExtendedColors(int index, Color c)
index
- The indexc
- The ColorgetExtendedColors(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_XXXX
values describe a set of ways that
printing can be handled.style
- The PrintStyle - an int that should corrolate
to one of the PRINTSTYLE
constant values defined in this
class.getPrintStyle()
public int getPrintStyle()
PRINTSTYLE
constant values defined in this
class.setPrintStyle(int)
public void setStatusBarShowing(boolean displayValue)
displayValue
- The status bar showing valueisStatusBarShowing()
public boolean isStatusBarShowing()
setStatusBarShowing(boolean)
public void setOvertypeCursorStyle(int style)
style
- The Overtype Cursor Style - an int that should corrolate
to one of the Cursor constant values defined in this class.getOvertypeCursorStyle()
public int getOvertypeCursorStyle()
setOvertypeCursorStyle(int)
public void setOvertypeCursorColor(Color c)
c
- The Overtype Cursor ColorgetOvertypeCursorColor()
public Color getOvertypeCursorColor()
setOvertypeCursorColor(java.awt.Color)
public void setOvertypeCursorFlashing(boolean b)
b
- True to make the cursor flash.isOvertypeCursorFlashing()
public boolean isOvertypeCursorFlashing()
setOvertypeCursorFlashing(boolean)
public void setInsertCursorStyle(int style)
style
- The Insert Cursor Style - this should be
one of the CURSOR_XXXX
constant values defined in this
class.getInsertCursorStyle()
public int getInsertCursorStyle()
CURSOR_XXXX
constant values defined in this
class.setInsertCursorStyle(int)
public void setInsertCursorColor(Color c)
c
- The Insert Cursor ColorgetInsertCursorColor()
public Color getInsertCursorColor()
setInsertCursorColor(java.awt.Color)
public void setInsertCursorFlashing(boolean b)
b
- True to make the cursor flash.isInsertCursorFlashing()
public boolean isInsertCursorFlashing()
setInsertCursorFlashing(boolean)
public KixField findField(int offset)
This method returns null if the screen is unformatted.
offset
- the offset valuegetFields()
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 valuecolumn
- The given column valuerowFromOffset(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 offsetoffsetFromRowColumn(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 offsetoffsetFromRowColumn(int,int)
,
rowFromOffset(int)
public int offsetFromPoint(int x, int y)
x
- The x screen pixel positiony
- The y screen pixel positionoffsetFromPoint(java.awt.Point)
public int offsetFromPoint(Point p)
p
- The screen pixel positionoffsetFromPoint(int, int)
public void addHighlightArea(int offset, int length, Color color)
offset
- The start offset of the arealength
- The length of the areacolor
- The color of the arearemoveAllHighlightAreas()
public void addHighlightAreas(int[] offset, int[] length, Color[] color)
offset
- An array of start offsets of each arealength
- An array of lengths of each areacolor
- An array of colors of each arearemoveAllHighlightAreas()
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 addPropertyChangeListener(PropertyChangeListener l)
l
- The PropertyChangeListener to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener l)
l
- The PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)
public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
public void addKixEmulatorListener(KixEmulatorListener l)
l
- The KixEmulatorListener to be addedremoveKixEmulatorListener(unikix.clientapis.emulator.KixEmulatorListener)
public void removeKixEmulatorListener(KixEmulatorListener l)
l
- The KixEmulatorListener to be removedaddKixEmulatorListener(unikix.clientapis.emulator.KixEmulatorListener)
public void setKeyHandling(boolean b)
b
- True to use the default key handlinggetKeyHandling()
public boolean getKeyHandling()
setKeyHandling(boolean)
public void setEnabled(boolean b)
public void setForceEWA(boolean b)
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. |
b
- Force or NotgetForceEWA()
public boolean getForceEWA()
setForceEWA(boolean)
public void setForceInitialEW(boolean b)
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. |
This method should be called before calling the connect() method.
b
- Force or Notpublic void pressDUP()
public void pressFieldMark()
public void pressReset()
public void moveCursorToOffset(int offset)
offset
- The cursor offset
DBCS Considerations: If an attempt is made to move the cursor onto the second display position of a DBCS character, then this fact is logged and the cursor is moved onto the first character of the DBCS character. If the cursor is subsequently moved off the DBCS character, this cursor-adjustment is undone where appropriate, e.g. if the cursor is moved up or down.
public void moveCursorToRowColumn(int row, int column)
DBCS Considerations: If an attempt is made to move the cursor onto the second display position of a DBCS character, then this fact is logged and the cursor is moved onto the first character of the DBCS character. If the cursor is subsequently moved off the DBCS character, this cursor-adjustment is undone where appropriate, e.g. if the cursor is moved up or down.
row
- The cursor rowcolumn
- The cursor columnpublic void waitUntilConnected()
connect()
public void waitUntilDisconnected()
public void waitUntilKeyboardUnlocked()
public void waitHeuristic(int timeInMillis)
timeInMillis
- The time to wait for host activity before concluding that no further
sends from the host are going to occur.public void dispose()
public int getRowHeight()
This returns 0 if the emulator has not been shown.
getColumnWidth()
public int getColumnWidth()
This returns 0 if the emulator has not been shown.
getRowHeight()
public Insets getBoundary()
A negative values for parts of the Insets object represent the emulator requiring more space to display itself properly than has been provided by the setting of the sice of this component.
public boolean isKeyboardInitiallyUnlocked()
The default value is false.
setKeyboardInitiallyUnlocked(boolean)
public void setKeyboardInitiallyUnlocked(boolean b)
The default value is false.
b
- The new initial keyboard locked stateisKeyboardInitiallyUnlocked()
public void setHostCodepage(String s)
s
- The new codepage. This should be specified as one of the
CODEPAGE_XXXX
constants.public String getHostCodepage()
CODEPAGE_XXXX
constants.public int getTerminalMode()
TERMINAL_MODE_NONE
TERMINAL_MODE_NVT
TERMINAL_MODE_3270_NORMAL
TERMINAL_MODE_3270_SUSPEND
public void pressSysreq()
isSysreqAllowed()
public void pressATTN()
public boolean isSysreqAllowed()
pressSysreq()
public String getNetname()
setPreferredNetname(java.lang.String)
public void setPreferredNetname(String name)
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 NetnamegetPreferredNetname()
public String getPreferredNetname()
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)
The default is true.
b
- Allow TN3270EgetPreferredNetname()
public boolean isTN3270EAllowed()
The default is true.
getPreferredNetname()
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 usepublic 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 KixEmulators that share the same connection, i.e. those created using the constructor 'public KixEmulator(KixEmulator source)'
b
- The new value.public void setCapturingData(boolean b)
This method should be used under the direction of the support organization.
true
- if data is to be captured.dump(java.io.PrintWriter)
public boolean isCapturingData()
This method should be used under the direction of the support organization.
dump(java.io.PrintWriter)
public void dump(PrintWriter pw)
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)
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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |