April 15, 2008

Code to embed JTreeView Applet into IE and firefox

Especially when dealing with a lot of samples and arrays, generated heatmap images can get too large to look at.
JTreeView is an extremely useful open source application written by Alok Saldanha for viewing microarray
and other high throughput data in an interactive heat map.

One useful example of using JTreeView is when you dynamically generate the dataset from a database, cluster it, and then present
it to the user.

Because of the way that IE and firefox embed applets, the firefox way won’t work with IE and vice versa.
In order to embed the applet code so that both IE and firefox works, you need to nest the code for both browsers since they handle
applets differently.

Here is an example:



       <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
        width=150 height=30 >
<param name='code' value='edu/stanford/genetics/treeview/applet/ButtonApplet.class'>
<param name = 'archive' value ='http://servername/path/applet/TreeViewApplet.jar,

http://servername/path/applet/nanoxml-2.2.2.jar,

http://servername/path/applet/plugins/Dendrogram.jar'>
<param name='cdtFile' value='http://servername/path/200804111207954001.cdt'>
<param name='cdtName' value='JTreeView Heat Map'>
<param name='plugins' value='edu.stanford.genetics.treeview.plugin.dendroview.DendrogramFactory'>

	<comment>

       <APPLET CODE='edu/stanford/genetics/treeview/applet/ButtonApplet.class'

      archive='http://servername/path/applet/TreeViewApplet.jar,http://servername/path/applet/nanoxml-2.2.2.jar,
http://servername/path/applet/plugins/Dendrogram.jar' width=150 height=50

        alt='Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason.'

>
        Your browser is completely ignoring the &lt;APPLET&gt; tag!
<param name='cdtFile' value='http://servername/path/200804111207954001.cdt'>
<param name='cdtName' value='JTreeView Heat Map'>
<param name='plugins' value='edu.stanford.genetics.treeview.plugin.dendroview.DendrogramFactory'>

      </applet>

	</comment>
      </OBJECT>


The APPLET tag is embedded as a comment in the OBJECT tag.  IE will ignore the comment. Firefox will ignore the OBJECT.

In order to save images from the applet, you need to sign the jars. (instructions)

Note that exiting the applet will close the browser unless you get the most updated codebase or you add this fix.

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI
You can also bookmark this on del.icio.us or check the cosmos

Leave a comment

You must be logged in to post a comment.