|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectno.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)
GlinkApiRestricted
addConfiguration in class GlinkApiGlinkApi.sessionName,
GlinkConfigurationpublic void addGlinkEventListener(GlinkEventListener listener)
GlinkApi
addGlinkEventListener in class GlinkApiGlinkEventpublic void connect()
GlinkApiRestricted
connect in class GlinkApiGlinkApi.sessionNamepublic void debugStart(java.io.PrintWriter debugStream)
GlinkApiRestricted
debugStart in class GlinkApidebugStream - destination stream for debug outputGlinkApi.debugStop()public void debugStop()
GlinkApiRestricted
debugStop in class GlinkApiGlinkApi.debugStart(java.io.PrintWriter)public void disconnect()
GlinkApiRestricted
disconnect in class GlinkApipublic void emulate(java.lang.String hostData)
GlinkApi
emulate in class GlinkApiGlinkApi.messageModeOn()public java.lang.String fieldRead(int fieldNum)
GlinkApi
fieldRead in class GlinkApifieldNum - 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 GlinkApistr - 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 GlinkApiGlinkApi.getGlinkEvent(int, long),
GlinkApi.queueGlinkEvents(boolean)
public int[] getAttributes(java.awt.Point start,
int len)
GlinkApi
getAttributes in class GlinkApistart - 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 GlinkApiGlinkApi.getAttributes(java.awt.Point, int),
Attribute format.public java.util.Vector getAvailableSessions()
GlinkApiRestricted
getAvailableSessions in class GlinkApiGlinkApi.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_ERRORpublic int getBackgroundColor(int attribute)
GlinkApi
getBackgroundColor in class GlinkApiGlinkFieldpublic int getColumns()
GlinkApi
getColumns in class GlinkApipublic int getCommunicationProtocol()
GlinkApi
getCommunicationProtocol in class GlinkApiGlinkConfigurationpublic java.lang.String getConfigParameter(java.lang.String name)
GlinkApi
getConfigParameter in class GlinkApisetParameterpublic 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 GlinkApistart - 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 GlinkApistart - 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 GlinkApipublic int getDefaultColorAttribute()
GlinkApi
For example, the following call gets the RGB value for the default background color:
getBackgroundColor(getDefaultColorAttribute());
getDefaultColorAttribute in class GlinkApiAttribute format.,
GlinkApi.getForegroundColor(int),
GlinkApi.getBackgroundColor(int)public int getEmulationType()
GlinkApi
getEmulationType in class GlinkApiGlinkConfigurationpublic GlinkFields getFields()
GlinkApi
getFields in class GlinkApipublic GlinkFields getFieldsEx()
GlinkApiFor 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 GlinkApipublic int getForegroundColor(int attribute)
GlinkApi
getForegroundColor in class GlinkApiGlinkFieldpublic java.awt.Container getGlinkContainer()
GlinkApi
getGlinkContainer in class GlinkApiGlinkApi.setVisible(boolean),
GlinkApi.isVisible(),
GlinkApi.start(),
GlinkEvent.STARTED
public GlinkEvent getGlinkEvent(int eventCode,
long timeout)
GlinkApiIf 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 GlinkApieventCode - 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 GlinkApiGlinkApi.getGlinkContainer()public java.lang.String getGlinkVersion()
GlinkApi
getGlinkVersion in class GlinkApipublic java.util.Vector getInteractiveComParams()
GlinkApiGlinkEvent.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 GlinkApiGlinkApi.setInteractiveComParams(java.util.Vector),
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTEDpublic GlinkScreenArea getMarkedScreenArea()
GlinkApi
getMarkedScreenArea in class GlinkApiGlinkApi.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 GlinkApistart - 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 GlinkApipublic int getScreenMode()
GlinkApi
getScreenMode in class GlinkApiGlinkApi.SCREEN_FORMATTED,
GlinkApi.SCREEN_UNFORMATTED,
GlinkApi.SCREEN_UNFORMATTED_CHARpublic java.lang.String getSessionName()
GlinkApi
getSessionName in class GlinkApipublic 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 GlinkApistart - 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 GlinkApipublic GlinkFields getVariableFieldsEx()
GlinkApiFor 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 GlinkApipublic boolean isScreenAreaMatch(GlinkScreenArea sa)
GlinkApi
isScreenAreaMatch in class GlinkApiGlinkApi.getScreenArea(java.awt.Point, java.awt.Point, boolean)
public boolean isSessionAvailable(java.lang.String name,
java.util.Vector sessions)
GlinkApiRestricted
isSessionAvailable in class GlinkApiGlinkApi.getAvailableSessions()
public void markScreenArea(java.awt.Point start,
java.awt.Point end,
boolean rect)
GlinkApi
markScreenArea in class GlinkApistart - 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 GlinkApiGlinkApi.messageModeReceiveSync(),
GlinkApi.messageModeReceiveBytes(),
GlinkApi.messageModeReceiveBytesSync(),
GlinkEvent.MESSAGE_MODE_DATA,
GlinkApi.emulate(java.lang.String)public byte[] messageModeReceiveBytes()
GlinkApi
messageModeReceiveBytes in class GlinkApiGlinkApi.messageModeReceive(),
GlinkApi.messageModeReceiveSync(),
GlinkApi.messageModeReceiveBytesSync(),
GlinkEvent.MESSAGE_MODE_DATA,
GlinkApi.emulate(java.lang.String)public byte[] messageModeReceiveBytesSync()
GlinkApiThe 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 GlinkApiGlinkEvent.MESSAGE_MODE_DATA,
GlinkApi.messageModeOn(),
GlinkApi.isTurnKnown(),
GlinkApi.isTurnReceived(),
GlinkApi.messageModeReceive(),
GlinkApi.messageModeReceiveBytes(),
GlinkApi.messageModeReceiveSync()public byte[] messageModeReceiveBytesSync(int maxlen)
GlinkApiThe 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 GlinkApipublic java.lang.String messageModeReceiveSync()
GlinkApiThe 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 GlinkApiGlinkEvent.MESSAGE_MODE_DATA,
GlinkApi.messageModeOn(),
GlinkApi.isTurnKnown(),
GlinkApi.isTurnReceived(),
GlinkApi.messageModeReceive(),
GlinkApi.messageModeReceiveBytes(),
GlinkApi.messageModeReceiveBytesSync()public java.lang.String messageModeReceiveSync(int maxlen)
GlinkApiThe 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 GlinkApipublic void messageModeSend(java.lang.String s)
GlinkApiThe data is assumed to be a Unicode string. It is translated to the host native character set before transmission.
messageModeSend in class GlinkApiGlinkApi.messageModeSend(String s,boolean passTurn)
public void messageModeSend(java.lang.String s,
boolean passTurn)
GlinkApiThe 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 GlinkApis - 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)
GlinkApiThe data is assumed to be in the host native character set.
messageModeSendBytes in class GlinkApis - 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)
GlinkApiThe 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 GlinkApis - 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)
GlinkApiSeveral command keys may be marked for notification. To be notified for all command keys, set the commandKey parameter to -1.
notifyCommandKey in class GlinkApicommandKey - The command key for which notifications are to be sent.GlinkKey,
GlinkApi.removeNotifyCommandKey(int),
GlinkEvent.COMMAND_KEY_TYPEDpublic void notifyDataBlocks(boolean enable)
GlinkApi
notifyDataBlocks in class GlinkApiGlinkEvent.DATA_BLOCKpublic void notifyGlinkEvent(int eventCode)
notifyGlinkEvent in class GlinkApi
public void notifyGlinkEvent(int eventCode,
int value,
java.lang.String valueText)
notifyGlinkEvent in class GlinkApipublic void notifyKey(int ky)
GlinkApiSeveral keys may be marked for notification. To receive notification for every key typed, set the commandKey parameter to -1.
notifyKey in class GlinkApiky - The key to be notified.GlinkApi.removeNotifyKey(int),
GlinkEvent.KEY_TYPED
public void notifyScreenArea(GlinkScreenArea screenArea,
int id,
boolean removeAfterwards)
GlinkApi
notifyScreenArea in class GlinkApiscreenArea - 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 GlinkApis - 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.notifyScreenAreapublic void queueGlinkEvents(boolean enable)
GlinkApi
queueGlinkEvents in class GlinkApiGlinkApi.getGlinkEvent(int, long),
GlinkApi.flushGlinkEvents(),
GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)public void removeConfiguration(GlinkConfiguration glinkConfiguration)
GlinkApiRestricted
removeConfiguration in class GlinkApiGlinkApi.addConfiguration(no.gar.glink.api.GlinkConfiguration)public void removeGlinkEventListener(GlinkEventListener listener)
GlinkApi
removeGlinkEventListener in class GlinkApiGlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)public void removeNotifyCommandKey(int commandKey)
GlinkApi
removeNotifyCommandKey in class GlinkApiGlinkApi.notifyCommandKey(int),
GlinkKeypublic void removeNotifyKey(int ky)
GlinkApi
removeNotifyKey in class GlinkApiGlinkApi.notifyKey(int)public boolean removeNotifyScreenArea(int id)
GlinkApi
removeNotifyScreenArea in class GlinkApiid - Identifies the GlinkScreenArea object to be removed.
To remove all of the GlinkScreenArea notification objects set, supply -1 for the identity.
GlinkApi.notifyScreenAreapublic boolean removeNotifyString(int id)
GlinkApi
removeNotifyString in class GlinkApiid - 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 GlinkApifileName - Specify file name or file path
GlinkApi.saveScreenContent(java.lang.String)public boolean saveScreenContent(java.lang.String fileName)
GlinkApi
saveScreenContent in class GlinkApifileName - Specify file name or file path
GlinkApi.restoreScreenContent(java.lang.String)public void scriptCommand(java.lang.String command)
GlinkApi
scriptCommand in class GlinkApipublic void scriptFile(java.lang.String fileName)
GlinkApi
scriptFile in class GlinkApifileName - 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 GlinkApipublic void sendCommandKey(int ky)
GlinkApi
sendCommandKey in class GlinkApiGlinkKeypublic void sendKeys(java.lang.String text)
GlinkApi
sendKeys in class GlinkApiGlinkApi.setString(java.lang.String, java.awt.Point)
public void sendKeys(java.lang.String text,
java.awt.Point location)
GlinkApi
sendKeys in class GlinkApiGlinkApi.setString(java.lang.String, java.awt.Point)
public void setCursor(int x,
int y)
GlinkApi
setCursor in class GlinkApiGlinkApi.getCursor()public void setCursor(java.awt.Point location)
GlinkApi
setCursor in class GlinkApiGlinkApi.getCursor()public void setInteractiveComParams(java.util.Vector params)
GlinkApiGlinkEvent.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 GlinkApiparams - The vector containing the interactive communication parameters.
The vector should have been initialized with the getInteractiveComParams method.GlinkApi.getInteractiveComParams(),
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTEDpublic void setParameter(java.lang.String param)
GlinkApiRestricted
setParameter in class GlinkApiparam - String of the form "name=value".public void setParentFrame(java.awt.Frame fr)
GlinkApi
setParentFrame in class GlinkApiGlinkApi.getGlinkContainer(),
GlinkApi.setVisible(boolean),
GlinkApi.isVisible(),
GlinkApi.start(),
GlinkEvent.STARTED
public boolean setRestrictedMode(java.lang.String ky,
int level)
GlinkApi
setRestrictedMode in class GlinkApiky - 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 GlinkApitext - 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_ENDpublic void start()
GlinkApiRestricted
start in class GlinkApipublic void stop()
GlinkApiRestricted
stop in class GlinkApiGlinkApi.start()
public java.lang.String translateBuffer(java.lang.String buffer,
int direction)
GlinkApi
translateBuffer in class GlinkApibuffer - 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 | |||||