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 |
public static final java.lang.String VDX
public static final java.lang.String DKU
public static final java.lang.String VT
public static final java.lang.String SNA
public static final java.lang.String AS400
public static final java.lang.String TN5250
public static final int AT_COLOR_BLACK
public static final int AT_COLOR_RED
public static final int AT_COLOR_GREEN
public static final int AT_COLOR_YELLOW
public static final int AT_COLOR_BLUE
public static final int AT_COLOR_MAGENTA
public static final int AT_COLOR_CYAN
public static final int AT_COLOR_WHITE
public static final char AT_INK
public static final char AT_PAPER
public static final char AT_DOUBLEHEIGHT
public static final char AT_AUTO_TAB
public static final char AT_DOUBLEWIDTH
public static final char AT_UNDERLINE
public static final char AT_INVERT
public static final char AT_UPHALF
public static final char AT_BOLD
public static final char AT_BLINK
public static final char AT_MASKED
public static final char AT_HIDDEN
public static final char AT_DRCS
public static final char AT_AUTO_ENTER
public static final char AT_PROTECTED
public static final int AT_FIELD_ATTRIBUTE
public static final int AT_FIELD_PROTECTED
public static final int AT_FIELD_NUMERIC
public static final int AT_FIELD_PEN_SELECTABLE
public static final int AT_FIELD_HIGH_INTENSITY
public static final int AT_FIELD_HIDDEN
public static final int AT_FIELD_RESERVED
public static final int AT_FIELD_MODIFIED
| Method Detail |
public void setClientConfig(java.lang.String configuration)
configuration - the new configuration; this is a string of the form
param1=value1¶m2=value2& ... ¶mn=valuen.valuei should be in UTF8 format.public void setLogOutputStream(java.io.OutputStream outputStream)
public void Trace(java.lang.String message)
message - the message to write.
public void Trace(int level,
java.lang.String message)
level - the log level to use.message - the message to write.public void Trace(java.lang.Exception e)
e - the exception to log.public boolean isConnected()
true if connected, false otherwise.connect(),
connect(int),
disconnect()public void connect()
The connection is made with the parameters provided by helper functions
such as setDteAddress(), setCommDevice(),
setServiceCode()...
connect(int),
disconnect()public boolean connect(int timeout)
The connection is made with the parameters provided by helper functions
such as setDteAddress(), setCommDevice(),
setServiceCode()...
timeout - the maximum amount of milliseconds during which
the connection is expected.
true if connected, false if the timeout expired.connect(),
disconnect()public void disconnect()
connect(),
connect(int)public void setDteAddress(java.lang.String connectionString)
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) |
public void setServiceCode(java.lang.String serviceCode)
serviceCode - the service code using the following format:
| VT | n/a |
| Bull | mailbox |
| Videotex | service code |
| IBM | device name |
public void setCommDevice(java.lang.String commDevice)
:port.
commDevice - the communication device.public void setVicUser(java.lang.String vicUser)
vicUser - the user name.public void setGroup(java.lang.String group)
group - the user group.public void setDoCapture(boolean bDoCapture)
bDoCapture - indicates if capture should be written or not.public void setAutoConnect(boolean bAutoConnect)
public void send(java.lang.String keystrokes)
keystrokes - the string to send.public int getCurrentLine()
getCurrentColumn()public int getCurrentColumn()
getCurrentLine()
public int getCharAttribute(int column,
int line)
column, line).
You can access specific attribute bit with AT_xxx masks.
column - the horizontal coordinate from left to right beginning by 0.line - the vertical coordinate from top to bottom beginning by 0.
column, line) coordinates.getChar(int, int),
getString(int, int, int),
setChar(int, int, char)
public char getChar(int column,
int line)
column, line).
column - the horizontal coordinate from left to right beginning by 0.line - the vertical coordinate from top to bottom beginning by 0.
column, line) coordinates.getCharAttribute(int, int),
getString(int, int, int),
setChar(int, int, char)
public java.lang.String getString(int column,
int line,
int length)
column, line).
column - the horizontal coordinate from left to right beginning by 0.line - the vertical coordinate from top to bottom beginning by 0.
column, line) coordinates.getChar(int, int),
getCharAttribute(int, int),
setChar(int, int, char)
public void setChar(int column,
int line,
char c)
column, line).
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.getChar(int, int),
getCharAttribute(int, int),
getString(int, int, int)public int waitTrigger(long timeout)
waitAt() or waitFor() functions.
timeout - the maximum amount of milliseconds during which
the event is expected.
waitAt(String, int, int, long),
waitAtId(int, String, int, int),
waitForId(int, String),
waitFor(String, long),
deleteWaitAts(),
deleteWaitFors()
public boolean waitAt(java.lang.String searchedString,
int column,
int line,
long timeOut)
searchedString
is recognized on the screen at coordinates (column, line).
searchedString - the string to be searched.
true if the event is fired, false otherwise.waitAtId(int, String, int, int),
waitForId(int, String),
waitFor(String, long),
deleteWaitAts(),
deleteWaitFors()
public void waitAtId(int id,
java.lang.String searchedString,
int column,
int line)
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.
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.waitAt(String, int, int, long),
waitForId(int, String),
waitFor(String, long),
deleteWaitAts(),
deleteWaitFors()
public void waitForId(int id,
java.lang.String Str)
id - the Trigger id. This id is received in the
WaitAtDone event or in the WaitTrigger() functionStr - the string to be observed.waitAt(String, int, int, long),
waitAtId(int, String, int, int),
waitFor(String, long),
deleteWaitAts(),
deleteWaitFors()
public boolean waitFor(java.lang.String searchedString,
long timeout)
searchedString - the string to be searched.timeout - the maximum amount of milliseconds during which
the search is performed.
true if the string is found before timeout,
false otherwise.waitAt(String, int, int, long),
waitAtId(int, String, int, int),
waitForId(int, String),
deleteWaitAts(),
deleteWaitFors()
public boolean waitCursorAt(int column,
int line,
boolean here,
long timeout)
column - the horizontal coordinate of the cursorline - the vertical coordinate of the cursorhere - 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.
true if the cursor is found at this position before timeout,
false otherwise.waitCursorAtId(int, int, int, boolean)
public void waitCursorAtId(int Id,
int column,
int line,
boolean here)
column - the horizontal coordinate of the cursorline - the vertical coordinate of the cursorhere - 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.public void deleteWaitAts()
waitAt() method.
waitAt(String, int, int, long),
waitAtId(int, String, int, int),
waitForId(int, String),
waitFor(String, long),
deleteWaitFors()public void deleteWaitFors()
waitFor() method.
waitAt(String, int, int, long),
waitAtId(int, String, int, int),
waitForId(int, String),
waitFor(String, long),
deleteWaitAts()public void waitSync(int timeOut)
wait() method.
public boolean waitForDataStable(int timeout,
int dataStableThreshold)
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.
true if the screen is stable, false otherwise (i.e. the timeout has expired).
public void moveCursor(int column,
int line)
column, line).
column - the horizontal coordinate from left to right beginning by 0.line - the vertical coordinate from top to bottom beginning by 0.public int getScreenWidth()
getScreenHeight()public int getScreenHeight()
getScreenWidth()public int getNumberOfFields()
public java.lang.String getFieldText(int fieldIndex)
fieldIndex - the index of the field from 0 to n.
public int getFieldAttribute(int fieldIndex)
fieldIndex - the index of the field from 0 to n.
public int getFieldLine(int fieldIndex)
fieldIndex - the index of the field from 0 to n.
public int getFieldColumn(int fieldIndex)
fieldIndex - the index of the field from 0 to n.
public int getFieldLength(int fieldIndex)
fieldIndex - the index of the field from 0 to n.
public void doAction(java.lang.String action)
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 |
public boolean printBuffer(java.lang.String printerPort,
java.lang.String buffer)
\\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.
printerPort - the printer port.buffer - the buffer to be printed.
true if ok, false otherwise.public java.lang.String getTerminalClass()
public boolean getDataStableOnCursorOn()
public void setDataStableOnCursorOn(boolean bool)
public void setDataStableThreshold(int val)
public int getDataStableThreshold()
public void setClientConfig(java.util.Properties p)
p - the properties ti set in the emulator
public void showZones(java.util.Vector rv,
java.util.Vector cv)
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.public void setSelectionZone(java.awt.Rectangle zone)
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);public java.awt.Rectangle getSelectionZone()
public void addZoneListener(com.twinsoft.twinj.zoneListener l)
l - the component interested by the events.public void removeZoneListener(com.twinsoft.twinj.zoneListener l)
l - the component not anymore interested by the events.public void removeAllZoneListeners()
public void addKeyListener(java.awt.event.KeyListener l)
public void removeKeyListener(java.awt.event.KeyListener l)
public void clearTrigger()
Submit a bug or feature
That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.