|
ScrollingUpdate (Version 1.3) ScrollingUpdate can be used to vertically scroll text over a static background image. The text is read from a file on the host, and the host text file is (optionally) read periodically for updates. If an update to the text file occurs, then the vertically scrolling text displayed by the applet is dynamically updated. |
Operation The following describes how the ScrollingUpdate canvas class is used. Also available is the ScrollingUpdateApplet which can be used to plug the canvas directly into a web page. ScrollingUpdate.class requires NetworkTextFile.class. Both of these objects are included in the download package. During initialization, ScrollingUpdate can either load a GIF or JPEG image that will be used as the background image, or it can create a solid colored background. Also during initialization the NetworkTextFile.class class reads a specified file from the host that contains the text that is to be scrolled vertically over the background. The are a number of parameters that control how the text will be rendered over the background. Both the font characteristics and the location of the scroll region within the background can be specified. The number of words that appear on a single line in the scroll region is automatically determined based upon the font characteristics and the width of the scroll region. Because each line of text is automatically formatted, the text entered in the text file does not need to be manually formatted with carriage returns. If you wish to create a line break in the text, enter the <BR> code or the <P> code in the
text file where the line break should be placed. The code should be entered on a single
line or with a least one space on either side of the code. The <BR>
code will place a line break in the text at the location of the code. The <P>
code will insert a blank line in addition to inserting the line break.The frequency with which the class checks for changes to the text file can be specified (or disabled), as well as whether or not a notification indicator should be displayed whenever an update check occurs. The class determines if the text file has been changed by reading the very first line of text in the file (the file header) and comparing it to the header that was read on the previous read. Note that the header is never displayed, so the header line in the file can be can be anything that you wish, such as the date and time that the file was last changed. When you want to indicate that the text in the file has changed, simply modify the header and save the file. The next time that the class checks the text file, it will find that the header has changed and will then reload and re-render the text to be scrolled. Scrolling text can be paused either by clicking anywhere within the boundaries of the Canvas, or by moving the mouse within the Canvas boundaries (based on the pauseType parameter). A second click or moving the mouse out of the Canvas boundaries will start the text scrolling once again. |