%%%
%%% jdvi specials
%%%
%%%
%%% \applet takes the applets class and its width and height in TeX points
%%% (TeX point  = 1inch/72.27)or any other TeX dimension.
%%% You may place whitespace separated 
%%% \param{name}{value} commands in an optional argument.
%%% Exapmle: \applet[\param{Color}{Red} \param{ticks}{12}]{mycode.Test.class}{4cm}{2.3in}
%%%
%%% \namedapplet is the same as \aplet but has a third required argument: the 
%%% applet name. It will automatically generate a label with the same name, so
%%% if you use \namedapplet a doublicate label warning can mean you have two 
%%% applets named the same.
%%%
\ProvidesPackage{jdvi}
          [2000/08/24 v1.0]
\RequirePackage{hyperref}
\def\jDvi{\hbox{\lower.58ex\hbox{J}\kern-.14emD\kern-.04emvi}}
\newdimen\@appletheight
\newdimen\@appletwidth
\newcommand{\param}[2]{\special{html:<PARAM NAME="#1" VALUE="#2">}}
%
\newcommand{\applet}[4][]{
\@appletwidth=#3%
\@appletheight=#4%
\vbox to\@appletheight{%\hrule
\vfill\hbox to\@appletwidth{%
%\vrule
\vbox to \@appletheight{}\special{html:<APPLET CODE="#2" WIDTH="\the\@appletwidth" HEIGHT="\the\@appletheight">}#1\special{html:</APPLET>}%
\hfill}}%
}
%
\newcommand{\namedapplet}[5][]{
\@appletwidth=#3%
\@appletheight=#4%
\vbox to\@appletheight{%\hrule
\vfill\hbox to\@appletwidth{%
%\vrule
\vbox to \@appletheight{}\label{#5}\special{html:<APPLET CODE="#2" WIDTH="\the\@appletwidth" HEIGHT="\the\@appletheight" NAME="#5">}#1\special{html:</APPLET>}%
\hfill}}%
}
