![]() |
siteViewer.class
|
|||
|
This is another of my applets. It can be used to display a Web site in a hierarchical format similar to a disk drive layout, with the ability to open and close layers of the site in a fashion synonymous to folders. The hierarchy information is contained within a data file whose location is passed to the applet via the FILE_NAME parameter. The data file can be broken into 3 parts.
In order to display different images against different types of item I decided to use suffix to image mapping rather than to specify an image for each item in the file. The second section of the file carries this mapping information and is simply a block of lines, immediately after the header text line, that each start with a number and end with a suffix. The number is the index of the image to display, the images coming from the IMAGE_FILE. This file is in transparent GIF format, and contains all the images that can be displayed against an item. Each image is 16 pixels square, the IMAGE_FILE essentially containing a table of images, with each row of the table being 16 images wide. You can supply your own IMAGE_FILE as long as it conforms to this 16 pixels square image, 16 images wide, n images deep format. Here is the file that I have used in the above example.
The last section of the file is where the hierarchy, URLs and display text is defined. The viewer is constructed sequentially so each level of the site hierarchy must appear one entry after the other in the file, IE all items for level A followed by all items for level B followed by level C and so on, no intermixing of levels is supported. The format for the lines is simple. There are 2 types of line, one describing a level of hierarchy (a folder if you like), and the other an item within the current level.
The file that I used to generate the applet above can be found here. If you look at it I hope that you I hope you agree that the format for the file is quite simple and can be generated pretty quickly with a half decent text editor. |
|
Content of this page Copyright © Robert Quince 1996 - 2005. |