
VIRTUAL MAX TREE APPLET

Features

  Windows style tree menu 
  Unlimited depth 
  Customizable 4 states iconsets  for each menu item 
  Custom colors for all components. 
  Easy menu structure definition in external text file 
  Automatic scrollbar 
  Last opened document pointer 
  Full Javascript support 
  

Applet Tag Example

<APPLET NAME="vmtree" CODE=vmaxtree.class WIDTH=250 HEIGHT=250>
<param name="ICONSET0"    value="icons/folder_mokko.gif, icons/ofolder_mokko.gif, icons/folder_cyan.gif, icons/ofolder_cyan.gif">
<param name="ICONSET1"    value="icons/page_mokko.gif, icons/page_cyan.gif">
<param name="ICONSET2"    value="icons/book_closed.gif, icons/book_opened.gif, icons/book_closed_blue.gif, icons/book_opened_blue.gif">
<param name="ICONSET3"    value="icons/book_question.gif, icons/book_question_blue.gif">
<param name="ICONSET4"    value="icons/CDmby.gif,icons/CDgby.gif">
<param name="ICONSET5"    value="icons/movie_gray.gif,icons/movie_green.gif">
<param name="ICONSET6"    value="icons/script_yellow.gif,icons/script_blue.gif">
<param name="ICONSET7"    value="icons/mail_yellow.gif,icons/mail_cyan.gif">
<param name="POINTERICON" value="icons/arrow_gold.gif">
<param name="TEXTCOLOR"   value="660000">
<param name="HLCOLOR"     value="cc0000">
<param name="SBCOLOR"     value="cc9966">
<param name="BGCOLOR"     value="ffcc99">
<param name="ICONWIDTH"   value="16">
<param name="ICONHEIGHT"  value="16">
<param name="FONT"        value="Dialog,0,12">
<param name="URL"         value="vmaxtreedemo.txt">
<param name="TARGET"      value="_blank">
<param name="OPEN"        value="Link3">
<param name="SBWIDTH"     value="14">
<param name="AUTHOR"      value="Virtual_Max (http://come.to/vmax)">
<param name="KEY"         value="Free Version">
<param name="STEP"        value="4">
<param name="DELAY"       value="50">
</APPLET>

Parameters

  
                     
ICONSET0..ICONSETn  Each menu item can use up to 4 icons to display it's state: normal
                    closed, highlighted closed, normal opened and highlighted opened.
                    Icons are joined in iconsets up to 4 icons in each. So when you
                    define menu structure, you define # of iconset for this item to use.
                    This approach allows to combine high flexibility with easy of use. 
                    Iconsets must be enumerated from 0 and don't have any missed
                    numbers. You can define as many different iconsets as you need. 
                    Each iconset can contain up to 4 image names separated with
                    commas, this images will be used in the order as mentioned above
                    to display states of the item. In case of less than 4 names
                    specified, last specified image will be used for next states, so the
                    following 3 lines are equivalent: 
                    <param name="ICONSET0"    value="a.gif,b.gif"> 
                    <param name="ICONSET0"   
                    value="a.gif,b.gif,b.gif"> 
                    <param name="ICONSET0"   
                    value="a.gif,b.gif,b.gif,b.gif">
 
POINTERICON         Applet remeber the last clicked item (if last clicked item have
                    associated link). Pointericon parameter  is the name of the icon
                    image file to use for this pointer. In this example a tiny arrow .
                    Icon will be placed next to the title of last clicked menu item.
 
TEXTCOLOR           Color for titles and tree structure.
 
HLCOLOR		    Color for titles in highlighted state.
 
SBCOLOR             Scrollbar  color, for arrows color textcolor will be used.
 
BGCOLOR             Background color
 
ICONWIDTH           Width of icons ( 16 recommended as optimal )
 
ICONHEIGHT          Height of icons, and the height of the menu items. ( 16 recommended ) 
 
SBWIDTH             Scrollbar width, default value is 14.
 
FONT                Font contains 3 tokens separated with commas, Those three
                    tokens are: Fontname, FontStyle and FontSize: Browser's Java
                    support only few platform independent fontnames: Helvetica,
                    Courier, Dialog, InputDialog and TimesRoman. FontStyle is
                    integer: 
                    0 - Plain 
                    1 - Bold 
                    2 - Italic 
                    3 - BoldItalic 
                    FontHeight expected to be integer number of pixels. Example:
                    Plain dialog font with 12 pixels height. 
                    <param name="FONT"        value="Dialog,0,12">
 
URL                 Is URL of the file containing menu definition structure.
 
TARGET              Optional parameter to specify the target window or frame name
                    for links. Same as TARGET attribute of HTML link <A
                    href="some.html" TARGET="windowName">. 
                    windowName can be window name as defined with NAME
                    attribute of the <FRAME .. > tag or one of predefined names can
                    be used: 
                    _top 
                    _self 
                    _blank 
                    _parent
 
OPEN                When menu loads first time it  can be reasonable to specify it's
                    initial state someway. With this parameter you can pass the  Title
                    of the menuitem where menu must be expanded. The first item
                    which match this title will be expanded. In case it's deep into other
                    folders, all parent folders will be expanded too. 
 
AUTHOR              Don't alter this parameter. Always must be: 
                    <param name="AUTHOR"      value="Virtual_Max
                    (http://come.to/vmax)">
 
KEY                 You are welcome to use this applet free with Key "Free Version".

                    <param name="KEY"         value="Free Version"> 
                    Free version of the applet will add link back to our site. If you
                    want to  get rid of this additional link you must register this applet.
 
STEP                Animation step in pixels. Optional parameter. default value is 4
 
DELAY               Animation delay per frame in milliseconds. Optional, default value is 50 


Menu Structure Definition

Menu structure is defined in a separate text file. URL of this file is specified with URL
parameter. Format of the file is quite simple, here is an example: 


>Site Map            |0
  >Applets           |0 |mainApplets.html
     >TextScrollers  |1
        >page1       |2 |page1.html
        >page2       |2 |page2.html
        >page3       |2 |page3.html
     >Menus          |1  
        >page3       |2 |page3.html 
        >page4       |2 |page4.html
        >page5       |2 |page5.html
     >ImageEffects   |1
        >page6       |2 |page7.html
        >page7       |2 |page8.html
        >page8       |2 |page9.html

  >Scripts           |0 |mainScripts.html
    >Watching Eyes   |2 |eyes2.html
    >Moving Objects  |2 |moveobjlib.html

  >FAQs              |3 |mainHelp.html
    >GotApplet       |2 |gotapplet.html
    >Troubleshooting |2 |troubleshooting.html
>Back                |4 |Javascript:history.back(); 
>Home                |5 |http://come.to/vmax


Each menu item line starts with spaces followed by > character which marks the depth of
menu. Format is free and allow any number of spaces. The only requirement is that items
within the same folder must starts with the SAME number of spaces. If line don't starts with
spaces and > character, it will be ignored. So you are free to place comments as you like. 
Next to > pointer menu title goes, it's followed by ICONSET number and HREF separated
with | character. Note that each item can be a folder and can contain link to some page. Like
Applets item in above example. 
  

Colors

All colors are in RRGGBB hexadecimal colors format same as HTML colors are, but without
# radix simbol. Colors from web safe 6x6x6 palette recommended. You can use this
colorchooser applet to get websafe color codes. 

Icons

Below is the list of icons included in package, but one can use his own icons. The only
requirement, try to use icons of the same sizes as ones you specified with ICONWIDTH and
ICONHEIGHT parameters. Recommended size is 16x16 pixels. 
Java applets can handle  only noninterlaced GIF and JPG formats. Note that JPGs must be
saved as "Baseline Standard" JPG. 
  
book_closed.gif 
book_closed_blue.gif 
book_opened.gif 
book_opened_blue.gif
book_question.gif 
book_question_blue.gif
folder_cyan.gif 
folder_mokko.gif 
ofolder_mokko.gif 
ofolder_cyan.gif
download_h.gif 
download_n.gif
page_cyan.gif 
page_mokko.gif 
CDgby.gif 
CDmby.gif 
script_blue.gif 
script_yellow.gif
arrow_cyan.gif 
arrow_gold.gif 
mail_cyan.gif 
mail_yellow.gif
movie_gray.gif 
movie_green.gif


JavaScript support (for advanced users)

Applet provide full javascript support. From one hand if item link starts with Javascript:  
it will be evaluated as JavaScript expression in context of current window. On other hand applet
provide public method to open tree folders from JavaScript. But before you would use this
method, not bad to be sure applet already loaded in order to avoid errors. 
You would need something like this: 
  

<script>
//this function checks for applet named vmtree in frame named
//treeleft and return applet object reference on success otherwise null.
function checkApplet()
{if(parent)
 if(parent.treeleft)
 if(parent.treeleft.document)
 if(parent.treeleft.document.vmtree)
   {a=parent.treeleft.document.vmtree; 
    if(a!=null)
      {if(a.ready)
         {return a;}
      }
   }
 return null;
}

//This function will do the opening of folder with specified ftitle
//in case applet already loaded, or do nothing
function openAt(ftitle)
{var a=checkApplet();
 if(a)  a.openAt(ftitle)
}

</script>

Last function will first check applet finished loading and than will call
VMaxTree.openAt(String title) method. Try this example (select item to open) 
