// Decompiled by Jad v1.5.5.2. Copyright 1997-98 Pavel Kouznetsov.// Jad home page:      http://web.unicom.com.cy/~kpd/jad.html// Decompiler options: packimports(3) // Source File Name:   Fade.javaimport java.applet.Applet;import java.applet.AppletContext;import java.awt.*;public class Fade extends Applet    implements Runnable{    public Fade()    {        thoughts = new Thoughts();        runner = null;    }    public void GetThoughts(Fade fade)    {        boolean flag = false;        for(int i = 1; !flag; i++)        {            String s = String.valueOf(i);            String s1 = "font" + s;            String s3 = "text" + s;            String s4 = "url" + s;            String s5 = super.getParameter(s1);            String s2;            int j;            byte byte0;            if(s5 == null)            {                s2 = "TimesRoman";                j = 12;                byte0 = 0;                flag = true;            }            else            {                int k = s5.indexOf(",");                int l = s5.lastIndexOf(",");                String s8 = s5.substring(0, k);                String s9 = s5.substring(k + 1, l);                String s10 = s5.substring(l + 1);                s2 = s8;                j = Integer.valueOf(s10).intValue();                if(s9.equalsIgnoreCase("PLAIN"))                    byte0 = 0;                else                if(s9.equalsIgnoreCase("BOLD"))                    byte0 = 1;                else                if(s9.equalsIgnoreCase("ITALIC"))                    byte0 = 2;                else                    byte0 = 0;            }            String s6 = fade.getParameter(s3);            if(s6 == null)            {                s6 = "No Text Given.";                flag = true;            }            String s7 = fade.getParameter(s4);            if(!flag)                thoughts.AddThought(s6, s7, s2, byte0, j);        }    }    public int HexToInt(String s)    {        int i = 0;        if(s.substring(0, 1).equalsIgnoreCase("a"))            i = 160;        else        if(s.substring(0, 1).equalsIgnoreCase("b"))            i = 176;        else        if(s.substring(0, 1).equalsIgnoreCase("c"))            i = 192;        else        if(s.substring(0, 1).equalsIgnoreCase("d"))            i = 208;        else        if(s.substring(0, 1).equalsIgnoreCase("e"))            i = 224;        else        if(s.substring(0, 1).equalsIgnoreCase("f"))            i = 240;        else            i = Integer.valueOf(s.substring(0, 1)).intValue() * 16;        if(s.substring(1).equalsIgnoreCase("a"))            i += 10;        else        if(s.substring(1).equalsIgnoreCase("b"))            i += 11;        else        if(s.substring(1).equalsIgnoreCase("c"))            i += 12;        else        if(s.substring(1).equalsIgnoreCase("d"))            i += 13;        else        if(s.substring(1).equalsIgnoreCase("e"))            i += 14;        else        if(s.substring(1).equalsIgnoreCase("f"))            i += 15;        else            i += Integer.valueOf(s.substring(1)).intValue();        return i;    }    public String getAppletInfo()    {        return "Fade by Shin";    }    public void init()    {        String s = getParameter("bgcolor");        if(s == null || s.length() != 6)            thoughts.SetBackground(0, 0, 0);        else            thoughts.SetBackground(HexToInt(s.substring(0, 2)), HexToInt(s.substring(2, 4)), HexToInt(s.substring(4)));        setBackground(thoughts.GetBackground());        String s1 = getParameter("txtcolor");        if(s1 == null || s1.length() != 6)            thoughts.SetTextColor(255, 255, 255);        else            thoughts.SetTextColor(HexToInt(s1.substring(0, 2)), HexToInt(s1.substring(2, 4)), HexToInt(s1.substring(4)));        String s2 = getParameter("changefactor");        if(s2 == null)            thoughts.SetChangeFactor(1);        else            thoughts.SetChangeFactor(Integer.valueOf(s2).intValue());        GetThoughts(this);        thoughts.Reset();        resize(size().width, size().height);    }    public boolean mouseDown(Event event, int i, int j)    {        super.getAppletContext().showDocument(thoughts.GetCurrentURL());        return true;    }    public boolean mouseEnter(Event event, int i, int j)    {        showStatus("Fade.java by Shin");        return true;    }    public void paint(Graphics g)    {    }    public void run()    {        while(runner != null)         {            int i = thoughts.ChangeColors();            repaint();            try            {                Thread.sleep(25 * i);            }            catch(InterruptedException ex) {}        }    }    public void start()    {        if(runner == null)        {            runner = new Thread(this);            runner.setPriority(1);            runner.start();        }    }    public void stop()    {        runner = null;    }    public void update(Graphics g)    {        thoughts.DrawThoughts(this, g);    }    Thoughts thoughts;    Thread runner;}
