Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/11/2004, 12:23
Avatar de Funk
Funk
 
Fecha de Ingreso: septiembre-2003
Ubicación: BA - Argentina
Mensajes: 102
Antigüedad: 21 años, 6 meses
Puntos: 0
parte2

Código:
public Color B(String s1)
    {
        int i1;
        int j1;
        int k1;
        try
        {
            i1 = Integer.parseInt(s1.substring(0, s1.indexOf(",")).trim());
            j1 = Integer.parseInt(s1.substring(s1.indexOf(",") + 1, s1.lastIndexOf(",")).trim());
            k1 = Integer.parseInt(s1.substring(s1.lastIndexOf(",") + 1).trim());
        }
        catch(NumberFormatException numberformatexception)
        {
            System.out.println("can't convert to integer, Switching to default colors" + numberformatexception);
            return null;
        }
        try
        {
            return new Color(i1, j1, k1);
        }
        catch(IllegalArgumentException illegalargumentexception)
        {
            System.out.println("can't create new color, Switching to default colors" + illegalargumentexception);
        }
        return null;
    }

    public int C(String s1, Vector vector)
    {
        StringTokenizer stringtokenizer = new StringTokenizer(s1, ";", false);
        int i1;
        for(i1 = 0; stringtokenizer.hasMoreTokens(); i1++)
        {
            String s2 = stringtokenizer.nextToken().trim();
            vector.addElement(s2);
        }

        return i1;
    }

    public void start()
    {
        if(A == null)
        {
            A = new Thread(this);
            A.start();
        }
    }

    public void stop()
    {
        if(A != null)
        {
            A.stop();
            A = null;
        }
    }

    public void run()
    {
        do
        {
            if(v == 1)
            {
                J = C / 2;
                K = D / 2;
                L = 0;
                for(M = 0; J > -N; M += 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    J -= N;
                    K--;
                    L += N * 2;
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 4)
            {
                J = 0;
                K = 0;
                L = 0;
                M = D;
                for(; L < C + N; L += N)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 2)
            {
                J = C;
                K = 0;
                L = C;
                M = D;
                for(; J > -N; J -= N)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 5)
            {
                J = 0;
                K = 0;
                L = C;
                for(M = 0; M < D + 2; M += 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 3)
            {
                J = 0;
                K = D;
                L = C;
                M = D;
                for(; K > -2; K -= 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 8)
            {
                J = 0;
                K = D;
                L = 0;
                for(M = 0; K > -2; M += 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    K -= 2;
                    L += N * 2;
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 9)
            {
                J = C;
                K = D;
                L = 0;
                for(M = 0; J > -2 * N; M += 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    J -= 2 * N;
                    K -= 2;
                    L += N * 2;
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 7)
            {
                J = C;
                K = 0;
                L = 0;
                for(M = 0; J > -2 * N; M += 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    J -= 2 * N;
                    L += N * 2;
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 6)
            {
                J = 0;
                K = 0;
                L = 0;
                for(M = 0; L < C + 2 * N; M += 2)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    L += N * 2;
                }

                f = c;
                c = d;
                d = f;
            } else
            if(v == 10)
            {
                J = C / 2;
                K = 0;
                L = 0;
                M = D;
                while(J > -N) 
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    J -= N;
                    L += N * 2;
                }
                f = c;
                c = d;
                d = f;
            } else
            if(v == 11)
            {
                J = 0;
                K = D / 2;
                L = C;
                for(M = 0; K > -N; M += 2 * N)
                {
                    repaint();
                    try
                    {
                        Thread.sleep(50L);
                    }
                    catch(InterruptedException _ex) { }
                    K -= N;
                }

                f = c;
                c = d;
                d = f;
            }
            try
            {
                Thread.sleep(P);
            }
            catch(InterruptedException _ex) { }
            I++;
            if(I > O - 1)
                I = 0;
            v = u[I];
        } while(true);
    }

    public void paint(Graphics g1)
    {
        b.setColor(c);
        b.setClip(J, K, L, M);
        b.fillRect(J, K, L, M);
        b.setColor(e);
        S = (String)g.elementAt(I);
        F = Z.stringWidth(S);
        G = (C - F) / 2;
        b.drawString(S, G, E);
        g1.drawImage(a, 0, 0, this);
    }

    public void update(Graphics g1)
    {
        paint(g1);
    }

    public boolean mouseDown(Event event, int i1, int j1)
    {
        try
        {
            getAppletContext().showDocument(new URL((String)h.elementAt(I)), Y);
        }
        catch(MalformedURLException _ex)
        {
            System.out.println("Wrong URL");
        }
        return true;
    }

    public GeoBanner()
    {
    }

    Thread A;
    int B;
    int C;
    int D;
    int E;
    int F;
    int G;
    int H;
    int I;
    int J;
    int K;
    int L;
    int M;
    int N;
    int O;
    int P;
    int Q;
    Font R;
    String S;
    String T;
    String U;
    String V;
    String W;
    String X;
    String Y;
    FontMetrics Z;
    Image a;
    Graphics b;
    Color c;
    Color d;
    Color e;
    Color f;
    Vector g;
    Vector h;
    Vector i;
    final int j = 2;
    final int k = 3;
    final int l = 1;
    final int m = 4;
    final int n = 5;
    final int o = 6;
    final int p = 7;
    final int q = 8;
    final int r = 9;
    final int s = 10;
    final int t = 11;
    int u[];
    int v;
}
__________________
Walter Bove
Diseñador Multimedial
Arteuz Comunicación Multimedial
Funk Blog Job