Standards Compliant way of placing a Freemind Mindmap

Deprecated Method With the 'Applet' Element

The intention of this article is to provide a guide to webmasters for placing the Freemind Browser (which is a Java Applet) using an 'object' element, instead of the deprecated 'applet' element.

An example of the deprecated code used for placing the Freemind Mindmap in an XHTML document is:

<applet code="freemind.main.FreeMindApplet.class" archive="http://rolandog.com/freemind/freemindbrowser.jar" width="600" height="400">
      <param name="type" value="application/x-java-applet;version=1.4" />
      <param name="scriptable" value="false" />
      <param name="modes" value="freemind.modes.browsemode.BrowseMode" />
      <param name="browsemode_initial_map" value="http://rolandog.com/freemind/Polietileno.mm" />
      <param name="initial_mode" value="Browse" />
      <param name="selection_method" value="selection_method_direct" />
</applet>

Using the 'Object' Element and Conditional Comments

Transforming the deprecated applet element using Shayne Steele's approach would yield the following code:

<!--[if !IE]>-->
<object classid="java:freemind.main.FreeMindApplet.class" type="application/x-java-applet" archive="http://rolandog.com/freemind/freemindbrowser.jar" width="600" height="400">
      <param name="archive" value="http://rolandog.com/freemind/freemindbrowser.jar" />
      <param name="scriptable" value="false" />
      <param name="modes" value="freemind.modes.browsemode.BrowseMode" />
      <param name="browsemode_initial_map" value="http://rolandog.com/freemind/Polietileno.mm" />
      <param name="initial_mode" value="Browse" />
      <param name="selection_method" value="selection_method_direct" />
<!--<![endif]-->
      <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab" width="600" height="400">
            <param name="code" value="freemind.main.FreeMindApplet" />
            <param name="archive" value="http://rolandog.com/freemind/freemindbrowser.jar" />
            <param name="scriptable" value="false" />
            <param name="modes" value="freemind.modes.browsemode.BrowseMode" />
            <param name="browsemode_initial_map" value="http://rolandog.com/freemind/Polietileno.mm" />
            <param name="initial_mode" value="Browse" />
            <param name="selection_method" value="selection_method_direct" />
            <strong>
                  This browser does not have a Java Plug-in.
            </strong>
            <br />
            <a href="http://java.sun.com/products/plugin/downloads/index.html">
                  Get the latest Java Plug-in here.
            </a>
      </object>
<!--[if !IE]>-->
</object>
<!--<![endif]-->

As you can see... it works!

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Using Nested 'Object' Elements and CSS

I was looking for an easier way of placing the mindmap, and I found out that b

I got inspired by a page that details how to place quicktime movies as nested objects , while hiding one of them from Internet Explorer using CSS. I decided to give it a try. Converting 'mov' to 'java', and having the parent object have a class='java' attribute does the trick. The following code has to be placed in the head of the (X)HTML Document:

<!--[if lte IE 6]>
<style type="text/css">/*<![CDATA[*/
      /* hides the first object from all versions of IE */
      * html object.java {
            display: none;
      }
      /* displays the first object in all versions of IE apart from 5 on PC */
      * html object.java/**/ {
            display: inline;
      }
      /* hides the first object from all versions of IE >= 5.5 */
      * html object.java {
            display/**/: none;
      }
/*]]>*/</style>
<![endif]-->

And now, adding a 'class' attribute to the first element with a value of 'java' (and removing the conditional comments), we get the following code:

<object class="java" classid="java:freemind.main.FreeMindApplet.class" type="application/x-java-applet" archive="http://rolandog.com/freemind/freemindbrowser.jar" width="600" height="400">
      <param name="archive" value="http://rolandog.com/freemind/freemindbrowser.jar" />
      <param name="scriptable" value="false" />
      <param name="modes" value="freemind.modes.browsemode.BrowseMode" />
      <param name="browsemode_initial_map" value="http://rolandog.com/freemind/Polietileno.mm" />
      <param name="initial_mode" value="Browse" />
      <param name="selection_method" value="selection_method_direct" />
      <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab" width="600" height="400">
            <param name="code" value="freemind.main.FreeMindApplet" />
            <param name="archive" value="http://rolandog.com/freemind/freemindbrowser.jar" />
            <param name="scriptable" value="false" />
            <param name="modes" value="freemind.modes.browsemode.BrowseMode" />
            <param name="browsemode_initial_map" value="http://rolandog.com/freemind/Polietileno.mm" />
            <param name="initial_mode" value="Browse" />
            <param name="selection_method" value="selection_method_direct" />
            <strong>
                  This browser does not have a Java Plug-in.
            </strong>
            <br />
            <a href="http://java.sun.com/products/plugin/downloads/index.html">
                  Get the latest Java Plug-in here.
            </a>
      </object>
</object>

So, now let us test-drive this code:

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Using ECMAScript, Nested Objects, CSS

There shouldn't be any problems, theoretically...

Isues in Internet Explorer

I still don't know why it doesn't work, but I decided to write a page detailing how to place the Java Applet using DOM methods .

Additional Information

JavaScript is another name for ECMAScript. Freemind is a premier free mind-mapping software written in Java. Questions, comments? Email: rolandog@gmail.com . Visit: http://rolandog.com/ , http://freemind.sourceforge.net/ .