Java Client 4.0 Release Notes
There are many new features in this release that you can use to make your applications much more graphical. There are also a few performance enhancements to reduce the amount of work the client must perform to process your application specifications.
Now for what you have been waiting for. The list of new features:
Performance
This Java client was written to use the Sun Java 1.2 standard. This is a much more stable Java version and is supposed to have better performance. Also, some effort has been made to minimize some of the screen painting we are doing. There is an option to compile our Java client directly down to native Win32 EXE code, but the compiler has not been released for the Java 1.2 standard yet. We have tried it with the older Java 1.1 code we had and it made a noticeable improvement. As soon as this compiler is available for the Java 1.2 environment, we will compile it and make it available.
More keyboard keys implemented and clipboard integrated
More of the basic edit keys are now implemented for Insert/Delete/Copy/ Paste, etc. Also, the copy/paste keys CTRL+C and CTRL+V use the Windows® clipboard.
Fields painted a little better
Multiline fields like Text fields are now painted as one field region instead of a bunch of one-line fields. Also, logic edit fields are painted as tri-state logic fields. The three states are:
Blank Checkbox = Default value
Green Checkmark = Yes
Red X-Mark in Box = No
If NULL OK? on the field is N, then clicking on the field will cycle past blank and only cycle to a Yes or No indicator. You can still use the keyboard just like before: you can press SPACEBAR to blank it out, ‘Y’ to set it to true or ‘N’ to set it to false. The Y and N are driven by the language currently selected on the server. So, if you are using another language that does not use Y/N, it will work with whatever letters are mapped to a Yes and No state by that server language file. Any time the server changes languages, the new indicators are automatically loaded into the client.
File Xfer and Client Side Run
Now, from ILF code on the server, you can push files to the client, pull files from the client, and run a command line on the client.
Sending a file to the client
You can send a file to the client with a CALL command. If the destination filename is left blank, the client will open a dialog file browser so the use can place and name the file themselves. The value they select will be returned to the server and placed in the destination field. If the destination path is relative, it will be relative to the location of the Java Client JAR file location. While the file is in transit, the client will show a progress slider and the APPX session will wait until the file transfer completes before returning fron the CALL statement. The T/F indicator will tell you if the transfer completed OK or not.
SET 1EX WORK SOURCE = C:\REGO.TXT SET 1EX WORK DESTINATION = REGO99.TXT PASS 1EX WORK SOURCE FIELD SHARE? Y PASS 1EX WORK DESTINATION FIELD SHARE? Y CALL ,RT_SEND_FILE RESIDENT? Y END? N FAIL 0
Pulling a file from the client
You can pull a file from the client with a CALL command. If the source filename is left blank, the client will open a dialog file browser so the user can pick the file themselves. The value they select will be returned to the server and placed in the source field. If the source path is relative, it will be relative to the location of the Java Client JAR file location. While the file is in transit, the client will show a progress slider and the APPX session will wait until the file transfer completes before returning from the CALL statement. The T/F indicator will tell you if the transfer completed OK or not.
SET 1EX WORK SOURCE = SET 1EX WORK DESTINATION = /tmp/upload.txt PASS 1EX WORK SOURCE FIELD SHARE? Y PASS 1EX WORK DESTINATION FIELD SHARE? Y CALL ,RT_RECV_FILE RESIDENT? Y END? N FAIL 0
Running a command line on the client
Using a version of the RT_LOAD_URL call, you can run a complete command line on the client machine. This is done by starting the command with the ‘@’ symbol. This means run the command as is, at the client. This examples will take the results from the previous SEND and run Notepad against it on the client.
SET --- TEMP 80 = @NOTEPAD.EXE APPEND --- TEMP 80 1 1EX WORK DESTINATION SET --- LI = 80 PASS --- TEMP 80 FIELD SHARE? Y PASS --- LI FIELD SHARE? Y CALL ,RT_LOAD_URL RESIDENT? Y END? N FAIL 0
Example
This example will download a print file and a print config file to a client and run winprint on the client to print the file. This assumes that the client already has a copy of winprint.exe in the same location as the JAR file or in the active PATH.
SET 1EX WORK SOURCE = /tmp/PRT0001 SET 1EX WORK DESTINATION = PRT0001 PASS 1EX WORK SOURCE FIELD SHARE? Y PASS 1EX WORK DESTINATION FIELD SHARE? Y CALL ,RT_SEND_FILE RESIDENT? Y END? N FAIL 0 * SET 1EX WORK SOURCE = /tmp/PRT0001.cfg SET 1EX WORK DESTINATION = PRT0001.cfg PASS 1EX WORK SOURCE FIELD SHARE? Y PASS 1EX WORK DESTINATION FIELD SHARE? Y CALL ,RT_SEND_FILE RESIDENT? Y END? N FAIL 0 * SET --- TEMP 132 = @WINPRINT.EXE APPEND --- TEMP 132 1 -config=PRT0001.cfg APPEND --- TEMP 132 1 PRT0001 SET --- LI = 132 PASS --- TEMP 132 FIELD SHARE? Y PASS --- LI FIELD SHARE? Y CALL ,RT_LOAD_URL RESIDENT? Y END? N FAIL 0
Image Editor Enhancements
When painting an image in the image editor, you have some new tools to help you along. There are Data Palettes you can use to browser files and fields, and to drag fields onto you image editor session. You can double-click on a field to open its attributes page. You can right-click on a field to get a helper menu to perform tasks like Move, Edit, and Delete. You can now draw boxes and lines similar to how you already paint inverse, underline, and bright. You can use the PICTURE ilf command to define free-sizing pictures on the screen as well as IconButtons that execute APPX Options. Let’s look at these one at a time.
Data Palette
While in the Image Editor, the pulldown menu option for Data Palette is available. When you select this menu option, APPX will open up a tree control in a floating window that you can use the browse Application/File/Field/WorkField names. You can drop fields from this list and drop them on the image editor session. APPX will automatically add these fields to the image. You can then edit the fields to override the default attribute settings. You can open more than one data palette concurrently.
Note: The Icons used to show the different file and data types are just snagged from the windows icons. If anyone has any good ideas for icons, please feel free to contribute.
Mouse Options
There are some new mouse controls in the Image editor.
If you double-click on a field in the editor image, APPX will select the field with the cursor and open the attributes overlay for the field.
If you right-click on a field in the image editor, you will get a popup helper menu from which you can select Move, Delete, or Edit.
Line/Box Drawing
Like using Option13 to paint special attributes on the image, you can use option14 to paint box/line attributes. The boxes will also show on a character terminal as a single line border. If a box is defined as one row or one column in size, it will paint as a line. When using the Java client, there are several types of styles you can select: Plain Line, Bevel, and Etched. The Plain Line can be thin or fat. The Bevel can be set to Raised or Lowered to make the area inside the box appear higher or lower than the surrounding area. The Etch can bed set to Raised or Lowered to make the etched line look like it is carved into the background or embossed and bulging our from the background.
If you type some text in the area that will form the top line of the box before defining the box, the text will be picked up as the box label and will be incorporated in the top edge of the box.
Note: This is one place that you might get some errors in the Image Editor while trying to define some boxes. Please report what you get so we can make sure we get and many issued fixed here as we can.
Auto-Sizing Pictures
If you define a field on an image and make it a picture, the data placed in the field to define the source of the picture does not have to be completely visible on the window. We are no longer screen-scraping the picture pathname. It is now being pulled from the server memory. So, you can paint a real small field with a real long pathname. If you paint a field as small as 1 character cell in size, the Java Client will use that cell as the anchor for the upper/left corner of the picture an will let the picture determine it’s own size based the its content. A picture painted as two or more character cells in size will resize and reshape the picture to fit the defined screen area.
Note: At some point, there will be an option to have the picture resize to fit, but keep the same X to Y aspect ratio. Currently the image can get squashed if the screen size needed does not match the aspect ratio of the image.
IconButtons
As an initial method of defining IconButtons on your images, we have enhanced the parser for PICTUREs so that if the contents of the PICTURE field contains special keywords, instead of painting a picture, APPX will create an IconButton. You can use the keywords to set the attributes of the IconButton. Currently, there are 24 attributes you can set. This is done by appending all the keywords and data together into the PICTURE field. Buttons painted one cell tall and wide will autosize themselves based on their contents. Buttons painted bigger than one cell will force the button to fit the screen area.
Here is a list of attributes and examples:
@SAC={option#}
setActionCommand() - This is set to the numeric value of the APPX option key that should be sent when the button is clicked.
The following will send an APPX option 33 when the button is pressed:
@SAC=33
@STTT={some text}
setToolTipText() - This is set to a text value that will show up as the tooltip for the button.
The following will set the tool tip text for a button:
@STTT=This button will run a report
@SBC={colorIndex#}
setBackgroundColor() - This will set the background color of the button a one of 15 predefined colors. The color index is:
-
Black
-
Blue
-
Cyan
-
Green
-
Magenta
-
Red
-
Yellow
-
White
-
Dark Blue
-
Dark Cyan
-
Dark Green
-
Dark Magenta
-
Dark Red
-
Dark Gray
-
Light Gray
The following will set the button background color to Red:
@SBC=6
@SFC={ColorIndex#}
setForegroundColor() - This will set the foreground color for the text of the button to the selected color. The same color index number apply here as defined for the @SBC keyword.
The following will set the button foreground color to Yellow:
@SFC=7
@SF={FontName,Style,Size#}
setFont() - This will set the font used on the button. You can select a valid Java font face, Style, and Size. Case matters.
Valid Faces: Dialog, SanSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, ZapfDingbats.
Valid Styles: BOLD, ITALIC, PLAIN
The following will set the button font to Helvetica, BOLD, 18 point:
@SF=Helvetica,BOLD,18
@SI{IconPathname}
setIcon() - This will set the normal icon for the button. THis can be a URL or actual pathname. This must be from the perspective of the machine running the Java Client.
The following will set the default Icon for the button to a Smiley loaded from a mapped server drive:
@SI=X:\icons\smiley.gif
@SRE={T/F}
setRolloverEnabled() - This option will turn on/off Rollover Icon triggers. This usually does not need to be set since setting the RolloverIcon automatically turns on this option.
This will turn on Rollover processing:
@SRE=T
@SRI={IconPathname}
setRolloverIcon() - This will set the icon image shown when the mouse pointer rolls over the button. This also sets the @SRE=T automatically.
This will set the rollover icon for the button to a happy smiley loaded from a web server machine:
@SRI=http://server/icons/happySmiley.jpg
@SDI={IconPathname}
setDisabledIcon() - This will set the Disabled Icon image for the button. This image is shown when the button is disabled.
This will set the disabled icon to a stop sign from a location relative to where the client ran from:
@SDI=icons/stopSign.gif
@SRSI={IconPathname}
setRolloverSelectedIcon() - This will set the Icon shown when the mouse rolls over the button and the button also has the selected focus.
This will set the button icon to a perspiring smiley when the button has the selected focus and the mouse rolls over it:
@SRSI=icons/smileyNerves.jpg
@SPI={IconPathname}
setPressedIcon() - This will set the icon shown when the button is pressed.
This will set the pressed icon to a screaming smiley:
@SPI=icons/screamingSmiley.jpg
@SSI={IconPathname}
setSelectedIcon() - This will set the icon shown when the button is selected with the active focus.
This will set the selected icon image to a smiley with sun glasses:
@SSI=icons/coolSmiley.gif
@ST={some Text}
setText() - This will set the text label of the button.
This will set the button text to “Press Me”:
@ST=Press Me
@SS={T/F}
setSelected() - This will select or deselect the button focus when the button is shown on the window.
This will se the active focus in this button when it is painted:
@SS=T
@SBP={T/F}
setBorderPainted() - This will turn on or off painting of the button border. This can be used with the option to make the background transparent if you want to use the icons as the only indication that there is a button. This can be used to make you button act like an icon on a web page that shows only the icon, and different icons as the mouse rolls over them.
This will turn off painting of the border around our button area:
@SBP=F
@SFP={T/F}
setFocusPainted() - This will turn on or off painting of the hasFocus indicator for the button.
This will turn off the focus indicator on this button:
@SFP=F
@SE={T/F}
setEnabled() - This will determine if the button is enabled to be clicked.
This will disable the button so it can not be clicked.
@SE=F
@SCAF={T/F}
setContentAreaFilled() - This will turn on or off filling of the button background area. If this is turned off, then the button background will be transparent. Use this along with setBorderPainted() to make buttons that have not background or border.
This will make the button have a transparent background:
@SCAF=F
@SHA={CENTER/LEFT/RIGHT/LEADING/TRAILING}
setHorizontalAlignment() - This will set the overall alignment of the contents of the button within the button area. The contents include the icon and the text.
This will force the contents of the button to be left justified:
@SHA=LEFT
@SVA={CENTER/TOP/BOTTOM}
setVerticalAlignment() - This will set the overall alignment of the contents of the button within the button area. The contents include the icon and the text.
This will force the contents of the button to the top of the button:
@SVA=TOP
@SHTP={CENTER/LEFT/RIGHT/LEADING/TRAILING}
setHorizontalTextPosition() - This will set the position of the text in relation to the icon.
This will set the text so that it shows to the right of the icon:
@SHTP=RIGHT
@SVTP={CENTER/TOP/BOTTOM}
setVerticalTextPosition() - This will set the position of the text in relation to the icon.
This will set the text so that it shows below the icon:
@SVTP=BOTTOM
@SM={top#[,left#[,bottom#[,right#]]]}
setMargins() - This will set the extra margin space between the contents of the button and the border of the button. You can specify one, two, three, or four arguments. This is in pixels. Any unset arguments default to the values of the arguments that are given.
This will set the top margin to 10 pixel, The other three margins also default to the same 10 pixels:
@SM=10
This will set the top margin to 10 and the left margin to 20. The bottom margin will default to the same value as the top margin. The right margin will default to the same value as the left margin:
@SM=10,20
This will set the top margin to 10, the left margin to 20, and the bottom margin to 30. The right margin will default to the same value as the left margin:
@SM=10,20,30
This will set all four margins:
@SM=10,20,30,40
@SMN={acceleratorLetter}
setMNemonic() - This will set the accelerator letter on the button.
This will set the Accelerator letter on this Edit button to ‘E’:
@SMN=E
Examples
Both of these buttons will send an Option12 when pressed:
Create a new button that has text that is painted with red letters:
@SAC=12@ST=Press Me@SFC=6
Create a button with an Icon, rollover Icon, and no border or background:
@SAC=12@SI=icons/normal.gif@SRI=icons/rollover.gif@SBP=F@SCAF=F
Advice: start simple and build. Most of the defaults may be what you would want anyway. Only set attributes to change away from the defaults. Setting an attribute that would have defaulted correctly anyway, just increases the amount of data sent to the client.