Usage of the TextMap class file implies acceptance of these restrictions and notations. Oh, lighten up, it's free after all.
The purpose of this class is to generically display user definable textboxes as a mouse passes over user definable locations of a user definable GIF or JPG image. Maybe that's not terribly clear, but just play around with the above Java applet and you will get the basic idea. It is similar to an imagemap, but it does not launch you off onto another web page and it provides simplicity and flexibilty over using image sources with alternate text laid out on huge tables (I don't care to try to lay out 500 images with alternate text in a table anyway).
This class is capable of displaying information about a maximum of 500 locations on the image. Each textbox for each location can contain up to three 80-character strings.
<APPLET CODE="TextMap.class" WIDTH=640 HEIGHT=480>
<PARAM NAME=file VALUE=yourfile.txt>
If you see this message, you need to enable JAVA in your web browser options</APPLET>
The CODE= tag must contain the class file "TextMap.class" in quotes. The applet will not work if you change the name of the class file.
The WIDTH= and HEIGHT= tags generally should be the width and height of your image file in pixels.
The PARAM NAME= tag must be "file" without quotes. The VALUE= tag may be any file name you desire. This file must contains user definable setup parameters. You must create this file and it must strictly have the following format (there is an example file available to help get through this):
LINE 1 must have the key phrase "coordinates off" or "coordinates on". When "coordinates on" is used, the current mouse coordinates will be displayed at the top of the applet image. This coodinate display can be used to determine the textbox locations needed later on in this file. Use "coordinates off" once your file is developed.
LINE 2 must have the name of the graphics file. It must be a GIF or JPG file and must be located in the same directory as the TextMap.class file.
LINE 3 must have the "hide distance" distance in pixels. This distance is how far the mouse must move away from a particular location before the associated textbox is erased from the applet. This value must be an integer. A value of 15 is recommended.
LINE 4 must have the "show distance" distance in pixels. This distance is how close the mouse must get to a particular location before the associated text box appears in the applet. This value must be an integer. A value of 7 is recommended.
LINE 5 must have a text font such as Helvetica, TimesRoman or Courier. Any font recognizable by Java 1.0.2 will work. Helvetica is the recommended font name.
LINE 6 must have the text size in points for use in the textboxes. Any integer size recognizable by Java 1.0.2 will work. A value of 10 is recommended.
LINE 7 must have the text color red RGB value. This must be an integer from 0 to 255. A value of 64 is recommended.
LINE 8 must have the text color green RGB value. This must be an integer from 0 to 255. A value of 64 is recommended.
LINE 9 must have the text color blue RGB value. This must be an integer from 0 to 255. A value of 64 is recommended.
LINE 10 must have the textbox color red RGB value. This must be an integer from 0 to 255. A value of 255 is recommended.
LINE 11 must have the textbox color green RGB value. This must be an integer from 0 to 255. A value of 240 is recommended.
LINE 12 must have the textbox color blue RGB value. This must be an integer from 0 to 255. A value of 250 is recommended.
LINE 13 must have the textbox border color red RGB value. This must be an integer from 0 to 255. A value of 128 is recommended.
LINE 14 must have the textbox border color green RGB value. This must be an integer from 0 to 255. A value of 128 is recommended.
LINE 15 must have the textbox border color blue RGB value. This must be an integer from 0 to 255. A value of 128 is recommended.
LINE 16 lists the X coordinate value of the first textbox item. This value is in pixels begining at the left hand side of the applet image and increases to the right.
LINE 17 lists the Y coordinate value of the first textbox item. This value is in pixels beginning at the top of the image and increases downward.
LINE 18 lists the first string of the first textbox item. This can be up to 80 characters long.
LINE 19 lists the second string of the first textbox item. This can be up to 80 characters long.
LINE 20 lists the third string of the first textbox item This can be up to 80 characters long.
lines 16 through 20 repeat for each remaining textbox items.
- TextMap.class: This is the Java TextMap.class file itself.
- usaloc.txt: This an example setup file, from the above applet.
- USAmap.html: This is an example hypertext file, for the above applet.
- usaflat.gif: This is an example image file, from the above applet.
These four files are available in a zip format from here
Remember that you must have Java enabled in your brower for this applet to work and that all these files must be in the same web directory. Please note that you cannot just place these files on your local machine and open the hypertext file with a browser. This is because the setup file is read into the class file using sockets. Hence, you must place these files on an active web server, ie, your ISP's web space.
Good luck!
Alan Locke, aslocke@halcyon.com