InfoScroll - Demonstration

Copyright © EnQue Corporation 2000. All rights reserved.
Send comments to techsupport@enque.net

Usage Info:
InfoScroll Overview
InfoScroll Features
InfoScroll Parameters
InfoScroll File Format
When Things Won't Work
Examples:
Simplest Form of Applet
Orientation, Speed
Global Target
Specific Targets
Backgrounds and Fonts
Connecting with Script Code
Other Examples and Notes

InfoScroll Overview

Why was this information scrolling applet created?
Problem: Scrolling in an HTML page requires user intervention. Since some information may not be proactively sought by the user but may be of interest the need for some automatic way of increasing the 'information window' to the user is needed.

Solution: We developed this java applet to address the problem of an increased non-user required way of showing information and thereby increasing the information visibility to the user.

You should look at the HTML for these files in case any of the examples are still not clear or you are interested in how we installed them into frames and tables. Good luck and if we can be of assistance give us a call at EnQue Corporation, 704.377.3327 or send us an email.

Top

InfoScroll Features

Features:
  • Background can be either a color or image
  • Mouse over hilights when over information items
  • Status line information for each information item
  • Variable scrolling speed
  • Scroll stop has 50% duty cycle
  • Scroll stop on each information item at top of window
  • Script enabled - can call script functions (no parameter support)
  • Can specify target frame for URL or script transfer
  • Left, Center, or Right alignment of information items
  • Can add spacer lines between information items
  • drag mode allows you to stop and/or drag info items screen up or down
Technical:
  • Runs in the "sandbox" of the client browser
  • Requires license file installed on the web site in a secure directory
  • getParameterInfo(), and getAppletInfo() are not implemented in order to reduce file size
  • Both class files total 11,165 bytes, but if compressed in a jar file they become 6,698 bytes
Top

InfoScroll Parameters

This Java applet is a scrolling information or 'headlines' system. Here are all the parameters this applet reads:
ParameterDescription
licdirdirectory containing the license file 'EnQueL05.txt'
infofilefile that contains information, status messages, URLs, and targets. The default is 'InfoFile.txt'. See info file format below.
targetif targets are not specified in the info file, this parameter gives target frame (default target is "_top")
speedrelative scroll speed - range is 0 to 100. (default of 50 translates to approximately a one pixel shift every 40 msec or 25 pixels per second)
scrolltype0 = smooth scrolling (default), 1 = scrolling stops at every scrolldelay time increment, 2 = scrolling stops every scrolldelay time increment but at the starting line of each information item as they reach the top of the applet window
scrolldelayscroll delay in milliseconds between headline scrolls (default is 500 msec which is 1/2 second)
bgcolorbackground color to use, this parameter is valid only if the bgimage is not specified or the background image contains transparency. (default is 0xFFFF80)
bgimagebackground image to display, this parameter takes precedence over bgcolor. Image is tiled when image size is smaller than applet window
alignhorizontal alignment, ('left' or 'right'; anything else is centered)
fontnamename of font for text (default is Dialog)
fontstylefont style (0=plain-default, 1=bold, 2=italic, 3=bold+italic)
fontsizetext point size (default is 14)
textcolortext normal color (default is 0x00487F)
texthltColortext hilight color (default is 0xB900A3)
spacelinesnumber of spacer lines between information items (default is 0)
Top

InfoScroll File Format

The applet reads a maximum of 4 tokens from a line of an information file. Anything beyond that is ignored. The minimum requirement is one token, the first one which is an information item. A token is anything between double quotes: "this is a token". The separator is a comma but need not be. Unspecified tokens must still have empty double quotes in the information file line if other tokens follow. See the valid examples just below. The information file format for a line is as follows:

"information message","status line message", "URL", "target frame"
"information message" information headline
"status line message" status message shown when mouse is over item
"URL" universal resource locator of target document or script
"target frame" target frame for URL
 
Examples of valid information file entries:
"Headlines for Today"
"New high power laser under development","LaserCom Lasers","javascript:GoSomewhere","ContentFrame"
"EnQue begins Java development", "","TestPage1.htm","ContentFrame"
"Surprise Here","","TestPage2.htm"
"Home of Santa Clause discovered","Merry Christmas","TestPage1.htm"
"Advertisers seek web page space","Electronic Advertisers","TestPage3.htm","AdFrame"
"Happy Thanksgiving"
"----------------------"
 
The first line has only an information item. The second line has all four items specified. The third has no status line message. The fourth has no status line message. The sixth is using all four items. The last two are only using the information item. When a target is specified in the information file, it takes precedence over the target parameter specified for the applet. This applet supports scripting but with no parameter support.
Top

Example: Simplest Form of Applet

This first example is the applet in its simplest form. It automatically centers information, paints its background the default color, and uses the default menu file named 'InfoFile.txt'.
There is an applet on this page which requires java enabled. The code behind what you see is:

<applet code="InfoScroll.class" width=236 height=332>
<param name=licdir value="Lic/">
</applet>

Note that the license directory is specified in the 'licdir' parameter. That directory must be protected from illegal downloads of this applets' license file. Specifying directories in general uses the same form as that in HTML pages. For instance, if you had this applet in a directory such as

'//host/common/InfoScroll.class'

and the license file was in '//host/Lic/EnQueL05.txt'

then the 'licdir' parameter would be '../Lic/'. Note, the trailing forward slash is required.

The 'InfoFile.txt' file looks like this:

"HEADLINES - January 20, 2000"
"ABC Company initiates changes","ABC Press Release","TestPage1.htm"
"Big stock buyback from DEF Company","Financial Bomb Shell","TestPage2.htm"
"Wall Street has Major Gains","Wall Street","TestPage1.htm"
"New Laser developed at Moon Crest Labs","New Technology","TestPage2.htm"

Top

Other Examples and Notes

Here are some additional examples and informational notes. The example code is not implemented within this HTML page you are viewing because Active Server Pages may be required, hence they will not run in your browser without executing them from an actual server. You can use Microsoft's peer web services on your local machine however.
Notes:
  • You can use an applet 'codebase' to make it easier to configure this applet within the web site.
  • At least use the bundled jar file (InfoScrl.jar contains InfoScroll.class and NItem.class) for the classes supplied with this package. This both reduces the number of HTTP requests to the server and makes the overall data volume lower because of the compression in the jar files. By bundling the class files the overall file size used for downloads is reduced by approximately 45% including the manifest.

Here is sample code that uses java archives:

<applet code="InfoScroll.class" archive="InfoScroll.jar" width=250 height=200>
<param name=licdir value="../Lic/">
</applet>

Here is an info file that uses URLs with query strings sent to an active server page.

"Headlines for Today"
"New high power laser under development","LaserCom Lasers","IHello.asp?Item=LaserCom"
"EnQue begins Java development", "","IHello.asp?Item=Java"
"Surprise Here","","IHello.asp?Item=Surprise"
"Home of Santa Clause discovered","Merry Christmas","IHello.asp?Item=Santa"
"Advertisers seek web page space","Electronic Advertisers","IHello.asp?Item=Advertisers"
"Happy Thanksgiving"

Notice all lines use a URL of 'IHello.asp' with a query string attached. This is an active server page the simply takes the query string and concatenates it to a message that displays in the target frame.

Top

When Things Won't Work

Here are some additional tips to consider when things go wrong or won't work. The status line will show errors most of the time when there's a problem. Mousing over the applet will show the status line message. Several common problems are that the applet can't find the license file, there is an error loading a background image, or it can't find the info file.

License File
  • Insure license file is located in a directory that the applet can find. Use standard URL rules such as '../' for going back one directory level, and make sure the final directory specified to the license file has the forward slash in it. ('/'). The license file directory is relative to the code base while menu files and their entries are relative to the document base. See examples above for explicit specification.
Miscellaneous
  • Only 'left' or 'right' are valid with the 'align' parameter.
  • When specifying a font for an applet, you must use those recognized by the internal java 'Toolkit'. For instance, the font "Times New Roman" is "TimesRoman" for the applet.
  • Targets specified in the info file override the applet target parameter.
  • If applet doesn't appear or is very small then you probably do not have the width and height values set properly.
  • When using external scripts, if the function name is 'MyFunction()' for instance, specify 'javascript:MyFunction' as the string for the script in the info file. The point being NOT to include the parenthesis.
  • Make sure you use the 'MAYSCRIPT' tag in the applet if you are calling scripts.
  • Do not place the info file in a jar file. It is a text file and the applet can't find a text file in a jar archive.
Top

This is the bottom of this document.