/*----------------------------------------------------------------------*/ /* TitleTex puts annimated text in boxes - it is simply an interface to the class Btex *** TitleTex and Btex together are an extension of DancingText which was written by James Gosling at SUN */ /*----------------------------------------------------------------------*/ /* Jim Morey - morey@math.ubc.ca - Aug 30 */ /*----------------------------------------------------------------------*/ import java.io.InputStream; import awt.*; import browser.*; import browser.audio.AudioData; import net.www.html.*; /*----------------------------------------------------------------------*/ public class TitleTex extends Applet implements Runnable { private Thread kicker = null; private int W,H,i,j; private String tmp; private boolean banner_ready=false; private Btex theBanner; private Float crap; /* - - - - - - - - - - - - - - - - - - - - - - */ public void init() { /* .. I hope to have this up to date with Banner so that html files can do all the tricks Banner can .. */ String s = null; W = Integer.parseInt(getAttribute("time")); try { W = Integer.parseInt(getAttribute("width")); } catch(Exception e) { W = 500; } try { H = Integer.parseInt(getAttribute("height")); } catch(Exception e) { H = 50; } resize(W,H); theBanner = new Btex(this,W,H); try { s = getAttribute("text"); } catch(Exception e) { } try { theBanner.style = Integer.parseInt(getAttribute("style")); } catch(Exception e) { theBanner.style = 0; } try { theBanner.audioName = getAttribute("sound"); /* .. commented out in Banner .. */ } catch(Exception e) { } try { String junk = getAttribute("format"); if (junk.indexOf("centre")!=-1) theBanner.centre = true; if (junk.indexOf("box")!=-1) theBanner.box = true; } catch(Exception e) { } String fonts = getAttribute("font"); i=0; /* .. first count the words ***This needs exactly one space between the font .. */ if (fonts != null){ tmp = fonts.substring(i,fonts.length()); while (tmp.indexOf(" ")!=-1){ tmp = tmp.substring(tmp.indexOf(" ")+1,tmp.length()); i++; } theBanner.num_fonts = i; theBanner.fontName = new String[theBanner.num_fonts]; tmp = fonts.substring(0,fonts.length()); for(i=0;i