// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   IntroScreen.java

import java.awt.*;

public class IntroScreen extends Window
{

    public Image getImage()
    {
        return image;
    }

    public IntroScreen(Frame frame1, int i)
    {
        super(frame1);
        stage = -1;
        font = new Font("Helvetica", 1, 100);
        speed = 30;
        f = frame1;
        delay = i;
        setSize(640, 480);
        setLocation((getToolkit().getScreenSize().width - 640) / 2, (getToolkit().getScreenSize().height - 480) / 2);
        setBackground(Color.black);
        setVisible(true);
        requestFocus();
        image = createImage(640, 480);
    }

    public void paintIcon(int i, int j, Graphics g)
    {
        Color color = new Color(160, 160, 100);
        g.setColor(color);
        g.fill3DRect(1 + i, 1 + j, 19, 19, true);
        g.setColor(Color.black);
        g.drawArc(2 + i, 5 + j, 5, 10, 90, -160);
        g.drawArc(13 + i, 5 + j, 5, 10, 90, 200);
        g.drawLine(10 + i, 3 + j, 10 + i, 17 + j);
        g.drawLine(4 + i, 9 + j, 16 + i, 9 + j);
        g.drawLine(4 + i, 11 + j, 16 + i, 11 + j);
    }

    public void paint(Graphics g)
    {
        if(image != null)
            g.drawImage(image, 0, 0, null);
        update(g);
    }

    public void update(Graphics g)
    {
        if(image != null && g2 == null)
            g2 = image.getGraphics();
        if(g2 != null)
        {
            g.drawImage(image, 0, 0, null);
            switch(stage)
            {
            case -1: 
                g2.setColor(new Color(10, 10, 10));
                g2.fillRect(0, 0, 640, 480);
                g2.setColor(new Color(170, 100, 170));
                g2.drawRect(1, 1, 638, 478);
                g2.setColor(new Color(150, 80, 150));
                g2.drawRect(2, 2, 636, 476);
                g2.setColor(new Color(130, 60, 130));
                g2.drawRect(3, 3, 634, 474);
                g2.setColor(new Color(110, 40, 110));
                g2.drawRect(4, 4, 632, 472);
                g2.setColor(new Color(90, 20, 90));
                g2.drawRect(5, 5, 630, 470);
                stage++;
                update(g);
                return;

            case 0: // '\0'
                angle += 0.049087385212340517D;
                paintIcon((int)(Math.sin(angle) * 100D) + 150, (int)(Math.cos(angle) * 120D) + 240, g2);
                paintIcon(480 - (int)(Math.sin(angle) * 100D), 240 - (int)(Math.cos(angle) * 120D), g2);
                if(angle > 3.1415926535897931D)
                    stage++;
                update(g);
                return;

            case 1: // '\001'
                paintIcon(frame + 145, 215, g2);
                paintIcon(490 - frame, 265, g2);
                frame += 6;
                if(frame > 350)
                {
                    stage++;
                    frame = 0;
                }
                update(g);
                return;

            case 2: // '\002'
                paintIcon(315, frame + 80, g2);
                frame += 6;
                if(frame > 320)
                    stage++;
                update(g);
                return;

            case 3: // '\003'
                g2.setColor(new Color(160, 160, 100));
                g2.draw3DRect(122, 70, 410, 360, true);
                g2.draw3DRect(121, 69, 412, 362, true);
                g2.draw3DRect(120, 68, 414, 364, true);
                g2.draw3DRect(119, 67, 416, 366, true);
                g2.draw3DRect(118, 66, 418, 368, true);
                stage++;
                speed = 160;
                update(g);
                return;

            case 4: // '\004'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("L", 490, 330);
                stage++;
                speed = 120;
                update(g);
                return;

            case 5: // '\005'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("A", 210, 360);
                stage++;
                update(g);
                return;

            case 6: // '\006'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("R", 125, 200);
                stage++;
                update(g);
                return;

            case 7: // '\007'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("M", 300, 375);
                stage++;
                update(g);
                return;

            case 8: // '\b'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("C", 60, 260);
                stage++;
                update(g);
                return;

            case 9: // '\t'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("S", 30, 130);
                stage++;
                update(g);
                return;

            case 10: // '\n'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("E", 540, 220);
                stage++;
                update(g);
                return;

            case 11: // '\013'
                if(delay == 1)
                    try
                    {
                        Thread.currentThread();
                        Thread.sleep(speed);
                    }
                    catch(Exception _ex) { }
                g2.setFont(font);
                g2.setColor(new Color(30, 120, 50));
                g2.drawString("B", 425, 275);
                stage++;
                update(g);
                return;
            }
            if(delay == 1)
                try
                {
                    Thread.currentThread();
                    Thread.sleep(3000L);
                }
                catch(Exception _ex) { }
            dispose();
            f.setVisible(true);
        }
    }

    int stage;
    int delay;
    double angle;
    int frame;
    Font font;
    int speed;
    Image image;
    Frame f;
    Graphics g2;
}
