no.gar.glink.api
Class GlinkApiDebug

java.lang.Object
  extended by no.gar.glink.api.GlinkApi
      extended by no.gar.glink.api.GlinkApiDebug

public class GlinkApiDebug
extends GlinkApi

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

GlinkApiDebug

public GlinkApiDebug()

GlinkApiDebug

public GlinkApiDebug(java.applet.Applet ap)

GlinkApiDebug

public GlinkApiDebug(GlinkApi anotherApi)
Method Detail

addConfiguration

public void addConfiguration(GlinkConfiguration glinkConfiguration)
Description copied from class: GlinkApi
Adds the configuration to the list of available sessions.

Restricted

Overrides:
addConfiguration in class GlinkApi
See Also:
GlinkApi.sessionName, GlinkConfiguration

addGlinkEventListener

public void addGlinkEventListener(GlinkEventListener listener)
Description copied from class: GlinkApi
Specifies the listener which is to receive Glink events.

Overrides:
addGlinkEventListener in class GlinkApi
See Also:
GlinkEvent

connect

public void connect()
Description copied from class: GlinkApi
Connects to the session specified with the sessionName() method. At startup Glink automatically connects to the session specified with the sessionName method.

Restricted

Overrides:
connect in class GlinkApi
See Also:
GlinkApi.sessionName

debugStart

public void debugStart(java.io.PrintWriter debugStream)
Description copied from class: GlinkApi
Start or restart Glink debugging, send output to a stream. If debug was already running it is restarted, and subsequent debugging output is sent to debugStream. If debugging wasn't running it is started.

Restricted

Overrides:
debugStart in class GlinkApi
Parameters:
debugStream - destination stream for debug output
See Also:
GlinkApi.debugStop()

debugStop

public void debugStop()
Description copied from class: GlinkApi
Stop Glink debugging.

Restricted

Overrides:
debugStop in class GlinkApi
See Also:
GlinkApi.debugStart(java.io.PrintWriter)

disconnect

public void disconnect()
Description copied from class: GlinkApi
Disconnects the current session.

Restricted

Overrides:
disconnect in class GlinkApi

emulate

public void emulate(java.lang.String hostData)
Description copied from class: GlinkApi
This method emulates a string locally. The string may be simple text or contain emulation escape sequences. Normally this command will be used to process host data obtained with the messageModeReceive method when the "processHostData" parameter in the messageModeOn method is set to FALSE.

Overrides:
emulate in class GlinkApi
See Also:
GlinkApi.messageModeOn()

fieldRead

public java.lang.String fieldRead(int fieldNum)
Description copied from class: GlinkApi
Returns the data for the given variable field.

Overrides:
fieldRead in class GlinkApi
Parameters:
fieldNum - The variable field number where 1 is the first variable field and 0 means the current field.
Returns:
The field value.

findString

public java.awt.Point findString(java.lang.String str,
                                 java.awt.Point start,
                                 int length,
                                 int direction,
                                 boolean caseSensitive)
Description copied from class: GlinkApi
Searches the text plane for the given string. Null characters in the text plane are treated as spaces during search processing.

Overrides:
findString in class GlinkApi
Parameters:
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.
Returns:
If found, returns a Point object containing the location. If not found, returns a null. The string must be completely contained by the target area for the search to be successful.

flushGlinkEvents

public void flushGlinkEvents()
Description copied from class: GlinkApi
Flushes the GlinkEvent queue. Any GlinkEvents queued are removed from the queue.

Overrides:
flushGlinkEvents in class GlinkApi
See Also:
GlinkApi.getGlinkEvent(int, long), GlinkApi.queueGlinkEvents(boolean)

getAttributes

public int[] getAttributes(java.awt.Point start,
                           int len)
Description copied from class: GlinkApi
Returns the attributes for the target area

Overrides:
getAttributes in class GlinkApi
Parameters:
start - The row and column in which to start.
len - The length (number of attributes integer) from startPos.
See Also:
Attribute format.

getAttributes

public int[] getAttributes(java.awt.Point start,
                           java.awt.Point end)
Description copied from class: GlinkApi
Returns the attributes for the target area

Overrides:
getAttributes in class GlinkApi
See Also:
GlinkApi.getAttributes(java.awt.Point, int), Attribute format.

getAvailableSessions

public java.util.Vector getAvailableSessions()
Description copied from class: GlinkApi
Returns the sessions configured. Please note that if this method is called before Glink has started, the user name, password and either configserver or Glink directory must be set prior this call or must have been configured in glink.ini (except Glink directory), otherwise "null" will be returned and a GlinkEvent.ERROR_DETECTED will be posted.

Restricted

Overrides:
getAvailableSessions in class GlinkApi
See Also:
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

getBackgroundColor

public int getBackgroundColor(int attribute)
Description copied from class: GlinkApi
Returns the RGB value for the given field or character attribute. The color returned is affected by the Glink screen color settings for the current session.

Overrides:
getBackgroundColor in class GlinkApi
Returns:
The RGB value (Bits 24-31 are 0xff, 16-23 are red, 8-15 are green, 0-7 are blue)
See Also:
GlinkField

getColumns

public int getColumns()
Description copied from class: GlinkApi
Returns the number of columns in the presentation space.

Overrides:
getColumns in class GlinkApi
Returns:
The number of columns.

getCommunicationProtocol

public int getCommunicationProtocol()
Description copied from class: GlinkApi
Returns the current communication protocol.

Overrides:
getCommunicationProtocol in class GlinkApi
Returns:
the communication protocol value defined int the GlinkConfiguration class or -1 if Glink is not connected.
See Also:
GlinkConfiguration

getConfigParameter

public java.lang.String getConfigParameter(java.lang.String name)
Description copied from class: GlinkApi
Returns the value as a string for the specified parameter name. For example; getConfigParameter("screen.fontsize") may return the string "16" or getConfigParameter("emu.vipinittext") may return the string "false".

Overrides:
getConfigParameter in class GlinkApi
Returns:
Returns the configuration parameter as a string value or null if the name is not defined or Glink is not started
See Also:
setParameter

getCursor

public java.awt.Point getCursor()
Description copied from class: GlinkApi
Returns the current cursor position.

Overrides:
getCursor in class GlinkApi
Returns:
The cursor position.

getDataBytes

public byte[] getDataBytes(java.awt.Point start,
                           int len)
Description copied from class: GlinkApi
Returns the screen characters (bytes) for the target area in the configured character set

Overrides:
getDataBytes in class GlinkApi

getDataBytes

public byte[] getDataBytes(java.awt.Point start,
                           java.awt.Point end)
Description copied from class: GlinkApi
Returns the screen characters (bytes) for the target area in the configured character set

Overrides:
getDataBytes in class GlinkApi

getDataChars

public char[] getDataChars(java.awt.Point start,
                           int len)
Description copied from class: GlinkApi
Returns the screen characters for the target area

Overrides:
getDataChars in class GlinkApi
Parameters:
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.
Returns:
The screen characters at the given location

getDataChars

public char[] getDataChars(java.awt.Point start,
                           java.awt.Point end)
Description copied from class: GlinkApi
Returns the screen characters for the target area

Overrides:
getDataChars in class GlinkApi
Parameters:
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).
Returns:
The screen characters at the given location

getDataLength

public int getDataLength(java.awt.Point start,
                         java.awt.Point end)
Description copied from class: GlinkApi
Returns the length for the target area.

Overrides:
getDataLength in class GlinkApi

getDefaultColorAttribute

public int getDefaultColorAttribute()
Description copied from class: GlinkApi
Returns the default color attribute settings.

For example, the following call gets the RGB value for the default background color:
getBackgroundColor(getDefaultColorAttribute());

Overrides:
getDefaultColorAttribute in class GlinkApi
Returns:
Returns the default color attribute settings. The foreground color is given in bits 0-3 the and background color is given in bits 4-6.
See Also:
Attribute format., GlinkApi.getForegroundColor(int), GlinkApi.getBackgroundColor(int)

getEmulationType

public int getEmulationType()
Description copied from class: GlinkApi
Returns the current emulation type.

Overrides:
getEmulationType in class GlinkApi
Returns:
the emulation type value defined int the GlinkConfiguration class or -1 if Glink is not connected.
See Also:
GlinkConfiguration

getFields

public GlinkFields getFields()
Description copied from class: GlinkApi
Returns the GlinkFields object associated with the current screen. GlinkFields contains all the fields in the current screen. For unformatted screens, the returned object contains only one input field that contains the whole presentation space.

Overrides:
getFields in class GlinkApi

getFieldsEx

public GlinkFields getFieldsEx()
Description copied from class: GlinkApi
Returns the GlinkFields object associated with the current screen. GlinkFields contains all the fields in the current screen. For formatted screens, this method will return the very same as the getFields() method.

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).

Overrides:
getFieldsEx in class GlinkApi

getForegroundColor

public int getForegroundColor(int attribute)
Description copied from class: GlinkApi
Returns the RGB value for the given field or character attribute. The color returned is affected by the Glink screen color settings for the current session.

Overrides:
getForegroundColor in class GlinkApi
Returns:
The RGB value (Bits 24-31 are 0xff, 16-23 are red, 8-15 are green, 0-7 are blue)
See Also:
GlinkField

getGlinkContainer

public java.awt.Container getGlinkContainer()
Description copied from class: GlinkApi
Returns the object that contains all the visible Glink components. Normally Glink starts up in its own frame. However, if you want to include Glink in a panel within your own frame, use this call to get hold of the Glink container and add it to the panel. Please note that Glink must be startet and set not visible (glink.setVisible(false)) prior using this call.

Overrides:
getGlinkContainer in class GlinkApi
Returns:
The Glink container or null if the Glink frame is visible or the GlinkEvent.STARTED has not yet been posted.
See Also:
GlinkApi.setVisible(boolean), GlinkApi.isVisible(), GlinkApi.start(), GlinkEvent.STARTED

getGlinkEvent

public GlinkEvent getGlinkEvent(int eventCode,
                                long timeout)
Description copied from class: GlinkApi
Returns the first GlinkEvent available from the GlinkEvent queue. Use the queueGlinkEvents method to enable GlinkEvents queuing. The GlinkEvents queuing can be used instead of a GlinkEvent listener to get hold of GlinkEvents.

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.

Overrides:
getGlinkEvent in class GlinkApi
Parameters:
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.
Returns:
First available GlinkEvent or null if no GlinkEvent is available.
See Also:
GlinkApi.queueGlinkEvents(boolean), GlinkApi.flushGlinkEvents(), GlinkEvent, GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)

getGlinkFrame

public java.awt.Frame getGlinkFrame()
Description copied from class: GlinkApi
Returns the Glink frame. The Glink frame is a top-level window with a title and a border. If you want to add the Glink screen to your own frame, use the getGlinkContainer method.

Overrides:
getGlinkFrame in class GlinkApi
Returns:
The Glink frame or null if the GlinkEvent.STARTED has not yet been posted.
See Also:
GlinkApi.getGlinkContainer()

getGlinkVersion

public java.lang.String getGlinkVersion()
Description copied from class: GlinkApi
Returns the Glink version information as a text string.

Overrides:
getGlinkVersion in class GlinkApi

getInteractiveComParams

public java.util.Vector getInteractiveComParams()
Description copied from class: GlinkApi
Returns the interactive communication parameters. This method should be called only if the following event is posted:
 GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED
The 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);
 

Overrides:
getInteractiveComParams in class GlinkApi
Returns:
A vector with one element per interactive config parameter.
See Also:
GlinkApi.setInteractiveComParams(java.util.Vector), GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED

getMarkedScreenArea

public GlinkScreenArea getMarkedScreenArea()
Description copied from class: GlinkApi
Returns a screen area object for the current screen selection. The method checks the current screen and if any text is marked, returns a GlinkScreenArea object for the marked text. Please note that Glink supports two modes of marking; marking done on a line-by-line basis and rectangular marking. Use the GlinkScreenArea.isRectangle() to check the marking mode used.

Overrides:
getMarkedScreenArea in class GlinkApi
Returns:
A GlinkScreenArea object describing the marked area or null if no text has been marked.
See Also:
GlinkApi.getScreenArea(java.awt.Point, java.awt.Point, boolean), GlinkApi.isScreenAreaMatch(no.gar.glink.api.GlinkScreenArea)

getProperty

public java.lang.String getProperty(java.lang.String ky)
Description copied from class: GlinkApi
Returns the the property for the given key.

Overrides:
getProperty in class GlinkApi
Returns:
Returns the property or null if the key is not defined or Glink is not started

Key Description
device Returns the allocated LU name for TN3270E or the device name for TN5250

getRows

public int getRows()
Description copied from class: GlinkApi
Returns the number of rows in the presentation space.

Overrides:
getRows in class GlinkApi
Returns:
The number of rows.

getScreenArea

public GlinkScreenArea getScreenArea(java.awt.Point start,
                                     java.awt.Point end,
                                     boolean rect)
Description copied from class: GlinkApi
Returns an object for the given screen area or null if the positions given are not within the current screen.

Overrides:
getScreenArea in class GlinkApi
Parameters:
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.
Returns:
A GlinkScreenArea object for the given area
See Also:
GlinkApi.getMarkedScreenArea(), GlinkApi.notifyScreenArea, GlinkApi.isScreenAreaMatch(no.gar.glink.api.GlinkScreenArea)

getScreenCharacterSet

public java.lang.String getScreenCharacterSet()
Description copied from class: GlinkApi
Returns the name of the character set configured. The character set is used to transform between 8 bits character and 16 Unicode characters The default value returned is null which means that no character set is configured. The ISO-8859-1 standard will be used in this case.

Overrides:
getScreenCharacterSet in class GlinkApi

getScreenMode

public int getScreenMode()
Description copied from class: GlinkApi
If the host application has used field attributes to define fields on the screen, then the current screen is formatted. If there are no fields defined, then the current screen is unformatted.

Overrides:
getScreenMode in class GlinkApi
Returns:
The screen mode for the current screen (SCREEN_FORMATTED, SCREEN_UNFORMATTED or SCREEN_UNFORMATTED_CHAR).
See Also:
GlinkApi.SCREEN_FORMATTED, GlinkApi.SCREEN_UNFORMATTED, GlinkApi.SCREEN_UNFORMATTED_CHAR

getSessionName

public java.lang.String getSessionName()
Description copied from class: GlinkApi
Returns the name of the current session

Overrides:
getSessionName in class GlinkApi

getString

public java.lang.String getString()
Description copied from class: GlinkApi
Returns the entire text plane of the presentation space as a string. All null characters and Field Attribute characters are returned as space characters.

Overrides:
getString in class GlinkApi
Returns:
The entire text plane as a string

getString

public java.lang.String getString(java.awt.Point start,
                                  java.awt.Point end)
Description copied from class: GlinkApi
Returns the text at the given location in the presentation space as a string. All null characters and Field Attribute characters are returned as space characters.

Overrides:
getString in class GlinkApi
Parameters:
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).
Returns:
The text as a string at the given location

getVariableFields

public GlinkFields getVariableFields()
Description copied from class: GlinkApi
Returns the GlinkFields object associated with the current screen with variable fields only. In other words only unprotected fields are contained in the returned GlinkFields object. For unformatted screens, the returned object contains only one GlinkField item that contains the whole presentation space.

Overrides:
getVariableFields in class GlinkApi

getVariableFieldsEx

public GlinkFields getVariableFieldsEx()
Description copied from class: GlinkApi
Returns the GlinkFields object associated with the current screen with variable fields only. In other words only unprotected fields are contained in the returned GlinkFields object. For formatted screens, this method will return the very same as the getVariableFields() method.

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.

Overrides:
getVariableFieldsEx in class GlinkApi

isScreenAreaMatch

public boolean isScreenAreaMatch(GlinkScreenArea sa)
Description copied from class: GlinkApi
Returns true if the supplied GlinkScreenArea object matches the current screen.

Overrides:
isScreenAreaMatch in class GlinkApi
See Also:
GlinkApi.getScreenArea(java.awt.Point, java.awt.Point, boolean)

isSessionAvailable

public boolean isSessionAvailable(java.lang.String name,
                                  java.util.Vector sessions)
Description copied from class: GlinkApi
Returns true if the given session is available.

Restricted

Overrides:
isSessionAvailable in class GlinkApi
See Also:
GlinkApi.getAvailableSessions()

markScreenArea

public void markScreenArea(java.awt.Point start,
                           java.awt.Point end,
                           boolean rect)
Description copied from class: GlinkApi
This method marks the given screen area. Glink supports two modes of marking; marking done on a line-by-line basis and rectangular marking.

Overrides:
markScreenArea in class GlinkApi
Parameters:
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.
See Also:
GlinkApi.getMarkedScreenArea()

messageModeReceive

public java.lang.String messageModeReceive()
Description copied from class: GlinkApi
This method 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 string is always in Unicode, regardless of the host character set.

Overrides:
messageModeReceive in class GlinkApi
Returns:
The string of character received or null if no data is available
See Also:
GlinkApi.messageModeReceiveSync(), GlinkApi.messageModeReceiveBytes(), GlinkApi.messageModeReceiveBytesSync(), GlinkEvent.MESSAGE_MODE_DATA, GlinkApi.emulate(java.lang.String)

messageModeReceiveBytes

public byte[] messageModeReceiveBytes()
Description copied from class: GlinkApi
This method returns the byte array received from the host since the last time this method or messageModeReceive() was called. Glink must be in message mode operation for this call to return any data. The returned byte array is always in the host native character set.

Overrides:
messageModeReceiveBytes in class GlinkApi
Returns:
an array of bytes received from the host, or null if no data available.
See Also:
GlinkApi.messageModeReceive(), GlinkApi.messageModeReceiveSync(), GlinkApi.messageModeReceiveBytesSync(), GlinkEvent.MESSAGE_MODE_DATA, GlinkApi.emulate(java.lang.String)

messageModeReceiveBytesSync

public byte[] messageModeReceiveBytesSync()
Description copied from class: GlinkApi
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.

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.

Overrides:
messageModeReceiveBytesSync in class GlinkApi
Returns:
array of host data bytes, or null if no data is available.
See Also:
GlinkEvent.MESSAGE_MODE_DATA, GlinkApi.messageModeOn(), GlinkApi.isTurnKnown(), GlinkApi.isTurnReceived(), GlinkApi.messageModeReceive(), GlinkApi.messageModeReceiveBytes(), GlinkApi.messageModeReceiveSync()

messageModeReceiveBytesSync

public byte[] messageModeReceiveBytesSync(int maxlen)
Description copied from class: GlinkApi
This method waits until the requested number of characters has been received from the host before it returns these.

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.

Overrides:
messageModeReceiveBytesSync in class GlinkApi

messageModeReceiveSync

public java.lang.String messageModeReceiveSync()
Description copied from class: GlinkApi
This method waits until the turn has been received from the host and then returns the string of characters received.

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.

Overrides:
messageModeReceiveSync in class GlinkApi
Returns:
The string of character received or null if no data is available
See Also:
GlinkEvent.MESSAGE_MODE_DATA, GlinkApi.messageModeOn(), GlinkApi.isTurnKnown(), GlinkApi.isTurnReceived(), GlinkApi.messageModeReceive(), GlinkApi.messageModeReceiveBytes(), GlinkApi.messageModeReceiveBytesSync()

messageModeReceiveSync

public java.lang.String messageModeReceiveSync(int maxlen)
Description copied from class: GlinkApi
This method waits until the requested number of characters has been received from the host before it returns these.

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.

Overrides:
messageModeReceiveSync in class GlinkApi

messageModeSend

public void messageModeSend(java.lang.String s)
Description copied from class: GlinkApi
This method bypasses the Glink emulation and sends the string directly to the host. The turn is passed to the host.

The data is assumed to be a Unicode string. It is translated to the host native character set before transmission.

Overrides:
messageModeSend in class GlinkApi
See Also:
GlinkApi.messageModeSend(String s,boolean passTurn)

messageModeSend

public void messageModeSend(java.lang.String s,
                            boolean passTurn)
Description copied from class: GlinkApi
This method bypasses the Glink emulation and sends a string directly to the host. Several strings of data may be sent without giving up the turn. The passTurn flag is used to signal that this is the end of the data and that the turn should be passed to the host side.

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:

For other communications protocols (such as Telnet, raw TCP/IP and Minitel) the passTurn argument is ignored. In these cases you may have to add a go-ahead indicator to your data if you want to pass the turn to the host, such as ETX (0x03) or Carriage Return (0x0D).

Overrides:
messageModeSend in class GlinkApi
Parameters:
s - string to send to the host
passTurn - true if turn is to be passed to the host, false if not (see above).

messageModeSendBytes

public void messageModeSendBytes(byte[] s,
                                 int offset,
                                 int len)
Description copied from class: GlinkApi
This method bypasses the Glink emulation and sends a byte array directly to the host. The turn is passed to the host.

The data is assumed to be in the host native character set.

Overrides:
messageModeSendBytes in class GlinkApi
Parameters:
s - the data buffer
offset - starting offset to send from
len - number of bytes to send
See Also:
GlinkApi.messageModeSendBytes(byte[] s,int offset,int len,boolean passTurn)

messageModeSendBytes

public void messageModeSendBytes(byte[] s,
                                 int offset,
                                 int len,
                                 boolean passTurn)
Description copied from class: GlinkApi
This method bypasses the Glink emulation and sends a byte array directly to the host. Several data buffers may be sent without giving up the turn. The passTurn flag is used to signal that this is the end of the data and that the turn should be passed to the host side.

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:

For other communications protocols (such as Telnet, raw TCP/IP and Minitel) the passTurn argument is ignored. In these cases you may have to add a go-ahead indicator to your data if you want to pass the turn to the host, such as ETX (0x03) or Carriage Return (0x0D).

Overrides:
messageModeSendBytes in class GlinkApi
Parameters:
s - the data buffer
offset - starting index to send from
len - number of bytes to send
passTurn - true if turn is to be passed to the host, false if not (see above).

notifyCommandKey

public void notifyCommandKey(int commandKey)
Description copied from class: GlinkApi
Instructs Glink to fire a GlinkEvent.COMMAND_KEY_TYPED event when the given command key is typed. This command key will then be ignored by Glink. For the command key to be processed by Glink, send the command key back to Glink with the sendCommandKey method when notified.

Several command keys may be marked for notification. To be notified for all command keys, set the commandKey parameter to -1.

Overrides:
notifyCommandKey in class GlinkApi
Parameters:
commandKey - The command key for which notifications are to be sent.
See Also:
GlinkKey, GlinkApi.removeNotifyCommandKey(int), GlinkEvent.COMMAND_KEY_TYPED

notifyDataBlocks

public void notifyDataBlocks(boolean enable)
Description copied from class: GlinkApi
Turns on of off posting of GlinkEvent.DATA_BLOCK events. The GlinkEvent.DATA_BLOCK event is normally not needed, you should wait for the TURN_RECEIVED before processing the received data.

Overrides:
notifyDataBlocks in class GlinkApi
See Also:
GlinkEvent.DATA_BLOCK

notifyGlinkEvent

public void notifyGlinkEvent(int eventCode)
Overrides:
notifyGlinkEvent in class GlinkApi

notifyGlinkEvent

public void notifyGlinkEvent(int eventCode,
                             int value,
                             java.lang.String valueText)
Overrides:
notifyGlinkEvent in class GlinkApi

notifyKey

public void notifyKey(int ky)
Description copied from class: GlinkApi
Instructs Glink to fire a GlinkEvent.KEY_TYPED event when the given key is typed. This key will then be ignored by Glink. For the key to be processed by Glink, send the key back to Glink with the sendKeys method when the notification is received.

Several keys may be marked for notification. To receive notification for every key typed, set the commandKey parameter to -1.

Overrides:
notifyKey in class GlinkApi
Parameters:
ky - The key to be notified.
See Also:
GlinkApi.removeNotifyKey(int), GlinkEvent.KEY_TYPED

notifyScreenArea

public void notifyScreenArea(GlinkScreenArea screenArea,
                             int id,
                             boolean removeAfterwards)
Description copied from class: GlinkApi
Instructs Glink to fire a GlinkEvent.SCREEN_AREA_MATCH event when the given object matches the current screen. Several objects may be waited for, each with its own identity value. The objects are checked each time Glink receives the turn. For some host connections turn signals are not generated. Use the isTurnKnown() method to check if the current connection gives turn signals.

Overrides:
notifyScreenArea in class GlinkApi
Parameters:
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.
See Also:
GlinkApi.removeNotifyScreenArea(int), GlinkApi.isTurnKnown(), GlinkEvent.getValue()

notifyString

public void notifyString(java.lang.String s,
                         boolean caseSensitive,
                         int id,
                         boolean removeAfterwards)
Description copied from class: GlinkApi
Instructs Glink to fire a GlinkEvent.STRING_RECEIVED event when the given string is received from host. Several strings may be waited for, each with its own identity value. The check is preformed before the received data is processed by the emulation module of Glink. Use the notifyScreenArea method instead if you want the check to be performed after the received data has been processed by Glink.

Overrides:
notifyString in class GlinkApi
Parameters:
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.
See Also:
GlinkApi.removeNotifyString(int), GlinkEvent.getValue(), GlinkApi.notifyScreenArea

queueGlinkEvents

public void queueGlinkEvents(boolean enable)
Description copied from class: GlinkApi
Enables or disables the queuing of GlinkEvents. GlinkEvents queuing can be used instead of a GlinkEvent listener to get hold of GlinkEvents. Use the getGlinkEvent method to get hold of GlinkEvents queued.

Overrides:
queueGlinkEvents in class GlinkApi
See Also:
GlinkApi.getGlinkEvent(int, long), GlinkApi.flushGlinkEvents(), GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)

removeConfiguration

public void removeConfiguration(GlinkConfiguration glinkConfiguration)
Description copied from class: GlinkApi
Removes the configuration previously set with the addConfiguration method.

Restricted

Overrides:
removeConfiguration in class GlinkApi
See Also:
GlinkApi.addConfiguration(no.gar.glink.api.GlinkConfiguration)

removeGlinkEventListener

public void removeGlinkEventListener(GlinkEventListener listener)
Description copied from class: GlinkApi
Removes the specified listener set with the addGlinkEventListener method.

Overrides:
removeGlinkEventListener in class GlinkApi
See Also:
GlinkApi.addGlinkEventListener(no.gar.glink.api.GlinkEventListener)

removeNotifyCommandKey

public void removeNotifyCommandKey(int commandKey)
Description copied from class: GlinkApi
Removes the notification for the command key previously set with the notifyCommandKey method. If the commandKey param is -1, all command key notifications are removed.

Overrides:
removeNotifyCommandKey in class GlinkApi
See Also:
GlinkApi.notifyCommandKey(int), GlinkKey

removeNotifyKey

public void removeNotifyKey(int ky)
Description copied from class: GlinkApi
Removes the notification for the key previously set with the notifyKey method. If the key param is -1, all key notifications are removed.

Overrides:
removeNotifyKey in class GlinkApi
See Also:
GlinkApi.notifyKey(int)

removeNotifyScreenArea

public boolean removeNotifyScreenArea(int id)
Description copied from class: GlinkApi
Removes the GlinkScreenArea object associated with the given identity from the list of objects being checked for a match. If you only want to be notified the first time the object matches the current screen, you may set the "removeAfterwards" parameter in the notifyScreenArea call itself rather than using this call.

Overrides:
removeNotifyScreenArea in class GlinkApi
Parameters:
id - Identifies the GlinkScreenArea object to be removed. To remove all of the GlinkScreenArea notification objects set, supply -1 for the identity.
Returns:
True if the object with the given identity is found, otherwise false.
See Also:
GlinkApi.notifyScreenArea

removeNotifyString

public boolean removeNotifyString(int id)
Description copied from class: GlinkApi
Removes the string associated with the given identity from the list of strings being checked for. If you only want to be notified the first time the string is received from the host, you may set the "removeAfterwards" parameter in the notifyString call itself rather than using this call.

Overrides:
removeNotifyString in class GlinkApi
Parameters:
id - Identifies the string to be removed. To remove all of the string notifications set, supply -1 for the identity.
Returns:
True if the string with the given identity is found, otherwise false.
See Also:
GlinkApi.notifyString(java.lang.String, boolean, int, boolean)

restoreScreenContent

public boolean restoreScreenContent(java.lang.String fileName)
Description copied from class: GlinkApi
Restores the screen previously saved. The operation will fail if the given file does not exists, the file has not been created by the saveContentScreen method or the current emulation type does not match the saved one.

Overrides:
restoreScreenContent in class GlinkApi
Parameters:
fileName - Specify file name or file path
Returns:
If the operation fails, a GlinkEvent.ERROR_DETECTED will be posted with the error type code GlinkEvent.VE_EMULATION_ERROR and additional error type text.
See Also:
GlinkApi.saveScreenContent(java.lang.String)

saveScreenContent

public boolean saveScreenContent(java.lang.String fileName)
Description copied from class: GlinkApi
Saves the current screen content to the file specified. The file will be created if is does not exist, else it will be overwritten. All data necessary to recreate the screen is saved. The screen is recreated with the restoreScreenContent method.

Overrides:
saveScreenContent in class GlinkApi
Parameters:
fileName - Specify file name or file path
Returns:
Return false if the operation fails. In addition, a GlinkEvent.ERROR_DETECTED will be posted with the error type code GlinkEvent.VE_EMULATION_ERROR and additional error type text.
See Also:
GlinkApi.restoreScreenContent(java.lang.String)

scriptCommand

public void scriptCommand(java.lang.String command)
Description copied from class: GlinkApi
Activates the given script command.

Overrides:
scriptCommand in class GlinkApi

scriptFile

public void scriptFile(java.lang.String fileName)
Description copied from class: GlinkApi
Activates the given script file.

Overrides:
scriptFile in class GlinkApi
Parameters:
fileName - If the script is stored with the Glink Config Server specify: "server://filename" otherwise supply a full path name.

scriptTerminate

public void scriptTerminate()
Description copied from class: GlinkApi
Terminates the current script.

Overrides:
scriptTerminate in class GlinkApi

sendCommandKey

public void sendCommandKey(int ky)
Description copied from class: GlinkApi
The sendCommandKey method sends a "command" keystroke to the virtual screen. These command keys can be thought of as special keystrokes, like the Enter key, the Tab key or the Page Up key. All valid special key values are contained in the GlinkKey class.

Overrides:
sendCommandKey in class GlinkApi
See Also:
GlinkKey

sendKeys

public void sendKeys(java.lang.String text)
Description copied from class: GlinkApi
Sends a string to the emulator starting at the current cursor location. The sendKeys method sends a string of keys to the virtual screen. This method acts as though keystrokes were being typed from the keyboard.

Overrides:
sendKeys in class GlinkApi
See Also:
GlinkApi.setString(java.lang.String, java.awt.Point)

sendKeys

public void sendKeys(java.lang.String text,
                     java.awt.Point location)
Description copied from class: GlinkApi
Sends a string to the emulator starting at the given cursor location. The sendKeys method sends a string of keys to the virtual screen. This method acts as though keystrokes were being typed from the keyboard.

Overrides:
sendKeys in class GlinkApi
See Also:
GlinkApi.setString(java.lang.String, java.awt.Point)

setCursor

public void setCursor(int x,
                      int y)
Description copied from class: GlinkApi
Moves the cursor to the given position.

Overrides:
setCursor in class GlinkApi
See Also:
GlinkApi.getCursor()

setCursor

public void setCursor(java.awt.Point location)
Description copied from class: GlinkApi
Moves the cursor to the given position.

Overrides:
setCursor in class GlinkApi
See Also:
GlinkApi.getCursor()

setInteractiveComParams

public void setInteractiveComParams(java.util.Vector params)
Description copied from class: GlinkApi
Sets the interactive communication parameters. This method should be used only if the following event is posted:
 GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED
The setInteractiveComParams must be used together with the getInteractiveComParams, see the getInteractiveComParams for the description on how to use these calls.

Overrides:
setInteractiveComParams in class GlinkApi
Parameters:
params - The vector containing the interactive communication parameters. The vector should have been initialized with the getInteractiveComParams method.
See Also:
GlinkApi.getInteractiveComParams(), GlinkEvent.INTERACTIVE_COM_PARAMS_REQUESTED

setParameter

public void setParameter(java.lang.String param)
Description copied from class: GlinkApi
Add a configuration parameter to the glink.ini set. Syntax is "name=value". Calling this method will set the corresponding parameter as if it were entered in glink.ini (or via PARAM tags in the HTML APPLET tag). If the syntax of the argument is invalid, no action occurs.

Restricted

Overrides:
setParameter in class GlinkApi
Parameters:
param - String of the form "name=value".

setParentFrame

public void setParentFrame(java.awt.Frame fr)
Description copied from class: GlinkApi
Normally Glink starts up in its own frame. However, if the GlinkContainer is included in a panel within your own frame, you may set your frame as the parent frame. The only effect this gives is that Glink's own dialog boxes will get a parent frame and remain on top on this when displayed. Please note that Glink must be startet and set not visible (glink.setVisible(false)) prior using this call.

Overrides:
setParentFrame in class GlinkApi
See Also:
GlinkApi.getGlinkContainer(), GlinkApi.setVisible(boolean), GlinkApi.isVisible(), GlinkApi.start(), GlinkEvent.STARTED

setRestrictedMode

public boolean setRestrictedMode(java.lang.String ky,
                                 int level)
Description copied from class: GlinkApi
Switch restricted mode on or off. In Restricted mode, methods marked as Restricted will silently do nothing. A key is required to switch restricted mode on, and the same key must be provided to exit restricted mode.

Overrides:
setRestrictedMode in class GlinkApi
Parameters:
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.
Returns:
true if operation succeeded, otherwise false.

setScreenSize

public void setScreenSize(int columns,
                          int rows)
Description copied from class: GlinkApi
For most emulations the screen size is 80 columns times 24 rows. However some emulation modes may use a different size. For Glink to be able to switch between most of the different screen sizes, the default screen size is set to 132 columns times 32 rows, which means that the actual screen size may be less than or equal to this size. For larger screens to be suported you must increase the size. On the other hand, if you plan to run a number of Glink sessions simultaneously and you know the screen size is less than the default, use this method to reduce the memory allocated. The method must be called before the starting the initial Glink session.

Overrides:
setScreenSize in class GlinkApi

setString

public void setString(java.lang.String text,
                      java.awt.Point location)
Description copied from class: GlinkApi
The setString method sends a string to the virtual screen at the specified location. The string will only overwrite unprotected fields, and any parts of the string which fall over protected fields will be discarded.

Overrides:
setString in class GlinkApi
Parameters:
text - String to place in the virtual screen.
location - Position where the string should be written.
See Also:
GlinkApi.sendKeys(java.lang.String)

setVisible

public void setVisible(boolean visible)
Description copied from class: GlinkApi
Specifies whether the Glink screen (frame) should be visible or not. //PRO_BEGIN

Overrides:
setVisible in class GlinkApi
See Also:
//PRO_END

start

public void start()
Description copied from class: GlinkApi
Starts Glink. The GlinkEvent.STARTED event code is posted when Glink is started.

Restricted

Overrides:
start in class GlinkApi

stop

public void stop()
Description copied from class: GlinkApi
Stops Glink. The GlinkEvent.STOPPED event code is posted when Glink is stopped.

Restricted

Overrides:
stop in class GlinkApi
See Also:
GlinkApi.start()

translateBuffer

public java.lang.String translateBuffer(java.lang.String buffer,
                                        int direction)
Description copied from class: GlinkApi
Translate a string between ASCII and EBCDIC. This is a utility method for general-purpose use.

Overrides:
translateBuffer in class GlinkApi
Parameters:
buffer - String to translate
direction - how to translate
Returns:
translated string.
See Also:
GlinkApi.ASCII_TO_EBCDIC, GlinkApi.EBCDIC_TO_ASCII