|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object no.gar.glink.api.GlinkApi no.gar.glink.api.GlinkApiDebug
public class GlinkApiDebug
Debug version of GlinkApi. This class is just a wrapper around the GlinkApi, tracing public calls to timestamped files in <glinkdir>/apitrace.
The purpose of the class is to allow basic debugging and profiling of the API.
Debugging is enabled by clients calling one of the GlinkApi.createApi() methods instead of instantiating GlinkApi directly, passing 'true' for the debug argument.
See Javadoc comments in GlinkApi for further method descriptions.
Field Summary |
---|
Fields inherited from class no.gar.glink.api.GlinkApi |
---|
ASCII_TO_EBCDIC, EBCDIC_TO_ASCII, SCREEN_FORMATTED, SCREEN_UNFORMATTED, SCREEN_UNFORMATTED_CHAR, SEARCH_BACKWARD, SEARCH_FORWARD |
Constructor Summary | |
---|---|
GlinkApiDebug()
|
|
GlinkApiDebug(java.applet.Applet ap)
|
|
GlinkApiDebug(GlinkApi anotherApi)
|
Method Summary | |
---|---|
void |
addConfiguration(GlinkConfiguration glinkConfiguration)
Adds the configuration to the list of available sessions. |
void |
addGlinkEventListener(GlinkEventListener listener)
Specifies the listener which is to receive Glink events. |
void |
connect()
Connects to the session specified with the sessionName() method. |
void |
debugStart(java.io.PrintWriter debugStream)
Start or restart Glink debugging, send output to a stream. |
void |
debugStop()
Stop Glink debugging. |
void |
disconnect()
Disconnects the current session. |
void |
emulate(java.lang.String hostData)
This method emulates a string locally. |
java.lang.String |
fieldRead(int fieldNum)
Returns the data for the given variable field. |
java.awt.Point |
findString(java.lang.String str,
java.awt.Point start,
int length,
int direction,
boolean caseSensitive)
Searches the text plane for the given string. |
void |
flushGlinkEvents()
Flushes the GlinkEvent queue. |
int[] |
getAttributes(java.awt.Point start,
int len)
Returns the attributes for the target area |
int[] |
getAttributes(java.awt.Point start,
java.awt.Point end)
Returns the attributes for the target area |
java.util.Vector |
getAvailableSessions()
Returns the sessions configured. |
int |
getBackgroundColor(int attribute)
Returns the RGB value for the given field or character attribute. |
int |
getColumns()
Returns the number of columns in the presentation space. |
int |
getCommunicationProtocol()
Returns the current communication protocol. |
java.lang.String |
getConfigParameter(java.lang.String name)
Returns the value as a string for the specified parameter name. |
java.awt.Point |
getCursor()
Returns the current cursor position. |
byte[] |
getDataBytes(java.awt.Point start,
int len)
Returns the screen characters (bytes) for the target area in the configured character set |
byte[] |
getDataBytes(java.awt.Point start,
java.awt.Point end)
Returns the screen characters (bytes) for the target area in the configured character set |
char[] |
getDataChars(java.awt.Point start,
int len)
Returns the screen characters for the target area |
char[] |
getDataChars(java.awt.Point start,
java.awt.Point end)
Returns the screen characters for the target area |
int |
getDataLength(java.awt.Point start,
java.awt.Point end)
Returns the length for the target area. |
int |
getDefaultColorAttribute()
Returns the default color attribute settings. |
int |
getEmulationType()
Returns the current emulation type. |
GlinkFields |
getFields()
Returns the GlinkFields object associated with the current screen. |
GlinkFields |
getFieldsEx()
Returns the GlinkFields object associated with the current screen. |
int |
getForegroundColor(int attribute)
Returns the RGB value for the given field or character attribute. |
java.awt.Container |
getGlinkContainer()
Returns the object that contains all the visible Glink components. |
GlinkEvent |
getGlinkEvent(int eventCode,
long timeout)
Returns the first GlinkEvent available from the GlinkEvent queue. |
java.awt.Frame |
getGlinkFrame()
Returns the Glink frame. |
java.lang.String |
getGlinkVersion()
Returns the Glink version information as a text string. |
java.util.Vector |
getInteractiveComParams()
Returns the interactive communication parameters. |
GlinkScreenArea |
getMarkedScreenArea()
Returns a screen area object for the current screen selection. |
java.lang.String |
getProperty(java.lang.String ky)
Returns the the property for the given key. |
int |
getRows()
Returns the number of rows in the presentation space. |
GlinkScreenArea |
getScreenArea(java.awt.Point start,
java.awt.Point end,
boolean rect)
Returns an object for the given screen area or null if the positions given are not within the current screen. |
java.lang.String |
getScreenCharacterSet()
Returns the name of the character set configured. |
int |
getScreenMode()
If the host application has used field attributes to define fields on the screen, then the current screen is formatted. |
java.lang.String |
getSessionName()
Returns the name of the current session |
java.lang.String |
getString()
Returns the entire text plane of the presentation space as a string. |
java.lang.String |
getString(java.awt.Point start,
java.awt.Point end)
Returns the text at the given location in the presentation space as a string. |
GlinkFields |
getVariableFields()
Returns the GlinkFields object associated with the current screen with variable fields only. |
GlinkFields |
getVariableFieldsEx()
Returns the GlinkFields object associated with the current screen with variable fields only. |
boolean |
isScreenAreaMatch(GlinkScreenArea sa)
Returns true if the supplied GlinkScreenArea object matches the current screen. |
boolean |
isSessionAvailable(java.lang.String name,
java.util.Vector sessions)
Returns true if the given session is available. |
void |
markScreenArea(java.awt.Point start,
java.awt.Point end,
boolean rect)
This method marks the given screen area. |
java.lang.String |
messageModeReceive()
This method returns the string of characters received from the host since the last time this method was called. |
byte[] |
messageModeReceiveBytes()
This method returns the byte array received from the host since the last time this method or messageModeReceive() was called. |
byte[] |
messageModeReceiveBytesSync()
This method waits until the turn has been received from the host and then returns the byte array of characters received, in the host native character set. |
byte[] |
messageModeReceiveBytesSync(int maxlen)
This method waits until the requested number of characters has been received from the host before it returns these. |
java.lang.String |
messageModeReceiveSync()
This method waits until the turn has been received from the host and then returns the string of characters received. |
java.lang.String |
messageModeReceiveSync(int maxlen)
This method waits until the requested number of characters has been received from the host before it returns these. |
void |
messageModeSend(java.lang.String s)
This method bypasses the Glink emulation and sends the string directly to the host. |
void |
messageModeSend(java.lang.String s,
boolean passTurn)
This method bypasses the Glink emulation and sends a string directly to the host. |
void |
messageModeSendBytes(byte[] s,
int offset,
int len)
This method bypasses the Glink emulation and sends a byte array directly to the host. |
void |
messageModeSendBytes(byte[] s,
int offset,
int len,
boolean passTurn)
This method bypasses the Glink emulation and sends a byte array directly to the host. |
void |
notifyCommandKey(int commandKey)
Instructs Glink to fire a GlinkEvent.COMMAND_KEY_TYPED event when the given command key is typed. |
void |
notifyDataBlocks(boolean enable)
Turns on of off posting of GlinkEvent.DATA_BLOCK events. |
void |
notifyGlinkEvent(int eventCode)
|
void |
notifyGlinkEvent(int eventCode,
int value,
java.lang.String valueText)
|
void |
notifyKey(int ky)
Instructs Glink to fire a GlinkEvent.KEY_TYPED event when the given key is typed. |
void |
notifyScreenArea(GlinkScreenArea screenArea,
int id,
boolean removeAfterwards)
Instructs Glink to fire a GlinkEvent.SCREEN_AREA_MATCH event when the given object matches the current screen. |
void |
notifyString(java.lang.String s,
boolean caseSensitive,
int id,
boolean removeAfterwards)
Instructs Glink to fire a GlinkEvent.STRING_RECEIVED event when the given string is received from host. |
void |
queueGlinkEvents(boolean enable)
Enables or disables the queuing of GlinkEvents. |
void |
removeConfiguration(GlinkConfiguration glinkConfiguration)
Removes the configuration previously set with the addConfiguration method. |
void |
removeGlinkEventListener(GlinkEventListener listener)
Removes the specified listener set with the addGlinkEventListener method. |
void |
removeNotifyCommandKey(int commandKey)
Removes the notification for the command key previously set with the notifyCommandKey method. |
void |
removeNotifyKey(int ky)
Removes the notification for the key previously set with the notifyKey method. |
boolean |
removeNotifyScreenArea(int id)
Removes the GlinkScreenArea object associated with the given identity from the list of objects being checked for a match. |
boolean |
removeNotifyString(int id)
Removes the string associated with the given identity from the list of strings being checked for. |
boolean |
restoreScreenContent(java.lang.String fileName)
Restores the screen previously saved. |
boolean |
saveScreenContent(java.lang.String fileName)
Saves the current screen content to the file specified. |
void |
scriptCommand(java.lang.String command)
Activates the given script command. |
void |
scriptFile(java.lang.String fileName)
Activates the given script file. |
void |
scriptTerminate()
Terminates the current script. |
void |
sendCommandKey(int ky)
The sendCommandKey method sends a "command" keystroke to the virtual screen. |
void |
sendKeys(java.lang.String text)
Sends a string to the emulator starting at the current cursor location. |
void |
sendKeys(java.lang.String text,
java.awt.Point location)
Sends a string to the emulator starting at the given cursor location. |
void |
setCursor(int x,
int y)
Moves the cursor to the given position. |
void |
setCursor(java.awt.Point location)
Moves the cursor to the given position. |
void |
setInteractiveComParams(java.util.Vector params)
Sets the interactive communication parameters. |
void |
setParameter(java.lang.String param)
Add a configuration parameter to the glink.ini set. |
void |
setParentFrame(java.awt.Frame fr)
Normally Glink starts up in its own frame. |
boolean |
setRestrictedMode(java.lang.String ky,
int level)
Switch restricted mode on or off. |
void |
setScreenSize(int columns,
int rows)
For most emulations the screen size is 80 columns times 24 rows. |
void |
setString(java.lang.String text,
java.awt.Point location)
The setString method sends a string to the virtual screen at the specified location. |
void |
setVisible(boolean visible)
Specifies whether the Glink screen (frame) should be visible or not. |
void |
start()
Starts Glink. |
void |
stop()
Stops Glink. |
java.lang.String |
translateBuffer(java.lang.String buffer,
int direction)
Translate a string between ASCII and EBCDIC. |
Methods inherited from class no.gar.glink.api.GlinkApi |
---|
configBase, configLanguage, configServer, createApi, createApi, createApi, fileBase, isConnected, isSplashScreenVisible, isStarted, isTurnKnown, isTurnReceived, isVisible, messageModeBufferOverwrite, messageModeOff, messageModeOn, messageModeOn, noToolbar, requestFocus, sendMacro, serverPort, sessionName, setGlinkDirectory, setSplashScreenVisible, suppressTurnLostEvents, userName, userPassword |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GlinkApiDebug()
public GlinkApiDebug(java.applet.Applet ap)
public GlinkApiDebug(GlinkApi anotherApi)
Method Detail |
---|
public void addConfiguration(GlinkConfiguration glinkConfiguration)
GlinkApi
Restricted
addConfiguration
in class GlinkApi
GlinkApi.sessionName
,
GlinkConfiguration
public void addGlinkEventListener(GlinkEventListener listener)
GlinkApi
addGlinkEventListener
in class GlinkApi
GlinkEvent
public void connect()
GlinkApi
Restricted
connect
in class GlinkApi
GlinkApi.sessionName
public void debugStart(java.io.PrintWriter debugStream)
GlinkApi
Restricted
debugStart
in class GlinkApi
debugStream
- destination stream for debug outputGlinkApi.debugStop()
public void debugStop()
GlinkApi
Restricted
debugStop
in class GlinkApi
GlinkApi.debugStart(java.io.PrintWriter)
public void disconnect()
GlinkApi
Restricted
disconnect
in class GlinkApi
public void emulate(java.lang.String hostData)
GlinkApi
emulate
in class GlinkApi
GlinkApi.messageModeOn()
public java.lang.String fieldRead(int fieldNum)
GlinkApi
fieldRead
in class GlinkApi
fieldNum
- The variable field number where 1 is the first variable field
and 0 means the current field.
public java.awt.Point findString(java.lang.String str, java.awt.Point start, int length, int direction, boolean caseSensitive)
GlinkApi
findString
in class GlinkApi
str
- The string for which to search.start
- The row and column in which to start. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the search).length
- The length from startPos to include in the search.direction
- Search direction value:
Constant | Value | Description |
---|---|---|
SEARCH_FORWARD | 0 | Forward (beginning towards end) |
SEARCH_BACKWARD | 1 | Backward (end towards beginning) |
caseSensitive
- Indicates whether the search is to be case sensitive.
True means the search will be case sensitive.
public void flushGlinkEvents()
GlinkApi
flushGlinkEvents
in class GlinkApi
GlinkApi.getGlinkEvent(int, long)
,
GlinkApi.queueGlinkEvents(boolean)
public int[] getAttributes(java.awt.Point start, int len)
GlinkApi
getAttributes
in class GlinkApi
start
- The row and column in which to start.len
- The length (number of attributes integer) from startPos.Attribute format.
public int[] getAttributes(java.awt.Point start, java.awt.Point end)
GlinkApi
getAttributes
in class GlinkApi
GlinkApi.getAttributes(java.awt.Point, int)
,
Attribute format.
public java.util.Vector getAvailableSessions()
GlinkApi
Restricted
getAvailableSessions
in class GlinkApi
GlinkApi.getAvailableSessions()
,
GlinkApi.userName(java.lang.String)
,
GlinkApi.userPassword(java.lang.String)
,
GlinkApi.configServer(java.lang.String)
,
GlinkApi.serverPort(java.lang.String)
,
GlinkApi.setGlinkDirectory(java.lang.String)
,
GlinkEvent.VE_SESSIONS_ERROR
public int getBackgroundColor(int attribute)
GlinkApi
getBackgroundColor
in class GlinkApi
GlinkField
public int getColumns()
GlinkApi
getColumns
in class GlinkApi
public int getCommunicationProtocol()
GlinkApi
getCommunicationProtocol
in class GlinkApi
GlinkConfiguration
public java.lang.String getConfigParameter(java.lang.String name)
GlinkApi
getConfigParameter
in class GlinkApi
setParameter
public java.awt.Point getCursor()
GlinkApi
getCursor
in class GlinkApi
public byte[] getDataBytes(java.awt.Point start, int len)
GlinkApi
getDataBytes
in class GlinkApi
public byte[] getDataBytes(java.awt.Point start, java.awt.Point end)
GlinkApi
getDataBytes
in class GlinkApi
public char[] getDataChars(java.awt.Point start, int len)
GlinkApi
getDataChars
in class GlinkApi
start
- The row and column in which to start. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the data).len
- The length of the target area.
public char[] getDataChars(java.awt.Point start, java.awt.Point end)
GlinkApi
getDataChars
in class GlinkApi
start
- The row and column in which to start. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the data).end
- The row and column in which to end. The position is
inclusive (for example, row 10, col 12 means that position
10,12 will be used as the ending location and 10,12 will
be included in the data).
public int getDataLength(java.awt.Point start, java.awt.Point end)
GlinkApi
getDataLength
in class GlinkApi
public int getDefaultColorAttribute()
GlinkApi
For example, the following call gets the RGB value for the default background color:
getBackgroundColor(getDefaultColorAttribute());
getDefaultColorAttribute
in class GlinkApi
Attribute format.
,
GlinkApi.getForegroundColor(int)
,
GlinkApi.getBackgroundColor(int)
public int getEmulationType()
GlinkApi
getEmulationType
in class GlinkApi
GlinkConfiguration
public GlinkFields getFields()
GlinkApi
getFields
in class GlinkApi
public GlinkFields getFieldsEx()
GlinkApi
For unformatted screens where no fields are defined, this method will simulate that one or more fields are defined. For VIP and DKU emulations set in text mode, an input field will be defined from the position of the cursor to the end of the line. For emulations running in character mode like VT, an input field will be defined from the cursor position. The end of this field will be on the same line but will depend of the line contents and attributes.
The rest of the screen will be presented as a fixed field. The result will often be that three fields are defined for the screen (one fixed field, one variable field and another fixed field at the end).
getFieldsEx
in class GlinkApi
public int getForegroundColor(int attribute)
GlinkApi
getForegroundColor
in class GlinkApi
GlinkField
public java.awt.Container getGlinkContainer()
GlinkApi
getGlinkContainer
in class GlinkApi
GlinkApi.setVisible(boolean)
,
GlinkApi.isVisible()
,
GlinkApi.start()
,
GlinkEvent.STARTED
public GlinkEvent getGlinkEvent(int eventCode, long timeout)
GlinkApi
If the eventCode parameter is set to 0, the first available GlinkEvent is returned. If the eventCode is set to a valid GlinkEvent code, then other GlinkEvents queued are flushed and the specified GlinkEvent is returned if available.
The GlinkEvent.TURN_LOST event is ignored and not reported by this method.
getGlinkEvent
in class GlinkApi
eventCode
- The GlinkEvent code to wait for or 0 to wait for any.timeout
- Specifies the number of milliseconds to wait for GlinkEvents if
not available or 0 if no waiting.
GlinkApi.queueGlinkEvents(boolean)
,
GlinkApi.flushGlinkEvents()
,
GlinkEvent
,
GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)
public java.awt.Frame getGlinkFrame()
GlinkApi
getGlinkFrame
in class GlinkApi
GlinkApi.getGlinkContainer()
public java.lang.String getGlinkVersion()
GlinkApi
getGlinkVersion
in class GlinkApi
public java.util.Vector getInteractiveComParams()
GlinkApi
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTEDThe Ggate and DSA communication modules may be configured with parameters that should be supplied or modified by the user when connecting to the host application. These parameters are referred to as interactive communication parameters. If the current communication module is configured with such interactive parameters and Glink itself is not visible (glink.setVisible(false)), then the GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED is posted. The GlinkApi application should then call the getInteractiveComParams method to get the interactive parameters in question, modify the parameter values and set the interactive parameters with the setInteractiveComParams method call.
The getInteractiveComParams returns a vector with one element per interactive parameter. Each element is a string array of 3. The first string contains the short name of the parameter, the second the long name and the third the actual parameter value. For example a parameter may have "pw" as the short name, "Password" as the long name and an empty string as the parameter value. Below is a code example where one of the parameter ("pw") is modified if present.
Vector v = glink.getInteractiveComParams(); String param[]; for (int i = 0; i < v.size(); i++) { param = (String[])v.elementAt(i); if (param[0].equals("pw")) { params[2] = "mypassword"; v.set(i,param); } } glink.setInteractiveComParams(v);
getInteractiveComParams
in class GlinkApi
GlinkApi.setInteractiveComParams(java.util.Vector)
,
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED
public GlinkScreenArea getMarkedScreenArea()
GlinkApi
getMarkedScreenArea
in class GlinkApi
GlinkApi.getScreenArea(java.awt.Point, java.awt.Point, boolean)
,
GlinkApi.isScreenAreaMatch(no.gar.glink.api.GlinkScreenArea)
public java.lang.String getProperty(java.lang.String ky)
GlinkApi
getProperty
in class GlinkApi
Key | Description |
---|---|
device | Returns the allocated LU name for TN3270E or the device name for TN5250 |
public int getRows()
GlinkApi
getRows
in class GlinkApi
public GlinkScreenArea getScreenArea(java.awt.Point start, java.awt.Point end, boolean rect)
GlinkApi
getScreenArea
in class GlinkApi
start
- The row and column in which to start. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the data).end
- The row and column in which to end. The position is
inclusive (for example, row 10, col 12 means that position
10,12 will be used as the ending location and 10,12 will
be included in the data).rect
- Supply true to get a rectangle area and false to get an
area that is on a line-by-line basis from the given start position.
GlinkApi.getMarkedScreenArea()
,
GlinkApi.notifyScreenArea
,
GlinkApi.isScreenAreaMatch(no.gar.glink.api.GlinkScreenArea)
public java.lang.String getScreenCharacterSet()
GlinkApi
getScreenCharacterSet
in class GlinkApi
public int getScreenMode()
GlinkApi
getScreenMode
in class GlinkApi
GlinkApi.SCREEN_FORMATTED
,
GlinkApi.SCREEN_UNFORMATTED
,
GlinkApi.SCREEN_UNFORMATTED_CHAR
public java.lang.String getSessionName()
GlinkApi
getSessionName
in class GlinkApi
public java.lang.String getString()
GlinkApi
getString
in class GlinkApi
public java.lang.String getString(java.awt.Point start, java.awt.Point end)
GlinkApi
getString
in class GlinkApi
start
- The row and column in which to start. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the data).end
- The row and column in which to end. The position is
inclusive (for example, row 10, col 12 means that position
10,12 will be used as the ending location and 10,12 will
be included in the data).
public GlinkFields getVariableFields()
GlinkApi
getVariableFields
in class GlinkApi
public GlinkFields getVariableFieldsEx()
GlinkApi
For unformatted screens where no fields are defined, this method will simulate that one input field is defined. For VIP and DKU emulations set in text mode, an input field will be defined from the position of the cursor to the end of the line. For emulations running in character mode like VT, an input field will be defined from the cursor position. The end of this field will be on the same line but will depend of the line contents and attributes.
getVariableFieldsEx
in class GlinkApi
public boolean isScreenAreaMatch(GlinkScreenArea sa)
GlinkApi
isScreenAreaMatch
in class GlinkApi
GlinkApi.getScreenArea(java.awt.Point, java.awt.Point, boolean)
public boolean isSessionAvailable(java.lang.String name, java.util.Vector sessions)
GlinkApi
Restricted
isSessionAvailable
in class GlinkApi
GlinkApi.getAvailableSessions()
public void markScreenArea(java.awt.Point start, java.awt.Point end, boolean rect)
GlinkApi
markScreenArea
in class GlinkApi
start
- The starting position (1,1 is the upper left corner). Screen
marking is removed by supplying an invalid screen position , for example (0,0).end
- The ending position (80,24 is the end of the screen).rect
- Sets the marking mode to be used.GlinkApi.getMarkedScreenArea()
public java.lang.String messageModeReceive()
GlinkApi
messageModeReceive
in class GlinkApi
GlinkApi.messageModeReceiveSync()
,
GlinkApi.messageModeReceiveBytes()
,
GlinkApi.messageModeReceiveBytesSync()
,
GlinkEvent.MESSAGE_MODE_DATA
,
GlinkApi.emulate(java.lang.String)
public byte[] messageModeReceiveBytes()
GlinkApi
messageModeReceiveBytes
in class GlinkApi
GlinkApi.messageModeReceive()
,
GlinkApi.messageModeReceiveSync()
,
GlinkApi.messageModeReceiveBytesSync()
,
GlinkEvent.MESSAGE_MODE_DATA
,
GlinkApi.emulate(java.lang.String)
public byte[] messageModeReceiveBytesSync()
GlinkApi
The method will check the turn first and if turn is at the host side, it will wait until the turn has been received from the host before it returns the bytes received from the host since the last time this method was called. Glink must be in message mode operation for this call to return any data.
If the message mode receive buffer has reached its limit before the turn has been received, the call will return with the first part of data received and more messageModeReceiveBytesSync() calls must be issued to get the rest of the data.
messageModeReceiveBytesSync
in class GlinkApi
GlinkEvent.MESSAGE_MODE_DATA
,
GlinkApi.messageModeOn()
,
GlinkApi.isTurnKnown()
,
GlinkApi.isTurnReceived()
,
GlinkApi.messageModeReceive()
,
GlinkApi.messageModeReceiveBytes()
,
GlinkApi.messageModeReceiveSync()
public byte[] messageModeReceiveBytesSync(int maxlen)
GlinkApi
The method will check the turn first and if the turn is at the host side, it will wait until the requested number of characters has been received from the host and return these as a byte array. If less characters have been received when turn is received, then these characters are returned. When no more data is available, a null pointer is returned.
If the message mode receive buffer has reached its limit before the number of requested characters has been received, the message mode receive buffer is automatically adjusted.
The returned data is in the host native character set.
messageModeReceiveBytesSync
in class GlinkApi
public java.lang.String messageModeReceiveSync()
GlinkApi
The method will check the turn first and if turn is at the host side, it will wait until the turn has been received from the host before it returns the string of characters received from the host since the last time this method was called. Glink must be in message mode operation for this call to return any data. The returned data is always ASCII/UNICODE.
If the message mode receive buffer has reached its limit before the turn has been received, the call will return with the first part of data received and more messageModeReceiveSync() calls must be issued to get the rest of the data.
messageModeReceiveSync
in class GlinkApi
GlinkEvent.MESSAGE_MODE_DATA
,
GlinkApi.messageModeOn()
,
GlinkApi.isTurnKnown()
,
GlinkApi.isTurnReceived()
,
GlinkApi.messageModeReceive()
,
GlinkApi.messageModeReceiveBytes()
,
GlinkApi.messageModeReceiveBytesSync()
public java.lang.String messageModeReceiveSync(int maxlen)
GlinkApi
The method will check the turn first and if the turn is at the host side, it will wait until the requested number of characters has been received from the host and return these as a string. If less characters have been received when turn is received, then these characters are returned. When no more data is available, a null pointer is returned.
If the message mode receive buffer has reached its limit before the number of requested characters has been received, the message mode receive buffer is automatically adjusted.
The returned data is always Unicode, regardless of the host native character set.
messageModeReceiveSync
in class GlinkApi
public void messageModeSend(java.lang.String s)
GlinkApi
The data is assumed to be a Unicode string. It is translated to the host native character set before transmission.
messageModeSend
in class GlinkApi
GlinkApi.messageModeSend(String s,boolean passTurn)
public void messageModeSend(java.lang.String s, boolean passTurn)
GlinkApi
The data is assumed to be an Unicode string. It is translated to the host native character set before transmission.
Turn issues
Please note that the concept of turn is only well defined
for the following communications protocols:
messageModeSend
in class GlinkApi
s
- string to send to the hostpassTurn
- true if turn is to be passed to the host, false if not (see above).public void messageModeSendBytes(byte[] s, int offset, int len)
GlinkApi
The data is assumed to be in the host native character set.
messageModeSendBytes
in class GlinkApi
s
- the data bufferoffset
- starting offset to send fromlen
- number of bytes to sendGlinkApi.messageModeSendBytes(byte[] s,int offset,int len,boolean passTurn)
public void messageModeSendBytes(byte[] s, int offset, int len, boolean passTurn)
GlinkApi
The data is assumed to be in the host native character set.
Turn issues
Please note that the concept of turn is only well defined
for the following communications protocols:
messageModeSendBytes
in class GlinkApi
s
- the data bufferoffset
- starting index to send fromlen
- number of bytes to sendpassTurn
- true if turn is to be passed to the host, false if not (see above).public void notifyCommandKey(int commandKey)
GlinkApi
Several command keys may be marked for notification. To be notified for all command keys, set the commandKey parameter to -1.
notifyCommandKey
in class GlinkApi
commandKey
- The command key for which notifications are to be sent.GlinkKey
,
GlinkApi.removeNotifyCommandKey(int)
,
GlinkEvent.COMMAND_KEY_TYPED
public void notifyDataBlocks(boolean enable)
GlinkApi
notifyDataBlocks
in class GlinkApi
GlinkEvent.DATA_BLOCK
public void notifyGlinkEvent(int eventCode)
notifyGlinkEvent
in class GlinkApi
public void notifyGlinkEvent(int eventCode, int value, java.lang.String valueText)
notifyGlinkEvent
in class GlinkApi
public void notifyKey(int ky)
GlinkApi
Several keys may be marked for notification. To receive notification for every key typed, set the commandKey parameter to -1.
notifyKey
in class GlinkApi
ky
- The key to be notified.GlinkApi.removeNotifyKey(int)
,
GlinkEvent.KEY_TYPED
public void notifyScreenArea(GlinkScreenArea screenArea, int id, boolean removeAfterwards)
GlinkApi
notifyScreenArea
in class GlinkApi
screenArea
- The object that describes the screen area to be checked. When the
object matches the current screen the caller will be notified.id
- Select a positive number to identify this object when being reported.
This value will be supplied with the GlinkEvent object (getValue method) to identify
which screenArea object matches the current screen. If several objects match the current
screen, a notification will be given for each of them.removeAfterwards
- Specifies whether the object should be removed from the
notification list or not after the notification has been given for the object.
For peformance reasons remove objects that are not in use anymore.GlinkApi.removeNotifyScreenArea(int)
,
GlinkApi.isTurnKnown()
,
GlinkEvent.getValue()
public void notifyString(java.lang.String s, boolean caseSensitive, int id, boolean removeAfterwards)
GlinkApi
notifyString
in class GlinkApi
s
- The string for which a notification is to be sent.caseSensitive
- Specifies if the match is to be case sensitive.id
- Select a positive number to identify this string. This value will
be supplied with the GlinkEvent object (getValue method) to identify which
string the notification is for.removeAfterwards
- Specifies whether the string should be removed from the
notification list after the string has been received from host and the notification
has been sent.
The string may also be removed from the list with the removeNotifyString call.GlinkApi.removeNotifyString(int)
,
GlinkEvent.getValue()
,
GlinkApi.notifyScreenArea
public void queueGlinkEvents(boolean enable)
GlinkApi
queueGlinkEvents
in class GlinkApi
GlinkApi.getGlinkEvent(int, long)
,
GlinkApi.flushGlinkEvents()
,
GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)
public void removeConfiguration(GlinkConfiguration glinkConfiguration)
GlinkApi
Restricted
removeConfiguration
in class GlinkApi
GlinkApi.addConfiguration(no.gar.glink.api.GlinkConfiguration)
public void removeGlinkEventListener(GlinkEventListener listener)
GlinkApi
removeGlinkEventListener
in class GlinkApi
GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)
public void removeNotifyCommandKey(int commandKey)
GlinkApi
removeNotifyCommandKey
in class GlinkApi
GlinkApi.notifyCommandKey(int)
,
GlinkKey
public void removeNotifyKey(int ky)
GlinkApi
removeNotifyKey
in class GlinkApi
GlinkApi.notifyKey(int)
public boolean removeNotifyScreenArea(int id)
GlinkApi
removeNotifyScreenArea
in class GlinkApi
id
- Identifies the GlinkScreenArea object to be removed.
To remove all of the GlinkScreenArea notification objects set, supply -1 for the identity.
GlinkApi.notifyScreenArea
public boolean removeNotifyString(int id)
GlinkApi
removeNotifyString
in class GlinkApi
id
- Identifies the string to be removed.
To remove all of the string notifications set, supply -1 for the identity.
GlinkApi.notifyString(java.lang.String, boolean, int, boolean)
public boolean restoreScreenContent(java.lang.String fileName)
GlinkApi
restoreScreenContent
in class GlinkApi
fileName
- Specify file name or file path
GlinkApi.saveScreenContent(java.lang.String)
public boolean saveScreenContent(java.lang.String fileName)
GlinkApi
saveScreenContent
in class GlinkApi
fileName
- Specify file name or file path
GlinkApi.restoreScreenContent(java.lang.String)
public void scriptCommand(java.lang.String command)
GlinkApi
scriptCommand
in class GlinkApi
public void scriptFile(java.lang.String fileName)
GlinkApi
scriptFile
in class GlinkApi
fileName
- If the script is stored with the Glink Config Server specify:
"server://filename" otherwise supply a full path name.public void scriptTerminate()
GlinkApi
scriptTerminate
in class GlinkApi
public void sendCommandKey(int ky)
GlinkApi
sendCommandKey
in class GlinkApi
GlinkKey
public void sendKeys(java.lang.String text)
GlinkApi
sendKeys
in class GlinkApi
GlinkApi.setString(java.lang.String, java.awt.Point)
public void sendKeys(java.lang.String text, java.awt.Point location)
GlinkApi
sendKeys
in class GlinkApi
GlinkApi.setString(java.lang.String, java.awt.Point)
public void setCursor(int x, int y)
GlinkApi
setCursor
in class GlinkApi
GlinkApi.getCursor()
public void setCursor(java.awt.Point location)
GlinkApi
setCursor
in class GlinkApi
GlinkApi.getCursor()
public void setInteractiveComParams(java.util.Vector params)
GlinkApi
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTEDThe setInteractiveComParams must be used together with the getInteractiveComParams, see the getInteractiveComParams for the description on how to use these calls.
setInteractiveComParams
in class GlinkApi
params
- The vector containing the interactive communication parameters.
The vector should have been initialized with the getInteractiveComParams method.GlinkApi.getInteractiveComParams()
,
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED
public void setParameter(java.lang.String param)
GlinkApi
Restricted
setParameter
in class GlinkApi
param
- String of the form "name=value".public void setParentFrame(java.awt.Frame fr)
GlinkApi
setParentFrame
in class GlinkApi
GlinkApi.getGlinkContainer()
,
GlinkApi.setVisible(boolean)
,
GlinkApi.isVisible()
,
GlinkApi.start()
,
GlinkEvent.STARTED
public boolean setRestrictedMode(java.lang.String ky, int level)
GlinkApi
setRestrictedMode
in class GlinkApi
ky
- this key is memorized when switching restricted mode on, and must match
to exit restricted mode.level
- switch restricted mode off if 0, on if != 0.
public void setScreenSize(int columns, int rows)
GlinkApi
setScreenSize
in class GlinkApi
public void setString(java.lang.String text, java.awt.Point location)
GlinkApi
setString
in class GlinkApi
text
- String to place in the virtual screen.location
- Position where the string should be written.GlinkApi.sendKeys(java.lang.String)
public void setVisible(boolean visible)
GlinkApi
setVisible
in class GlinkApi
//PRO_END
public void start()
GlinkApi
Restricted
start
in class GlinkApi
public void stop()
GlinkApi
Restricted
stop
in class GlinkApi
GlinkApi.start()
public java.lang.String translateBuffer(java.lang.String buffer, int direction)
GlinkApi
translateBuffer
in class GlinkApi
buffer
- String to translatedirection
- how to translate
GlinkApi.ASCII_TO_EBCDIC
,
GlinkApi.EBCDIC_TO_ASCII
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |