EasyScroller 1.0 by Clark S. Lindsey HobbySpace.com java@hobbyspace.com July 12, 2001 EasyScroller is a free Java scroller applet for displaying a list of messages. The messages can be matched with web page addresses so that clicking on a message sends the user to a given page. EasyScroll offers the following features and options: - A given message can consist of text,an icon or both. - Clicking on a message can open a given browser page. - User selected fonts for the text. - Different background colors can be chosen for each message. - The scrolling can be paused with double clicking. - The scroll direction can be changed by dragging the mouse in the desired direction. - Or an optional control panel offers buttons for pause and scroll direction selection. - Different applet widths and heights can be chosen and it will adjust the text and icons to fit accordingly. Installation Unpack the EasyScroller.zip file into the directory with your web page or a sub-directory. The unpacked files include * EasyScroller.class * HSCanvas.class * HSPanel.class * Message.class * ScrollCanvas.class * * EasyScroller.html * * messages.txt * messages2.txt * * javaGuy.jpg * banner1.jpg * banner2.jpg * eye.gif The program is implemented by the class files. EasyScroller.html is an example web page with the applet. The files "messages.txt" and "messages2.txt" provide example messages for the sample web page. The image files are displayed in the sample scrolls. Applet Setup To place EasyScroller on your web page, insert the following hypertext code:
An optional table is used here to give the applet a border. The applet width and height can be altered according to the users requirements. A width of at least 125 is recommended. Note: If the files are put into a sub-directory, e.g. /Files/, then use the "codebase" parameter in the The parameters provide options for the scroller: * FileToScroll - text file holding messages according to format below. * (messages.txt is default name.) * RollSpeed - proportional to scroll speed * time/pixel line = 500ms/RollSpeed * BackgroundColor - background color of scroll. Default is white. * Values are given in hex format. See below * ShowControls - include a set of buttons to pause or change scrolling direction. value = 0 to remove controls value = 1 to add controls Message Setup Each message is listed in a file denoted by the FileToScroll parameter. A message item provides the text, font style, color, image and corresponding web page address. A sample message file: Get the latest news on space hobbies and activities. %%COURIER|BOLD|16|0x660000|3|0x55dddd%%http://www.hobbyspace.com/index.html%%banner1.jpg|100|115|;; Try other HobbySpace Java programs.%%HELVETICA|BOLD|16|0x007700|3|0xffffff%%http://www.hobbyspace.com/Java/%javaGuy.jpg|55|68|;; LinkWatch: - Monitor favorite web sites. - Fix bad links. %%DIALOG|PLAIN|12|0x000055|30|0xaaaaee%%http://www.hobbyspace.com/Java/LinkWatch/%%eye.gif|48|48|;; EasyScroller offers: - User selected fonts - Color selection. - Movement controls. - image messages. %%DIALOG|PLAIN|12|0x008000|3|0x00FFFF;; The format is Text%%Font%%URL%%Image;; with items separated by the "%%" characters and terminated by two semi-colons. Do NOT use these character pairs in the message text! Otherwise, the parsing of the messages will become scrambled. Items can be truncated from right to left but not otherwise left out. The items include Text - this can include line breaks and other whitespace. (If you want only an image and no text, place at least one space ' ' here.) Do NOT use "%%" or ";;" in your text. Font - TYPE|STYLE|SIZE|COLOR OF TEXT|HORIZONTAL OFFSET|MESSAGE BACKGROUND COLOR See below for explanations of these parameters. URL - web addresses can be absolute, i.e. http://www.a.com/, or relative to the scroll web page, i.e. "../archive/index.html" Image- name of image file followed by the image dimensions: |width|height|. The dimensions are REQUIRED or the image will not be displayed. The image file name is relative to the codebase. If, for example, the applet class files are in the sub-directory (relative to the web page) called Files/ and the image banner1.jpg is in Files/Images/, then specify the file name with "Images/banner1.jpg|100|115|" If the image is < 50% of the applet width, the image will be put on the left hand side and the text will be placed to the right of the image. Otherwise, the image will be centered and the text placed beneath. (The text will not be centered but the HORIZONTAL OFFSET below can be used to move the text towards the center. Font settings: TYPE = HELVETICA, DIALOG, COURIER STYLE= BOLD, ITALIC, PLAIN, ITALIC+BOLD SIZE = point size in number, typically 8,10,12, etc are available. TEXT COLOR = in hexadecimal style: 0xFFFFFF in which combinations of red, green and blue are assigned with values from 00 to FF where each digit runs from 0,1,....9,A,B,C,D,E,F. Typical values: red = 0xFF0000 green = 0x00FF00 blue = 0x0000FF black = 0x000000 white = 0xFFFFFF gray = 0x777777 HORIZONTAL OFFSET - number of pixels to move the message from the left hand side of the scroll. BACKGROUND COLOR - each message is seen against a band of a given background color. Colors are again in hex style. Disclaimer EasyScroller is freeware provided without any support or warranty, explicitly or implied. Java is a trademark of Sun Microsystems, Inc. HobbySpace - Copyright 1999-2001. All Rights Reserved Clark S. Lindsey www.HobbySpace.com java@hobbyspace.com