|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object no.gar.glink.api.GlinkApi
public class GlinkApi
This is the main class for the API interface to Glink. The class is contained in the file glink.jar. The Java class path must be adjusted so this jar file can be found.
To start Glink from an application, create a GlinkApi object and supply the user name, password and session name with the userName(), userPassword() and sessionName() methods. Then call the start method to launch Glink.
Profiling/debugging mode
A subclass of GlinkApi -- GlinkApiDebug -- can be used for debugging/profiling purposes. The signatures of the methods are exactly the same, but GlinkApiDebug will write a chronological trace of entry to and exit from API methods to timestamped files in the apitrace subdirectory of the current Glink directory. To enable this mode, create a GlinkApi object using one of the GlinkApi.createApi() methods, passing 'true' for the debug argument.
Restricted mode
When Glink is running as a J2EE connector, the J2EE application server will place the API in Restricted mode before passing it to client applications. When in Restricted mode, some methods will silently do nothing. These methods are marked as Restricted in this documentation.
Message mode and character sets
In message mode, Glink bypasses the emulation and sends and receives data
directly between client and host. In emulation mode, clients always work in
ASCII/UNICODE regardless of the host character set, as data is always assumed
to be textual.
In message mode, binary data transmission is possible. This is implemented
by two sets of message mode functions. One set works much like emulation
mode in that data is always in ASCII/UNICODE as seen from the client, regardless
of the host native character set. The other set allows transmission of raw
data buffers in the host native character set. The difference between these two
sets is that the former operates on String data, the latter operates on byte
arrays. See the relevant messageModeXXX() methods below for details.
Field Summary | |
---|---|
static int |
ASCII_TO_EBCDIC
Specifies translation direction for translateBuffer(): ASCII to EBCDIC |
static int |
EBCDIC_TO_ASCII
Specifies translation direction for translateBuffer(): EBCDIC to ASCII |
static int |
SCREEN_FORMATTED
Specifies that one or more fields are defined for the current screen. |
static int |
SCREEN_UNFORMATTED
Specifies that no fields are defined for the current screen. |
static int |
SCREEN_UNFORMATTED_CHAR
Specifies that no fields are defined for the current screen and data is sent to the host character by character and simultaneously displayed on the local screen. |
static int |
SEARCH_BACKWARD
Specifies the search direction for the findString method. |
static int |
SEARCH_FORWARD
Specifies the search direction for the findString method. |
Constructor Summary | |
---|---|
GlinkApi()
Constructs a new empty GlinkApi object. |
|
GlinkApi(java.applet.Applet applet)
Constructs a new empty GlinkApi object from an applet. |
|
GlinkApi(GlinkApi anotherApi)
Constructs a GlinkApi object that will inherit configuration parameters from another GlinkApi object. |
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 |
configBase(java.lang.String configBase)
Sets the Glink configuration directory when running without a Glink Config Server. |
void |
configLanguage(java.lang.String lkey)
Specifies the language file to use for fixed texts. |
void |
configServer(java.lang.String address)
Specifies the IP address or host name of the computer where the Glink server is installed and running. |
void |
connect()
Connects to the session specified with the sessionName() method. |
static GlinkApi |
createApi(java.applet.Applet ap,
boolean debug)
Create a regular or debug enabled GlinkApi object from an Applet. |
static GlinkApi |
createApi(boolean debug)
Create a regular or debug enabled GlinkApi object. |
static GlinkApi |
createApi(GlinkApi nother,
boolean debug)
Create a regular or debug enabled GlinkApi object from another GlinkApi object. |
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. |
void |
fileBase(java.lang.String fileBase)
Sets the Glink file base directory. |
java.awt.Point |
findString(java.lang.String string,
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 key)
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 rectangle)
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 |
isConnected()
Returns true if Glink is connected to a session. |
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. |
boolean |
isSplashScreenVisible()
Returns true if the splash screen is visible. |
boolean |
isStarted()
Returns true if Glink has started. |
boolean |
isTurnKnown()
Returns true if Glink is connected to a host and the communication module in use knows about which side has the turn to send, either the host side or the Glink side. |
boolean |
isTurnReceived()
Returns true if this side has the turn to send data. |
boolean |
isVisible()
Returns true if the Glink screen (frame) is visible. |
void |
markScreenArea(java.awt.Point start,
java.awt.Point end,
boolean rectangle)
This method marks the given screen area. |
void |
messageModeBufferOverwrite(boolean overwrite)
Specifies if the message mode receive buffer may be overwritten if the limit of the buffer is reached. |
void |
messageModeOff()
This method turns message mode off. |
void |
messageModeOn()
This method instructs Glink to start message mode operation. |
void |
messageModeOn(int bufsize,
boolean processHostData)
This method instructs Glink to start message mode operation. |
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 |
notifyKey(int key)
Instructs Glink to fire a GlinkEvent.KEY_TYPED event when the given key is typed. |
void |
notifyScreenArea(GlinkScreenArea screenArea,
int identity,
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 string,
boolean caseSensitive,
int identity,
boolean removeAfterwards)
Instructs Glink to fire a GlinkEvent.STRING_RECEIVED event when the given string is received from host. |
void |
noToolbar()
This method instructs Glink to start without a toolbar and keybar. |
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 key)
Removes the notification for the key previously set with the notifyKey method. |
boolean |
removeNotifyScreenArea(int identity)
Removes the GlinkScreenArea object associated with the given identity from the list of objects being checked for a match. |
boolean |
removeNotifyString(int identity)
Removes the string associated with the given identity from the list of strings being checked for. |
void |
requestFocus()
Requests that the Glink screen component get the input focus. |
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 key)
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 |
sendMacro(java.lang.String macro)
Sends a string of characters and control characters to the emulator starting at the current cursor location. |
void |
serverPort(java.lang.String port)
Set the IP port on which to connect to the Glink server. |
boolean |
sessionName(java.lang.String name)
Specifies the name of the session to which Glink should connect. |
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 |
setGlinkDirectory(java.lang.String glinkDir)
Set the Glink directory. |
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 frame)
Normally Glink starts up in its own frame. |
boolean |
setRestrictedMode(java.lang.String key,
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 |
setSplashScreenVisible(boolean visible)
Specifies whether the splash screen should be visible. |
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. |
void |
suppressTurnLostEvents(boolean doSuppress)
Suppress or enable TURN_LOST events from the API. |
java.lang.String |
translateBuffer(java.lang.String buffer,
int direction)
Translate a string between ASCII and EBCDIC. |
void |
userName(java.lang.String name)
Specifies the user name. |
void |
userPassword(java.lang.String password)
Specifies the password for the user. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ASCII_TO_EBCDIC
public static final int EBCDIC_TO_ASCII
public static final int SCREEN_FORMATTED
getScreenMode()
,
Constant Field Valuespublic static final int SCREEN_UNFORMATTED
public static final int SCREEN_UNFORMATTED_CHAR
public static final int SEARCH_BACKWARD
findString
,
Constant Field Valuespublic static final int SEARCH_FORWARD
findString
,
Constant Field ValuesConstructor Detail |
---|
public GlinkApi()
GlinkApi(Applet applet)
public GlinkApi(java.applet.Applet applet)
public GlinkApi(GlinkApi anotherApi)
glink.ini
and/or in the
<PARAM> tags of the HTML page used to load Glink. To pick up glink.ini
parameters, the GlinkApi object passed in anotherApi
must be started.
Of particular interest are user.name, user.password, config.name,
config.language
.
anotherApi
- -- the API from which this API will inherit parametersMethod Detail |
---|
public void addConfiguration(GlinkConfiguration glinkConfiguration)
Restricted
sessionName
,
GlinkConfiguration
public void addGlinkEventListener(GlinkEventListener listener)
GlinkEvent
public void configBase(java.lang.String configBase)
Restricted
configBase
- The path to the location where the Glink
configuration directory is placed, for example:
GlinkApi.configBase("D:\\glinkj\\config");public void configLanguage(java.lang.String lkey)
us
.
Glink looks for a file glink_xx.txt
, where xx is the
value of this parameter, in the .../no/gar/data
directory.
Restricted
lkey
- The 2-letter language key to use. Default is "us
".public void configServer(java.lang.String address)
Restricted
address
- The address may be specified as:
hostname.yourcompany.com or 123.234.123.1 or nonepublic void connect()
Restricted
sessionName
public static final GlinkApi createApi(java.applet.Applet ap, boolean debug)
ap
- Applet handledebug
- if true, an object of type GlinkApiDebug is created
public static final GlinkApi createApi(boolean debug)
debug
- if true, an object of type GlinkApiDebug is created
public static final GlinkApi createApi(GlinkApi nother, boolean debug)
nother
- another GlinkApi object used as a templatedebug
- if true, an object of type GlinkApiDebug is created
public void debugStart(java.io.PrintWriter debugStream)
Restricted
debugStream
- destination stream for debug outputdebugStop()
public void debugStop()
Restricted
debugStart(java.io.PrintWriter)
public void disconnect()
Restricted
public void emulate(java.lang.String hostData)
messageModeOn()
public java.lang.String fieldRead(int fieldNum)
fieldNum
- The variable field number where 1 is the first variable field
and 0 means the current field.
public void fileBase(java.lang.String fileBase)
Restricted
fileBase
- The path to the location where the Glink
'no' directory is placed, for example:
GlinkApi.fileBase("D:\\glinkj");
GlinkApi.fileBase("http://www.gar.no/glinkj");public java.awt.Point findString(java.lang.String string, java.awt.Point start, int length, int direction, boolean caseSensitive)
string
- 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()
getGlinkEvent(int, long)
,
queueGlinkEvents(boolean)
public int[] getAttributes(java.awt.Point start, int len)
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)
getAttributes(java.awt.Point, int)
,
Attribute format.
public java.util.Vector getAvailableSessions()
Restricted
getAvailableSessions()
,
userName(java.lang.String)
,
userPassword(java.lang.String)
,
configServer(java.lang.String)
,
serverPort(java.lang.String)
,
setGlinkDirectory(java.lang.String)
,
GlinkEvent.VE_SESSIONS_ERROR
public int getBackgroundColor(int attribute)
GlinkField
public int getColumns()
public int getCommunicationProtocol()
GlinkConfiguration
public java.lang.String getConfigParameter(java.lang.String name)
setParameter
public java.awt.Point getCursor()
public byte[] getDataBytes(java.awt.Point start, int len)
public byte[] getDataBytes(java.awt.Point start, java.awt.Point end)
public char[] getDataChars(java.awt.Point start, int len)
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)
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)
public int getDefaultColorAttribute()
For example, the following call gets the RGB value for the default background color:
getBackgroundColor(getDefaultColorAttribute());
Attribute format.
,
getForegroundColor(int)
,
getBackgroundColor(int)
public int getEmulationType()
GlinkConfiguration
public GlinkFields getFields()
public GlinkFields getFieldsEx()
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).
public int getForegroundColor(int attribute)
GlinkField
public java.awt.Container getGlinkContainer()
setVisible(boolean)
,
isVisible()
,
start()
,
GlinkEvent.STARTED
public GlinkEvent getGlinkEvent(int eventCode, long timeout)
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.
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.
queueGlinkEvents(boolean)
,
flushGlinkEvents()
,
GlinkEvent
,
addGlinkEventListener(no.gar.glink.api.GlinkEventListener)
public java.awt.Frame getGlinkFrame()
getGlinkContainer()
public java.lang.String getGlinkVersion()
public java.util.Vector getInteractiveComParams()
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);
setInteractiveComParams(java.util.Vector)
,
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED
public GlinkScreenArea getMarkedScreenArea()
getScreenArea(java.awt.Point, java.awt.Point, boolean)
,
isScreenAreaMatch(no.gar.glink.api.GlinkScreenArea)
public java.lang.String getProperty(java.lang.String key)
Key | Description |
---|---|
device | Returns the allocated LU name for TN3270E or the device name for TN5250 |
public int getRows()
public GlinkScreenArea getScreenArea(java.awt.Point start, java.awt.Point end, boolean rectangle)
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).rectangle
- 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.
getMarkedScreenArea()
,
notifyScreenArea
,
isScreenAreaMatch(no.gar.glink.api.GlinkScreenArea)
public java.lang.String getScreenCharacterSet()
public int getScreenMode()
SCREEN_FORMATTED
,
SCREEN_UNFORMATTED
,
SCREEN_UNFORMATTED_CHAR
public java.lang.String getSessionName()
public java.lang.String getString()
public java.lang.String getString(java.awt.Point start, java.awt.Point end)
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()
public GlinkFields getVariableFieldsEx()
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.
public boolean isConnected()
public boolean isScreenAreaMatch(GlinkScreenArea sa)
getScreenArea(java.awt.Point, java.awt.Point, boolean)
public boolean isSessionAvailable(java.lang.String name, java.util.Vector sessions)
Restricted
getAvailableSessions()
public boolean isSplashScreenVisible()
setSplashScreenVisible(boolean)
public boolean isStarted()
start()
public boolean isTurnKnown()
Communication modules such as ComTN3270, ComTN5250, ComGgate ComDSA and ComTNVIP all know about the turn, whereas ComTelenet and ComMinitel do not.
GlinkEvent.TURN_LOST
,
GlinkEvent.TURN_RECEIVED
,
isTurnReceived()
public boolean isTurnReceived()
isTurnKnown()
public boolean isVisible()
//PRO_BEGIN
,
//PRO_END
public void markScreenArea(java.awt.Point start, java.awt.Point end, boolean rectangle)
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).rectangle
- Sets the marking mode to be used.getMarkedScreenArea()
public void messageModeBufferOverwrite(boolean overwrite)
overwrite
- if true, Glink overwrites the message mode receive buffer
when it has reached its limit, if false, Glink waits until one of the
messageModeReceive methods are called to clear the buffer.public void messageModeOff()
Restricted
public void messageModeOn()
The default buffer size set by this method is 2048 bytes.
Restricted
messageModeOn(int bufsize, boolean processHostData)
public void messageModeOn(int bufsize, boolean processHostData)
bufsize
- Size of the buffer where the incoming characters are stored.
The buffer is cleared with the messageModeReceive or
messageModeReceiveSync calls. If the buffer reaches its limit,
the line modul will be suspended until a receive call is issued
to clear the buffer.processHostData
- Tells Glink to pass the received characters
to the Glink emulation class when set to true. When
set to false, the characters are stored in the
message mode buffer only and the Glink emulation is bypassed.
Restricted
messageModeReceive()
,
messageModeReceiveSync()
,
messageModeReceiveSync(int maxlen)
,
messageModeBufferOverwrite(boolean)
,
emulate(java.lang.String)
public java.lang.String messageModeReceive()
messageModeReceiveSync()
,
messageModeReceiveBytes()
,
messageModeReceiveBytesSync()
,
GlinkEvent.MESSAGE_MODE_DATA
,
emulate(java.lang.String)
public byte[] messageModeReceiveBytes()
messageModeReceive()
,
messageModeReceiveSync()
,
messageModeReceiveBytesSync()
,
GlinkEvent.MESSAGE_MODE_DATA
,
emulate(java.lang.String)
public byte[] messageModeReceiveBytesSync()
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.
GlinkEvent.MESSAGE_MODE_DATA
,
messageModeOn()
,
isTurnKnown()
,
isTurnReceived()
,
messageModeReceive()
,
messageModeReceiveBytes()
,
messageModeReceiveSync()
public byte[] messageModeReceiveBytesSync(int maxlen)
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.
public java.lang.String messageModeReceiveSync()
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.
GlinkEvent.MESSAGE_MODE_DATA
,
messageModeOn()
,
isTurnKnown()
,
isTurnReceived()
,
messageModeReceive()
,
messageModeReceiveBytes()
,
messageModeReceiveBytesSync()
public java.lang.String messageModeReceiveSync(int maxlen)
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.
public void messageModeSend(java.lang.String s)
The data is assumed to be a Unicode string. It is translated to the host native character set before transmission.
messageModeSend(String s,boolean passTurn)
public void messageModeSend(java.lang.String s, boolean passTurn)
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:
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)
The data is assumed to be in the host native character set.
s
- the data bufferoffset
- starting offset to send fromlen
- number of bytes to sendmessageModeSendBytes(byte[] s,int offset,int len,boolean passTurn)
public void messageModeSendBytes(byte[] s, int offset, int len, boolean passTurn)
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:
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)
Several command keys may be marked for notification. To be notified for all command keys, set the commandKey parameter to -1.
commandKey
- The command key for which notifications are to be sent.GlinkKey
,
removeNotifyCommandKey(int)
,
GlinkEvent.COMMAND_KEY_TYPED
public void notifyDataBlocks(boolean enable)
GlinkEvent.DATA_BLOCK
public void notifyKey(int key)
Several keys may be marked for notification. To receive notification for every key typed, set the commandKey parameter to -1.
key
- The key to be notified.removeNotifyKey(int)
,
GlinkEvent.KEY_TYPED
public void notifyScreenArea(GlinkScreenArea screenArea, int identity, boolean removeAfterwards)
screenArea
- The object that describes the screen area to be checked. When the
object matches the current screen the caller will be notified.identity
- 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.removeNotifyScreenArea(int)
,
isTurnKnown()
,
GlinkEvent.getValue()
public void notifyString(java.lang.String string, boolean caseSensitive, int identity, boolean removeAfterwards)
string
- The string for which a notification is to be sent.caseSensitive
- Specifies if the match is to be case sensitive.identity
- 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.removeNotifyString(int)
,
GlinkEvent.getValue()
,
notifyScreenArea
public void noToolbar()
public void queueGlinkEvents(boolean enable)
getGlinkEvent(int, long)
,
flushGlinkEvents()
,
addGlinkEventListener(no.gar.glink.api.GlinkEventListener)
public void removeConfiguration(GlinkConfiguration glinkConfiguration)
Restricted
addConfiguration(no.gar.glink.api.GlinkConfiguration)
public void removeGlinkEventListener(GlinkEventListener listener)
addGlinkEventListener(no.gar.glink.api.GlinkEventListener)
public void removeNotifyCommandKey(int commandKey)
notifyCommandKey(int)
,
GlinkKey
public void removeNotifyKey(int key)
notifyKey(int)
public boolean removeNotifyScreenArea(int identity)
identity
- Identifies the GlinkScreenArea object to be removed.
To remove all of the GlinkScreenArea notification objects set, supply -1 for the identity.
notifyScreenArea
public boolean removeNotifyString(int identity)
identity
- Identifies the string to be removed.
To remove all of the string notifications set, supply -1 for the identity.
notifyString(java.lang.String, boolean, int, boolean)
public void requestFocus()
public boolean restoreScreenContent(java.lang.String fileName)
fileName
- Specify file name or file path
saveScreenContent(java.lang.String)
public boolean saveScreenContent(java.lang.String fileName)
fileName
- Specify file name or file path
restoreScreenContent(java.lang.String)
public void scriptCommand(java.lang.String command)
public void scriptFile(java.lang.String fileName)
fileName
- If the script is stored with the Glink Config Server specify:
"server://filename" otherwise supply a full path name.public void scriptTerminate()
public void sendCommandKey(int key)
GlinkKey
public void sendKeys(java.lang.String text)
setString(java.lang.String, java.awt.Point)
public void sendKeys(java.lang.String text, java.awt.Point location)
setString(java.lang.String, java.awt.Point)
public void sendMacro(java.lang.String macro)
public void serverPort(java.lang.String port)
Restricted
port
- decimal port number.public boolean sessionName(java.lang.String name)
Restricted
name
- name of configuration profile.
public void setCursor(int x, int y)
getCursor()
public void setCursor(java.awt.Point location)
getCursor()
public void setGlinkDirectory(java.lang.String glinkDir)
Restricted
glinkDir
- Glink directory. glink.ini should be stored here.public void setInteractiveComParams(java.util.Vector params)
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.
params
- The vector containing the interactive communication parameters.
The vector should have been initialized with the getInteractiveComParams method.getInteractiveComParams()
,
GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED
public void setParameter(java.lang.String param)
Restricted
param
- String of the form "name=value".public void setParentFrame(java.awt.Frame frame)
getGlinkContainer()
,
setVisible(boolean)
,
isVisible()
,
start()
,
GlinkEvent.STARTED
public boolean setRestrictedMode(java.lang.String key, int level)
key
- 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)
public void setSplashScreenVisible(boolean visible)
public void setString(java.lang.String text, java.awt.Point location)
text
- String to place in the virtual screen.location
- Position where the string should be written.sendKeys(java.lang.String)
public void setVisible(boolean visible)
//PRO_END
public void start()
Restricted
public void stop()
Restricted
start()
public void suppressTurnLostEvents(boolean doSuppress)
doSuppress
- if true, TURN_LOST events won't be posted.public java.lang.String translateBuffer(java.lang.String buffer, int direction)
buffer
- String to translatedirection
- how to translate
ASCII_TO_EBCDIC
,
EBCDIC_TO_ASCII
public void userName(java.lang.String name)
Note that this user name is only used to access the Glink configuration database and is not used to log on to the host.
Restricted
name
- name of useruserPassword(java.lang.String)
public void userPassword(java.lang.String password)
Note that this password is only used to access the Glink configuration database and is not used to log on to the host. If the password is not specified or is not valid, Glink will bring up the Glink Logon dialog box.
Restricted
password
- userName(java.lang.String)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |