com.twinsoft.twinj
Interface iJavelin


public interface iJavelin

This is the interface for Javelin API.


Field Summary
static java.lang.String AS400
          Defines a IBM 5250 (AS/400) session.
static char AT_AUTO_ENTER
           
static char AT_AUTO_TAB
           
static char AT_BLINK
          Mask for blink attribute bit: 0x1000 (0001 0000 0000 0000).
static char AT_BOLD
          Mask for bold attribute bit: 0x0800 (0000 0100 0000 0000).
static int AT_COLOR_BLACK
           
static int AT_COLOR_BLUE
           
static int AT_COLOR_CYAN
           
static int AT_COLOR_GREEN
           
static int AT_COLOR_MAGENTA
           
static int AT_COLOR_RED
           
static int AT_COLOR_WHITE
           
static int AT_COLOR_YELLOW
           
static char AT_DOUBLEHEIGHT
          Mask for double height: 0x0040 (0000 0000 0100 0000).
static char AT_DOUBLEWIDTH
          Mask for double width attribute bit: 0x0080 (0000 0000 1000 0000).
static char AT_DRCS
          Mask for DRCS (downloadable font) attribute bit: 0x8000 (0100 0000 0000 0000).
static int AT_FIELD_ATTRIBUTE
           
static int AT_FIELD_HIDDEN
          Mask for hidden field attribute: 0x0C0000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static int AT_FIELD_HIGH_INTENSITY
          Mask for high intensity field attribute: 0x040000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static int AT_FIELD_MODIFIED
          Mask for modified field attribute: 0x010000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static int AT_FIELD_NUMERIC
          Mask for numeric field attribute: 0x100000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static int AT_FIELD_PEN_SELECTABLE
          Mask for pen selectable field attribute: 0x080000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static int AT_FIELD_PROTECTED
          Mask for protected Field attribute bit: 0x200000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static int AT_FIELD_RESERVED
          Mask for reserved field attribute: 0x020000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.
static char AT_HIDDEN
          Mask for hidden attribute bit: 0x8000 (1000 0000 0000 0000).
static char AT_INK
          Mask for INK attribute: 0x0007 (0000 0000 0000 0111).
static char AT_INVERT
          Mask for inverse attribute bit: 0x0200 (0000 0001 0000 0000).
static char AT_MASKED
          Mask for masked attribute bit: 0x2000 (0010 0000 0000 0000).
Note: relevant for VT220 only.
static char AT_PAPER
          Mask for PAPER attribute: 0x0038 (0000 0000 0011 1000).
static char AT_PROTECTED
          Mask for protected attribute bit: 0x4000 (0100 0000 0000 0000).
static char AT_UNDERLINE
          Mask for underline attribute bit: 0x0100 (0000 0001 0000 0000).
static char AT_UPHALF
          Mask for double height upper row attribute bit: 0x0400 (0000 0100 0000 0000).
Note: relevant for VT220 only.
static java.lang.String DKU
          Defines a Bull DKU session.
static java.lang.String SNA
          Defines a IBM 3270 (SNA) session.
static java.lang.String TN5250
          Defines a Twinsoft 5250 (AS/400) session.
static java.lang.String VDX
          Defines a videotex session.
static java.lang.String VT
          Defines a VT220 session.
 
Method Summary
 void addKeyListener(java.awt.event.KeyListener l)
          Registers a client on the keyListener.
 void addZoneListener(com.twinsoft.twinj.zoneListener l)
          Registers a client on the zoneListener.
 void clearTrigger()
          Remove all arrived trigger from the MsgQueue.
 void connect()
          Connects Javelin to a server.
 boolean connect(int timeout)
          Connects synchronously Javelin to a server.
 void deleteWaitAts()
          Deletes all triggers set by the waitAt() method.
 void deleteWaitFors()
          Deletes all triggers set by the waitFor() method.
 void disconnect()
          Disconnects Javelin from the current connected server.
 void doAction(java.lang.String action)
          Executes an action on the emulator.
 char getChar(int column, int line)
          Returns the ASCII code of the character at coordinates (column, line).
 int getCharAttribute(int column, int line)
          Returns the character attribute at coordinates (column, line).
 int getCurrentColumn()
          Returns the current column of the caret.
 int getCurrentLine()
          Returns the current line of the caret.
 boolean getDataStableOnCursorOn()
          Retrieves the DataStableOnCursorOn flag.
 int getDataStableThreshold()
          Gets the dataStableThreshold value
 int getFieldAttribute(int fieldIndex)
          Gets the attribute of a given field.
 int getFieldColumn(int fieldIndex)
          Gets the column of a given field.
 int getFieldLength(int fieldIndex)
          Gets the lenght of a given field.
 int getFieldLine(int fieldIndex)
          Gets the line of a given field.
 java.lang.String getFieldText(int fieldIndex)
          Gets the text of a given field.
 int getNumberOfFields()
          Gets the number of fields on the screen.
 int getScreenHeight()
          Gets the number of lines of the current emulator screen
 int getScreenWidth()
          Gets the number of columns of the current emulator screen
 java.awt.Rectangle getSelectionZone()
          Gets the current selection zone on Javelin.
 java.lang.String getString(int column, int line, int length)
          Returns the string at coordinates (column, line).
 java.lang.String getTerminalClass()
          Retrieves the terminal class of the Javelin object.
 boolean isConnected()
          Retrieves the Javelin connection state.
 void moveCursor(int column, int line)
          Moves the cursor to coordinates (column, line).
 boolean printBuffer(java.lang.String printerPort, java.lang.String buffer)
          Writes a string on a given printer port.
 void removeAllZoneListeners()
          Unregisters all clients on the zoneListener.
 void removeKeyListener(java.awt.event.KeyListener l)
          Unregisters a client on the keyListener.
 void removeZoneListener(com.twinsoft.twinj.zoneListener l)
          Unregisters a client on the zoneListener.
 void send(java.lang.String keystrokes)
          Sends a string as if the user has stroken it on keyboard.
 void setAutoConnect(boolean bAutoConnect)
          Sets the auto connect flag.
 void setChar(int column, int line, char c)
          Sets the ASCII code of the character at coordinates (column, line).
 void setClientConfig(java.util.Properties p)
          Sets the current terminal properties.
 void setClientConfig(java.lang.String configuration)
          Sets a new configuration for Javelin.
 void setCommDevice(java.lang.String commDevice)
          Sets the communication device, i.e.
 void setDataStableOnCursorOn(boolean bool)
          Sets the DataStableOnCursorOn flag.
 void setDataStableThreshold(int val)
          Sets the dataStableThreshold value.
 void setDoCapture(boolean bDoCapture)
          Sets the capture flag.
 void setDteAddress(java.lang.String connectionString)
          Sets the connection string.
 void setGroup(java.lang.String group)
          Sets the group of the user.
 void setLogOutputStream(java.io.OutputStream outputStream)
          Defines the output stream for traces.
 void setSelectionZone(java.awt.Rectangle zone)
          Sets a selection zone on Javelin.
 void setServiceCode(java.lang.String serviceCode)
          Sets the service code (depending of the terminal class).
 void setVicUser(java.lang.String vicUser)
          Sets the name of the user.
 void showZones(java.util.Vector rv, java.util.Vector cv)
          Shows Zones on the emulator screen.
 void Trace(java.lang.Exception e)
          Writes an exception in the emulator log output stream.
 void Trace(int level, java.lang.String message)
          Writes a message in the emulator log output stream with a given log level.
 void Trace(java.lang.String message)
          Writes a message in the emulator log output stream.
 boolean waitAt(java.lang.String searchedString, int column, int line, long timeOut)
          Sets up a synchronous screen trigger.
 void waitAtId(int id, java.lang.String searchedString, int column, int line)
          Sets up an asynchronous screen trigger.
 boolean waitCursorAt(int column, int line, boolean here, long timeout)
          Waits synchronoulsy for the cursor to be at a specified position.
 void waitCursorAtId(int Id, int column, int line, boolean here)
          Waits Asynchronoulsy for the cursor to be at a specified position.
 boolean waitFor(java.lang.String searchedString, long timeout)
          Set up a synchrounous line trigger.
 boolean waitForDataStable(int timeout, int dataStableThreshold)
          Waits for the screen to be stable.
 void waitForId(int id, java.lang.String Str)
          Set up a screen trigger.
 void waitSync(int timeOut)
          Calls the Javelin wait() method.
 int waitTrigger(long timeout)
          Waits for a trigger that has been set by one the waitAt() or waitFor() functions.
 

Field Detail

VDX

public static final java.lang.String VDX
Defines a videotex session.

See Also:
Constant Field Values

DKU

public static final java.lang.String DKU
Defines a Bull DKU session.

See Also:
Constant Field Values

VT

public static final java.lang.String VT
Defines a VT220 session.

See Also:
Constant Field Values

SNA

public static final java.lang.String SNA
Defines a IBM 3270 (SNA) session.

See Also:
Constant Field Values

AS400

public static final java.lang.String AS400
Defines a IBM 5250 (AS/400) session.

See Also:
Constant Field Values

TN5250

public static final java.lang.String TN5250
Defines a Twinsoft 5250 (AS/400) session. added by jmc for test purposes

See Also:
Constant Field Values

AT_COLOR_BLACK

public static final int AT_COLOR_BLACK
See Also:
Constant Field Values

AT_COLOR_RED

public static final int AT_COLOR_RED
See Also:
Constant Field Values

AT_COLOR_GREEN

public static final int AT_COLOR_GREEN
See Also:
Constant Field Values

AT_COLOR_YELLOW

public static final int AT_COLOR_YELLOW
See Also:
Constant Field Values

AT_COLOR_BLUE

public static final int AT_COLOR_BLUE
See Also:
Constant Field Values

AT_COLOR_MAGENTA

public static final int AT_COLOR_MAGENTA
See Also:
Constant Field Values

AT_COLOR_CYAN

public static final int AT_COLOR_CYAN
See Also:
Constant Field Values

AT_COLOR_WHITE

public static final int AT_COLOR_WHITE
See Also:
Constant Field Values

AT_INK

public static final char AT_INK
Mask for INK attribute: 0x0007 (0000 0000 0000 0111).

See Also:
Constant Field Values

AT_PAPER

public static final char AT_PAPER
Mask for PAPER attribute: 0x0038 (0000 0000 0011 1000).

See Also:
Constant Field Values

AT_DOUBLEHEIGHT

public static final char AT_DOUBLEHEIGHT
Mask for double height: 0x0040 (0000 0000 0100 0000). or 32370/5250 also indicate field is AUTO_ENTER

See Also:
Constant Field Values

AT_AUTO_TAB

public static final char AT_AUTO_TAB
See Also:
Constant Field Values

AT_DOUBLEWIDTH

public static final char AT_DOUBLEWIDTH
Mask for double width attribute bit: 0x0080 (0000 0000 1000 0000).

See Also:
Constant Field Values

AT_UNDERLINE

public static final char AT_UNDERLINE
Mask for underline attribute bit: 0x0100 (0000 0001 0000 0000).

See Also:
Constant Field Values

AT_INVERT

public static final char AT_INVERT
Mask for inverse attribute bit: 0x0200 (0000 0001 0000 0000).

See Also:
Constant Field Values

AT_UPHALF

public static final char AT_UPHALF
Mask for double height upper row attribute bit: 0x0400 (0000 0100 0000 0000).
Note: relevant for VT220 only.

See Also:
Constant Field Values

AT_BOLD

public static final char AT_BOLD
Mask for bold attribute bit: 0x0800 (0000 0100 0000 0000).

See Also:
Constant Field Values

AT_BLINK

public static final char AT_BLINK
Mask for blink attribute bit: 0x1000 (0001 0000 0000 0000).

See Also:
Constant Field Values

AT_MASKED

public static final char AT_MASKED
Mask for masked attribute bit: 0x2000 (0010 0000 0000 0000).
Note: relevant for VT220 only.

See Also:
Constant Field Values

AT_HIDDEN

public static final char AT_HIDDEN
Mask for hidden attribute bit: 0x8000 (1000 0000 0000 0000).

See Also:
Constant Field Values

AT_DRCS

public static final char AT_DRCS
Mask for DRCS (downloadable font) attribute bit: 0x8000 (0100 0000 0000 0000). Note: relevant for Videotex only. For 3270 and 5250 this bit indicates an AUTO_TAB flag for the field

See Also:
Constant Field Values

AT_AUTO_ENTER

public static final char AT_AUTO_ENTER
See Also:
Constant Field Values

AT_PROTECTED

public static final char AT_PROTECTED
Mask for protected attribute bit: 0x4000 (0100 0000 0000 0000).

See Also:
Constant Field Values

AT_FIELD_ATTRIBUTE

public static final int AT_FIELD_ATTRIBUTE
See Also:
Constant Field Values

AT_FIELD_PROTECTED

public static final int AT_FIELD_PROTECTED
Mask for protected Field attribute bit: 0x200000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values

AT_FIELD_NUMERIC

public static final int AT_FIELD_NUMERIC
Mask for numeric field attribute: 0x100000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values

AT_FIELD_PEN_SELECTABLE

public static final int AT_FIELD_PEN_SELECTABLE
Mask for pen selectable field attribute: 0x080000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values

AT_FIELD_HIGH_INTENSITY

public static final int AT_FIELD_HIGH_INTENSITY
Mask for high intensity field attribute: 0x040000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values

AT_FIELD_HIDDEN

public static final int AT_FIELD_HIDDEN
Mask for hidden field attribute: 0x0C0000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values

AT_FIELD_RESERVED

public static final int AT_FIELD_RESERVED
Mask for reserved field attribute: 0x020000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values

AT_FIELD_MODIFIED

public static final int AT_FIELD_MODIFIED
Mask for modified field attribute: 0x010000.
Note: relevant for IBM 3270 / 5250 and BULL DKU7xxx only.

See Also:
Constant Field Values
Method Detail

setClientConfig

public void setClientConfig(java.lang.String configuration)
Sets a new configuration for Javelin.

Parameters:
configuration - the new configuration; this is a string of the form param1=value1&param2=value2& ... &paramn=valuen.
NB: each valuei should be in UTF8 format.

setLogOutputStream

public void setLogOutputStream(java.io.OutputStream outputStream)
Defines the output stream for traces.


Trace

public void Trace(java.lang.String message)
Writes a message in the emulator log output stream.

Parameters:
message - the message to write.

Trace

public void Trace(int level,
                  java.lang.String message)
Writes a message in the emulator log output stream with a given log level.

Parameters:
level - the log level to use.
message - the message to write.

Trace

public void Trace(java.lang.Exception e)
Writes an exception in the emulator log output stream.

Parameters:
e - the exception to log.

isConnected

public boolean isConnected()
Retrieves the Javelin connection state.

Returns:
true if connected, false otherwise.
See Also:
connect(), connect(int), disconnect()

connect

public void connect()
Connects Javelin to a server. The connection is asynchronous. When the connection is made, the Connected event is thrown by Javelin.

The connection is made with the parameters provided by helper functions such as setDteAddress(), setCommDevice(), setServiceCode()...

See Also:
connect(int), disconnect()

connect

public boolean connect(int timeout)
Connects synchronously Javelin to a server.

The connection is made with the parameters provided by helper functions such as setDteAddress(), setCommDevice(), setServiceCode()...

Parameters:
timeout - the maximum amount of milliseconds during which the connection is expected.
Returns:
true if connected, false if the timeout expired.
See Also:
connect(), disconnect()

disconnect

public void disconnect()
Disconnects Javelin from the current connected server. The disconnection is synchronous, i.e. Javelin is disconnected when the method returns.

See Also:
connect(), connect(int)

setDteAddress

public void setDteAddress(java.lang.String connectionString)
Sets the connection string.

Parameters:
connectionString - the connection string using the following format:

<path>#<destination>-<called sub address>.<calling sub address>/<max level>

Description path destination sourceSA destinationSA max level Notes
Direct telnet connection DIR <IP address>:port - - - mandatory for IBM and Bull emulators
PAVI + Eicon X25 board EIC <remote X25 address> called sub-address
(for Intelmatique billings)
calling sub-address
(for services filter selection)
0..255 There is no "-" character between destination
and sourceSA in this case only.
PAVI + SAP/IP TCP <Intelmatique address>@port called sub-address
(for Intelmatique billings)
calling sub-address
(for services filter selection)
0..255  
PAVI + iMinitel MIP <iMinitel address>@port - - 0..255 Same as DIR but using the PAVI as a gateway.
(iMinitel address: 172.31.0.20@7516)
PAVI + iMinitel + RAS RAS <iMinitel address>@port - - 0..255 Using a modem or ISDN service.
(iMinitel address: 172.31.0.20@7516)

setServiceCode

public void setServiceCode(java.lang.String serviceCode)
Sets the service code (depending of the terminal class).

Parameters:
serviceCode - the service code using the following format:
VTn/a
Bullmailbox
Videotexservice code
IBMdevice name

setCommDevice

public void setCommDevice(java.lang.String commDevice)
Sets the communication device, i.e. the address (IP or DNS) of the PAVI gateway, eventually followed by :port.

Parameters:
commDevice - the communication device.

setVicUser

public void setVicUser(java.lang.String vicUser)
Sets the name of the user.

Parameters:
vicUser - the user name.

setGroup

public void setGroup(java.lang.String group)
Sets the group of the user.

Parameters:
group - the user group.

setDoCapture

public void setDoCapture(boolean bDoCapture)
Sets the capture flag.

Parameters:
bDoCapture - indicates if capture should be written or not.

setAutoConnect

public void setAutoConnect(boolean bAutoConnect)
Sets the auto connect flag.


send

public void send(java.lang.String keystrokes)
Sends a string as if the user has stroken it on keyboard. All characters between 0x00 and 0xFF can be sent by this way.

Parameters:
keystrokes - the string to send.

getCurrentLine

public int getCurrentLine()
Returns the current line of the caret. Lines are designed from left to right and beginning by 0.

Returns:
the current line.
See Also:
getCurrentColumn()

getCurrentColumn

public int getCurrentColumn()
Returns the current column of the caret. Columns are designed from top to bottom and beginning by 0.

Returns:
the current column.
See Also:
getCurrentLine()

getCharAttribute

public int getCharAttribute(int column,
                            int line)
Returns the character attribute at coordinates (column, line). You can access specific attribute bit with AT_xxx masks.

Parameters:
column - the horizontal coordinate from left to right beginning by 0.
line - the vertical coordinate from top to bottom beginning by 0.
Returns:
the character attribute at (column, line) coordinates.
See Also:
getChar(int, int), getString(int, int, int), setChar(int, int, char)

getChar

public char getChar(int column,
                    int line)
Returns the ASCII code of the character at coordinates (column, line).

Parameters:
column - the horizontal coordinate from left to right beginning by 0.
line - the vertical coordinate from top to bottom beginning by 0.
Returns:
the read character at (column, line) coordinates.
See Also:
getCharAttribute(int, int), getString(int, int, int), setChar(int, int, char)

getString

public java.lang.String getString(int column,
                                  int line,
                                  int length)
Returns the string at coordinates (column, line).

Parameters:
column - the horizontal coordinate from left to right beginning by 0.
line - the vertical coordinate from top to bottom beginning by 0.
Returns:
the read string at (column, line) coordinates.
See Also:
getChar(int, int), getCharAttribute(int, int), setChar(int, int, char)

setChar

public void setChar(int column,
                    int line,
                    char c)
Sets the ASCII code of the character at coordinates (column, line).

Parameters:
column - the horizontal coordinate from left to right beginning by 0.
line - the vertical coordinate from top to bottom beginning by 0.
c - the ASCII character code to set.
See Also:
getChar(int, int), getCharAttribute(int, int), getString(int, int, int)

waitTrigger

public int waitTrigger(long timeout)
Waits for a trigger that has been set by one the waitAt() or waitFor() functions.

Parameters:
timeout - the maximum amount of milliseconds during which the event is expected.
Returns:
-1 if the timeout has expired, otherwise the trigger ID.
See Also:
waitAt(String, int, int, long), waitAtId(int, String, int, int), waitForId(int, String), waitFor(String, long), deleteWaitAts(), deleteWaitFors()

waitAt

public boolean waitAt(java.lang.String searchedString,
                      int column,
                      int line,
                      long timeOut)
Sets up a synchronous screen trigger. This method returns only when the string searchedString is recognized on the screen at coordinates (column, line).

Parameters:
searchedString - the string to be searched.
Returns:
true if the event is fired, false otherwise.
See Also:
waitAtId(int, String, int, int), waitForId(int, String), waitFor(String, long), deleteWaitAts(), deleteWaitFors()

waitAtId

public void waitAtId(int id,
                     java.lang.String searchedString,
                     int column,
                     int line)
Sets up an asynchronous screen trigger. When the string searchedString is recognized on the screen at (column, line) coordinates, the WaitAtDone event is generated by the applet with the identificator id. You can set many observations at the same time. Once the event is generated, the observation is freed.

Parameters:
id - the trigger id. This ID is transmitted by the WaitAtDone event.
column - the horizontal coordinate of the trigger.
line - the vertical coordinate of the trigger.
See Also:
waitAt(String, int, int, long), waitForId(int, String), waitFor(String, long), deleteWaitAts(), deleteWaitFors()

waitForId

public void waitForId(int id,
                      java.lang.String Str)
Set up a screen trigger. When the string Str is recognized in the data stream the event id will be generated. You can set many Triggers at the same time. Once the event is generated, the Trigger is freed. You can wait for these triggers with the WaitTrigger() function.

Parameters:
id - the Trigger id. This id is received in the WaitAtDone event or in the WaitTrigger() function
Str - the string to be observed.
See Also:
waitAt(String, int, int, long), waitAtId(int, String, int, int), waitFor(String, long), deleteWaitAts(), deleteWaitFors()

waitFor

public boolean waitFor(java.lang.String searchedString,
                       long timeout)
Set up a synchrounous line trigger.

Parameters:
searchedString - the string to be searched.
timeout - the maximum amount of milliseconds during which the search is performed.
Returns:
true if the string is found before timeout, false otherwise.
See Also:
waitAt(String, int, int, long), waitAtId(int, String, int, int), waitForId(int, String), deleteWaitAts(), deleteWaitFors()

waitCursorAt

public boolean waitCursorAt(int column,
                            int line,
                            boolean here,
                            long timeout)
Waits synchronoulsy for the cursor to be at a specified position. This function is usefull to detect a new page coming in Vidéotex and VTxxx emulators.

Parameters:
column - the horizontal coordinate of the cursor
line - the vertical coordinate of the cursor
here - if true, the function waits for the cursor to be at the specified position. if false, the functions waits for the cursor to be at any position different from the one specified.
timeout - the maximum amount of milisecs to wait.
Returns:
true if the cursor is found at this position before timeout, false otherwise.
See Also:
waitCursorAtId(int, int, int, boolean)

waitCursorAtId

public void waitCursorAtId(int Id,
                           int column,
                           int line,
                           boolean here)
Waits Asynchronoulsy for the cursor to be at a specified position. This function is usefull to detect a new page coming in Vidéotex and VTxxx emulators.

Parameters:
column - the horizontal coordinate of the cursor
line - the vertical coordinate of the cursor
here - if true, the function waits for the cursor to be at the specified position. if false, the functions waits for the cursor to be at any position different from the one specified.

deleteWaitAts

public void deleteWaitAts()
Deletes all triggers set by the waitAt() method.

See Also:
waitAt(String, int, int, long), waitAtId(int, String, int, int), waitForId(int, String), waitFor(String, long), deleteWaitFors()

deleteWaitFors

public void deleteWaitFors()
Deletes all triggers set by the waitFor() method.

See Also:
waitAt(String, int, int, long), waitAtId(int, String, int, int), waitForId(int, String), waitFor(String, long), deleteWaitAts()

waitSync

public void waitSync(int timeOut)
Calls the Javelin wait() method.


waitForDataStable

public boolean waitForDataStable(int timeout,
                                 int dataStableThreshold)
Waits for the screen to be stable. This routine will return after timeout, even if the screen isn't still stable.

Parameters:
timeout - the maximum amount of milliseconds during which the event is expected.
dataStableThreshold - this value is the maximum time allowed with no data received from the host to consider a dataStable condition.
Returns:
true if the screen is stable, false otherwise (i.e. the timeout has expired).

moveCursor

public void moveCursor(int column,
                       int line)
Moves the cursor to coordinates (column, line).

Parameters:
column - the horizontal coordinate from left to right beginning by 0.
line - the vertical coordinate from top to bottom beginning by 0.

getScreenWidth

public int getScreenWidth()
Gets the number of columns of the current emulator screen

Returns:
the number of columns.
See Also:
getScreenHeight()

getScreenHeight

public int getScreenHeight()
Gets the number of lines of the current emulator screen

Returns:
the number of lines.
See Also:
getScreenWidth()

getNumberOfFields

public int getNumberOfFields()
Gets the number of fields on the screen. If the number of fields is 0, then the screen is called "unformatted". This is always the case for VT and VDX emulators but can be the case for IBM in the case of a unformatted screen.

Returns:
the number of fields.

getFieldText

public java.lang.String getFieldText(int fieldIndex)
Gets the text of a given field.

Parameters:
fieldIndex - the index of the field from 0 to n.
Returns:
the text of the field.

getFieldAttribute

public int getFieldAttribute(int fieldIndex)
Gets the attribute of a given field.

Parameters:
fieldIndex - the index of the field from 0 to n.
Returns:
the attribute of the field.

getFieldLine

public int getFieldLine(int fieldIndex)
Gets the line of a given field.

Parameters:
fieldIndex - the index of the field from 0 to n.
Returns:
the line of the field.

getFieldColumn

public int getFieldColumn(int fieldIndex)
Gets the column of a given field.

Parameters:
fieldIndex - the index of the field from 0 to n.
Returns:
the column of the field.

getFieldLength

public int getFieldLength(int fieldIndex)
Gets the lenght of a given field. If the lenght is greater than the width of the screen, it means that the field spans on several lines.

Parameters:
fieldIndex - the index of the field from 0 to n.
Returns:
the attribute of the field.

doAction

public void doAction(java.lang.String action)
Executes an action on the emulator.

Parameters:
action - the action to execute.

An action is a special keystroke that an emulator can execute as ENTER or SOMMAIRE. Here is the table of the valid emulator actions:

Videotex
Description Code
Suite KSuite
Sommaire KSommaire
Guide KGuide
Répétition KRepetition
Annulation KAnnulation
Correction KCorrection
Retour KRetour
Envoi KEnvoi
Connexion/Fin KCnxFin
VT220
Description Code
F1 F01
F2 F02
F3 F03
F4 F04
F5 F05
F6 F06
F7 F07
F8 F08
F9 F09
F10 F10
F11 F11
F12 F12
Bull
Description Code
FKCx [1..12] FKCx
Right arrow RIGHT
Left arrow LEFT
Up arrow UP
Down arrow DOWN
Delete active partition CLEARAP
Delete end of partition CLEAREP
Initialize active partition INITAP
Initialize two partitions INITBP
Partial initialization INITPA
Insert line INSLINE
Delete line SUPLINE
Delete end of line ERAEOL
Move cursor to begin of line CURBOL
Move cursor to begin of map CURHOME
Delete character DELCHAR
Insert character INSCHAR
Tabulation TAB
Back tabulation BTAB
Insert tabulation INSTAB
Delete tabulation CLRTAB
Baskspace BS
Total transmission XMITALL
Transmission XMIT
Break BREAK
IBM
Description Code
PAx [1..3] KEY_PAx [1..3]
SysReq KEY_SYSREQ
Enter KEY_ENTER
Attn KEY_ATTN
PFx [1..24] KEY_PFx [1..24]
Right arrow KEY_CURRIGHT
Left arrow KEY_CURLEFT
Up arrow KEY_CURUP
Down arrow KEY_CURDOWN
Backspace KEY_BACKSP
Tabulation KEY_TAB
Back tabulation KEY_BACKTAB
New line KEY_NEWLINE
Move cursor to begin of map KEY_HOME
Insert KEY_INSERT
Delete KEY_DELCHAR
Reset KEY_RESET
Duplication KEY_DUP
Field mark KEY_FLDMRK
Delete end of line KEY_ERASEEOF
Delete entry KEY_ERASEINPUT
Current selection KEY_CURSEL
Clear KEY_CLEAR

printBuffer

public boolean printBuffer(java.lang.String printerPort,
                           java.lang.String buffer)
Writes a string on a given printer port. This port can be any string containing LPTx or a network printer specification as \\SERVER\PRINTER or a file as print.txt The specified port will be opened, then the buffer will be written to it and the port will be closed in this sequence. If the port is null, then the port will be the default port specified as RawPrinter in the applet.

Parameters:
printerPort - the printer port.
buffer - the buffer to be printed.
Returns:
true if ok, false otherwise.

getTerminalClass

public java.lang.String getTerminalClass()
Retrieves the terminal class of the Javelin object.

Returns:
the terminal class.

getDataStableOnCursorOn

public boolean getDataStableOnCursorOn()
Retrieves the DataStableOnCursorOn flag. this flags controls how the data stable condition is detected. for Vidéotex emulators. if true, this condition is met when a Vidéotex cursor is shown by the host.

Returns:
the DataStableOnCursorOn.

setDataStableOnCursorOn

public void setDataStableOnCursorOn(boolean bool)
Sets the DataStableOnCursorOn flag.


setDataStableThreshold

public void setDataStableThreshold(int val)
Sets the dataStableThreshold value. this value is the maximum time allowed with no data received from the host to consider a dataStable condition.


getDataStableThreshold

public int getDataStableThreshold()
Gets the dataStableThreshold value

Returns:
the dataStableThreshold value

setClientConfig

public void setClientConfig(java.util.Properties p)
Sets the current terminal properties. the properties depends on the emulator technology. only the 3270 and 5250 emulators supports this api

Parameters:
p - the properties ti set in the emulator

showZones

public void showZones(java.util.Vector rv,
                      java.util.Vector cv)
Shows Zones on the emulator screen. the zones will be represented as rectangles bounding characters. This feature can be used to enhance or to show a grid system on the emulator screen. Zones are described in a vector of rectangles in character 0 based coordinates. Example Rectangle (0, 0, 10, 1); will describe a zone in Column 0, line 0, of 10 chars

Parameters:
rv - the vector containing the zones rectangles. If rv is null, the zones will not be shown anymore.
cv - the vector containing the color of each zone.

setSelectionZone

public void setSelectionZone(java.awt.Rectangle zone)
Sets a selection zone on Javelin. this will result as if the user had selected the zone with the mouse. After this api is called, the user will be able to modify the selection zone.

Parameters:
zone - the rectangle that holds the zone (x = column 0 based y = line 0 based width = width of the selection in chars height= height of the selection in chars);

getSelectionZone

public java.awt.Rectangle getSelectionZone()
Gets the current selection zone on Javelin.

Returns:
zone the rectangle that holds the zone (x = column 0 based y = line 0 based width = width of the selection in chars height= height of the selection in chars);

addZoneListener

public void addZoneListener(com.twinsoft.twinj.zoneListener l)
Registers a client on the zoneListener. zoneListener delivers events for selection changes.

Parameters:
l - the component interested by the events.

removeZoneListener

public void removeZoneListener(com.twinsoft.twinj.zoneListener l)
Unregisters a client on the zoneListener. zoneListener delivers events for selection changes.

Parameters:
l - the component not anymore interested by the events.

removeAllZoneListeners

public void removeAllZoneListeners()
Unregisters all clients on the zoneListener. zoneListener delivers events for selection changes.


addKeyListener

public void addKeyListener(java.awt.event.KeyListener l)
Registers a client on the keyListener. KeyListener delivers events for keystokes on Javelin.


removeKeyListener

public void removeKeyListener(java.awt.event.KeyListener l)
Unregisters a client on the keyListener. KeyListener delivers events for events for keystokes on Javelin.


clearTrigger

public void clearTrigger()
Remove all arrived trigger from the MsgQueue.



Submit a bug or feature
That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright (c) 1999-2002 TWinSoft - All rights reserved.