Make your own free website on Tripod.com

TOC applet ver 0.02

To use the TOC applet
  • you need the file "TOC.jar".

  • This should be kept in the same directory as the one containing the html file from which you would invoke the applet.
    sample code:
    <applet code="Toc.class" archive="toc.jar" width=260 height=480>
    <param name="tocfile"         value="ReginaToc.txt">
    <param name="ContentFrameId"  value="MyContentFrame">
    <param name="Title"           value="Regina Table of Contents">
    <param name="About"           value="This is the table of contents">
    <param name="Font"            value="Courier,Regular,12">
    <param name="Forefround"      value="255,255,255">
    <param name="Background"      value="0,0,255">
    </applet>
    The applet uses seven parameters.
    Of the seven only the first parameter viz "tocfile" is required.
    The rest are optional.
    The following paragraphs explain, in detail, each of the above code line.


    <applet code="Toc.class" archive="Toc.jar" width=260 height=480>

    This is the standard applet tag.

    The code and archive attributes should be set to "Toc.class" & "Toc.jar" respt.

    "Toc.class" is the applet class.

    "Toc.jar" contains the Toc.class and all the other classes required by the Toc.class including the NetRexx runtime classes.

    The width & height can be set to any suitable values.

    (If the applet is going to be displayed in IE browser try setting width and height to 100% (ie. width=100% height=100%).This will set the size of the applet to the size of the browser and in the case of IE browser it will also resize the applet whenever the browser is resized by the user)


    <param name="tocfile" value="ReginaToc.txt">

    This sets the value of the parameter named "tocfile".

    This parameter is mandatory. If this parameter is not set the applet will not work.

    This paramter identifies the name of  the file containing the list of topics to be displayed by the applet.

    The tocfile is a simple text file.

    It should be in the same directory or the sub directory of the directory from where the applet will be loaded.

    Each line of the tocfile should contain

  • a)the level number of the topic.

  • Level number tells the applet if a topic is a subtopic of the previous topic.To indicate that it is a subtopic the level number should be 1 more than the previous topic's level number.
  • b) name of topic,
  • c) the name of the html file which should be displayed when the user clicks this topic
  • d) the name of the window/frame in which the above html file should be displayed.

  • All the items are seperated by spaces.
    Items b,c,d should be enclosed between double quotes.(To insert double quotes in item b use &quot; . )
    Items a & b are mandatory.
    Items c & d are optional.
    If item c is not specified nothing happens when a user clicks the topic.
    If item d is not specified the file identified by item c is displayed in a window with the name identified by the parameter "ContentFrameId".
     

    Here's an example

    1 "Preface" "preface.html" "frame1"
    1 "chapter 1. Introduction" "chap1.html" "frame2"
    2 "The Java Language" "javalang.html"
    2 "Operators" "opers.html"
    3 "Arithmetic operators" "arith.html"
    4 "Operator &quot;+&quot;" "plus.html"
    3 "Relational operators" "rela.html"
    2 "Flow Control" "flow.html"
    ... etc


    Rest of the parameters described below are optional. If not set they take are given suitable default values.

    <param name="ContentFrameId" value="MyContentFrame">

    This sets the value of the parameter named "ContentFrameId".

    This parameter is optional. If not set the value of this parameter is set to "Content".

    This parameter identifies the name of the browser window or frame in which a topic's content will be displayed. The content will be displayed when the user clicks the corresponding topic name in the TOC applet.

    The applet first checks the "list of topics" file to see if a window/frame name is specified there. If specified it uses that name. If not then it uses the name identified by this parameter.

    If the named window/frame exist then the applet displays the topic in that window/frame else it creates the named window/frame and then displays the topic there


    <param name="Title" value="Regina Table of Contents">

    This sets the value of TOC applet parameter named "Title".

    This parameter is optional. If not set the value of this parameter is set to "Table of Contents".

    This parameter identifies the string which will be displayed at the top of the TOC applet.

    To insert double quotes in the value use &quot; .


    <param name="About" value="This is the table of contents">

    This sets the value of TOC applet parameter named "About".

    This parameter is optional.

    Just below the title, at the top of the TOC applet, there are three buttons labelled as "+", "-" & "?".

    When the button labelled  "?" is pushed a seperate window is opened. This window contains text describing the TOC applet.

    If the value of the "About" param is set then it's value is displayed in the above window before the TOC Applet description text.

    To insert double quotes in the value use &quot; .
    To break text into more than  one line in the value use &lf; .
    eg:  <param name="About" value = "This is line 1 &lf; This is line 2" will display as
    This is line 1
    This is line 2


    <param name="Font" value="Courier,Regular,12">

    This sets the value of the parameter named "Font".

    This parameter is optional. If not set the value of this parameter is set to the default values used by the browser for an applet.

    This parameter identifies the font name, font style and the font size which the applet should use to display the topic list.

    The font style can be set to 'Reqular' , 'Bold', 'Italic', or  'Bold+Italic'.

    If any of the 3 font parameterfs is skipped the applet sets that value of the skipped parameter to the default browser  value.
    eg: if value=",BOLD+ITALIC,12" then applet sets the font name to the default browser font name,it sets the style to bold & italic and it sets the font size to 12.


    <param name="Foreground" value="255,255,255">

    This sets the value of the parameter named "Foreground".

    This parameter is optional. If not set the value of this parameter is set to the default value used by the browser for an applet.

    This parameter identifies the color used by the applet to print out each of the topic in the topic lists.

    The color value is specified in the RGB format.
    In this example the foreground color is being set to white.


    <param name="Background" value="0,0,255">

    This sets the value of the parameter named "Background".

    This parameter is optional. If not set the value of this parameter is set to the default value used by the browser for an applet.

    This parameter identifies the color used by the applet to fill the background.

    The color value is specified in the RGB format.
    In this example the background color is being set to blue.



    If you find any problems with the applet please drop me a line at the following address
    ssatguru@netscape.net

    Thanks
    Satguru Srivastava