# Selsame Ladeprobleme bei Java Applet



## Neuer User (31. Jan 2006)

Guten morgen zusammen!
Ich hoffe Ihr könnt mir helfen:
Ich habe eine Websiteüberarbeitung vorgenommen. In dieser Site befindet sich ein Applet welches lokal und auch auf meinem Testserver lief.
Jetzt allerding auf dem Web-Server des Kunden -und offensichtlich nur da- gibt es merkwürdige Probleme.
Das Applet wirft zunächst eine offensichtlich nicht abgefangene Exception. Bei reload ist wieder alles beim alten und das Applet funzt wie es soll.
zum Vergleich: http://www.wimmer-rst.de/index.php

Vielleicht kann jajemand von euch pros auf einen Blick sagen woran es liegen könnte bzw. wie man es abstellen kann. 
Meine Kenntnisse sind leider schon ein wenig angerostet.

Grüße 
Christian


----------



## Neuer User (31. Jan 2006)

Falset helfen sollte... Quelltext der ersten Klasse:


```
import java.applet.Applet;
import java.awt.*;
import java.io.DataInputStream;
import java.io.FilterInputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;

public class RiadaHeadline extends RiadaJfc3
{

    protected boolean ActionExecute(char ac[], int ai[], String as[])
    {
        String as1[] = {
            ""
        };
        if(super.ActionExecute(ac, ai, as))
            return true;
        switch(TokenGetI(ac, ai, -1, true, as1))
        {
        case 50: // '2'
            if(!r0(r1(), ac, ai))
                return false;
            break;

        case 51: // '3'
            if(VariableGetI("random") > 0 && VariableGetI("random") < r27)
            {
                Random random = new Random(System.currentTimeMillis());
                for(int j = 0; j < r28.size(); j++)
                    ((Object[])r28.elementAt(j))[14] = "0";

                for(int k = 0; k < VariableGetI("random"); k++)
                {
                    int l = (int)Math.rint(random.nextDouble() * (double)(r28.size() - 1));
                    if(r0(l, 14) != 1)
                    {
                        ((Object[])r28.elementAt(l))[14] = "1";
                    } else
                    {
                        int i1 = l + 1;
                        do
                        {
                            if(i1 >= r28.size())
                                i1 = 0;
                            if(r0(i1, 14) != 1)
                            {
                                ((Object[])r28.elementAt(i1))[14] = "1";
                                break;
                            }
                            i1++;
                        } while(true);
                    }
                }

            } else
            {
                for(int i = 0; i < r28.size(); i++)
                    ((Object[])r28.elementAt(i))[14] = "1";

            }
            r2();
            break;

        default:
            return false;
        }
        return true;
    }

    protected void AdvertiseStop()
    {
        super.AdvertiseStop();
        r0(false, ((int []) (null)));
    }

    private void r0(Graphics g)
    {
        g.setColor(r0);
        g.fillRect(0, 0, super.projectSize.width, super.projectSize.height);
        if(r1 >= 0)
            r0(g, 0, 0, r1(r1), super.projectSize.width, super.projectSize.height, r4, r2, r3, majorVersion, r6, 0);
        r0(g, r12, r9, r8, r25, r24, r10, executing, r11, new Rectangle(0, 0, super.projectSize.width, super.projectSize.height));
    }

    public void BlockTest()
    {
        if(r64 != null)
        {
            int i = r41;
            int j = r38;
            r3();
            if(i != r41 || j != r38)
                r0(false, ((int []) (null)));
        }
    }

    private void r0(Graphics g, Color color, Color color1, Color color2, int i, Color color3, int j, 
            boolean flag, int k, Rectangle rectangle)
    {
        if(i > 0)
        {
            r0(g, color3, color3, color3, 0, Color.black, i, false, 2, rectangle);
            rectangle.grow(-i, -i);
        }
        switch(k)
        {
        case 1: // '\001'
            r0(g, color1, color1, color1, 0, Color.black, j, false, 2, rectangle);
            return;

        case 2: // '\002'
            int k1 = j + 1;
            for(int l = 0; l < j; l++)
            {
                if(flag)
                {
                    color = new Color(r0(color.getRGB(), color1.getRGB(), k1, false));
                    color2 = new Color(r0(color2.getRGB(), color1.getRGB(), k1, false));
                    k1--;
                }
                g.setColor(color);
                g.drawLine(rectangle.x + l, rectangle.y + l, (rectangle.x + rectangle.width) - l - 1, rectangle.y + l);
                g.drawLine(rectangle.x + l, rectangle.y + l, rectangle.x + l, (rectangle.y + rectangle.height) - l - 1);
                g.setColor(color2);
                g.drawLine(rectangle.x + l, (rectangle.y + rectangle.height) - l - 1, (rectangle.x + rectangle.width) - l - 1, (rectangle.y + rectangle.height) - l - 1);
                g.drawLine((rectangle.x + rectangle.width) - l - 1, rectangle.y + l, (rectangle.x + rectangle.width) - l - 1, (rectangle.y + rectangle.height) - l - 1);
            }

            return;

        case 3: // '\003'
            int i1 = j / 2;
            int l1 = j - i1;
            r0(g, color, color1, color2, 0, Color.black, i1, flag, 2, rectangle);
            rectangle.grow(-i1, -i1);
            r0(g, color2, color1, color, 0, Color.black, l1, flag, 2, rectangle);
            return;

        case 4: // '\004'
            int j1 = j / 3;
            int i2 = j1;
            int j2 = j % 3;
            j1 += j2 / 2;
            if(j2 % 2 != 0)
                i2++;
            r0(g, color, color1, color2, 0, Color.black, j1, flag, 2, rectangle);
            rectangle.grow(-j1, -j1);
            r0(g, color, color1, color2, 0, Color.black, i2, flag, 1, rectangle);
            rectangle.grow(-i2, -i2);
            r0(g, color2, color1, color, 0, Color.black, j1, flag, 2, rectangle);
            return;
        }
    }

    private synchronized void r0()
    {
        r14++;
        if(r23 != 0L && r23 >= r14)
        {
            r48 = true;
            r2();
            r14 = 0L;
        }
    }

    private int r0(int i, int j, int k, boolean flag)
    {
        int l = (i & 0xff0000) >> 16;
        int i1 = (i & 0xff00) >> 8;
        int j1 = i & 0xff;
        int k1 = (j & 0xff0000) >> 16;
        int l1 = (j & 0xff00) >> 8;
        int i2 = j & 0xff;
        int j2;
        int k2;
        int l2;
        if(flag)
        {
            double d = (double)k / 255D;
            j2 = (int)((double)Math.abs(k1 - l) * d);
            k2 = (int)((double)Math.abs(l1 - i1) * d);
            l2 = (int)((double)Math.abs(i2 - j1) * d);
        } else
        {
            j2 = Math.abs(k1 - l) / k;
            k2 = Math.abs(l1 - i1) / k;
            l2 = Math.abs(i2 - j1) / k;
        }
        k1 = k1 >= l ? l + j2 : l - j2;
        l1 = l1 >= i1 ? i1 + k2 : i1 - k2;
        i2 = i2 >= j1 ? j1 + l2 : j1 - l2;
        return 0xff000000 | k1 << 16 | l1 << 8 | i2;
    }

    private int r0(int i)
    {
        int j = r45[1];
        byte byte0 = -1;
        int l = r45[4];
        int i1 = l;
        if(i < 0 || i > super.projectSize.height && i < l)
            return -1;
        int k;
        for(; j <= r45[2]; j = k + 1)
        {
            int j1;
            for(j1 = j; j1 + 1 < r35.size(); j1++)
            {
                int k1 = j1 + 1;
                if(((Integer)((Object[])r35.elementAt(k1))[7]).intValue() == 1)
                    break;
            }

            k = j1;
            l += r5(j, k);
            if(i >= i1 && i <= l)
                return j;
        }

        return -1;
    }

    private Font r0(String s, int i, int j)
    {
        for(int k = 0; k < audio.size(); k++)
        {
            Font font = (Font)audio.elementAt(k);
            if(font.getSize() == j && font.getStyle() == i && font.getName() == s)
                return font;
        }

        Font font1 = new Font(s, i, j);
        audio.addElement(font1);
        return font1;
    }

    private void r1(Graphics g)
    {
        if(r19 >= 0)
            r0(g, 0, 0, r1(r19), super.projectSize.width, super.projectSize.height, r22, r20, r21, r17, r18, 0);
        if(r58 != null && r52 != null)
        {
            g.setColor(r51);
            g.fillPolygon(r58);
            g.fillPolygon(r52);
        }
    }

    public String getAppletInfo()
    {
        return "RiadaHeadline Copyright \251 1997-2000, Riada International Pty. Ltd. ([url]http://www.riada.com[/url])";
    }

    private int r1()
    {
        r28.addElement(((Object) (new Object[16])));
        for(int i = 0; i < 16; i++)
        {
            int j = r27;
            if(i <= 16)
                ((Object[])r28.elementAt(j))[i] = "0";
        }

        int k = r27;
        ((Object[])r28.elementAt(k))[2] = "";
        k = r27;
        ((Object[])r28.elementAt(k))[4] = "Arial";
        k = r27;
        ((Object[])r28.elementAt(k))[5] = "11";
        k = r27;
        ((Object[])r28.elementAt(k))[8] = "127";
        k = r27;
        ((Object[])r28.elementAt(k))[11] = "1";
        k = r27;
        ((Object[])r28.elementAt(k))[12] = "";
        k = r27;
        ((Object[])r28.elementAt(k))[13] = "";
        k = r27;
        ((Object[])r28.elementAt(k))[15] = "";
        k = r27;
        ((Object[])r28.elementAt(k))[14] = "1";
        return r27++;
    }

    private String r0(String s)
    {
        try
        {
            StringBuffer stringbuffer = new StringBuffer();
            URLConnection urlconnection = (new URL(getDocumentBase(), s)).openConnection();
            urlconnection.setUseCaches(false);
            DataInputStream datainputstream = new DataInputStream(Runtime.getRuntime().getLocalizedInputStream(urlconnection.getInputStream()));
            String s1;
            while((s1 = datainputstream.readLine()) != null) 
                stringbuffer.append(s1 + "\n");
            datainputstream.close();
            return stringbuffer.toString();
        }
        catch(Exception exception)
        {
            exception.printStackTrace();
        }
        Message("Problem reading file: '" + s + "'");
        return null;
    }

    private int r0(int i, int j)
    {
        try
        {
            return Integer.parseInt((String)((Object[])r28.elementAt(i))[j]);
        }
        catch(NumberFormatException _ex)
        {
            return 0;
        }
    }

    private Object r1(int i, int j)
    {
        return ((Object[])r28.elementAt(i))[j];
    }

    private String r2(int i, int j)
    {
        return (String)((Object[])r28.elementAt(i))[j];
    }

    private boolean r0(int i, char ac[], int ai[])
    {
        int j = 0;
        String as[] = {
            ""
        };
        while((j = TokenGetI(ac, ai, -1, true, as)) >= 0) 
        {
            TokenGetI(ac, ai, 0, true, as);
            String s = as[0];
            if(j > 16)
            {
                if(false)
                    continue;
            } else
            {
                ((Object[])r28.elementAt(i))[j] = s;
                if(true)
                    continue;
            }
            return false;
        }
        return true;
    }

    private void r0(int i, int j, int k)
    {
        String s = Integer.toString(k);
        if(j <= 16)
            ((Object[])r28.elementAt(i))[j] = s;
    }

    private boolean r0(int i, int j, Object obj)
    {
        if(j > 16)
        {
            return false;
        } else
        {
            ((Object[])r28.elementAt(i))[j] = obj;
            return true;
        }
    }

    private synchronized void r2()
    {
        r35 = new Vector(5, 5);
        int i = 0;
        int ai[] = {
            0
        };
        int ai1[] = {
            0
        };
        int ai2[] = {
            0
        };
        int ai3[] = {
            0
        };
        Date date = new Date();
        int j = date.getDay();
        r36 = VariableGetI("lineSpacing");
        r7 = VariableGetI("blockSpacing");
        r56 = VariableGetI("scrollRate");
        r34 = VariableGetI("linePause");
        r5 = VariableGetI("blockPause");
        r46 = VariableGetI("pagePause");
        r16 = Math.max(2, VariableGetI("fadeRate"));
        r61 = VariableGetI("typePause");
        oldScriptStart = VariableGetI("highlight") == 1;
        r29 = VariableGetI("highlightColor");
        r47 = Long.parseLong((String)VariableGet("refresh"));
        r23 = Long.parseLong((String)VariableGet("fileCycles"));
        r37 = VariableGetI("mode");
        r30 = VariableGetI("hMargin");
        r63 = VariableGetI("vMargin");
        r12 = new Color(VariableGetI("borderTopColor"));
        r9 = new Color(VariableGetI("borderMidColor"));
        r8 = new Color(VariableGetI("borderBotColor"));
        r25 = VariableGetI("frameSize");
        r24 = new Color(VariableGetI("frameColor"));
        r10 = VariableGetI("borderSize");
        executing = VariableGetI("borderSmooth") == 1;
        r11 = VariableGetI("borderStyle");
        r50 = VariableGetI("scrollButtons") == 1;
        r53 = VariableGetI("scrollDownX");
        r54 = VariableGetI("scrollDownY");
        r59 = VariableGetI("scrollUpX");
        r60 = VariableGetI("scrollUpY");
        r51 = new Color(VariableGetI("scrollColor"));
        r57 = VariableGetI("scrollSize");
        r0 = new Color(VariableGetI("bgColor"));
        r1 = VariableGetI("bgImage");
        r4 = VariableGetI("bgStyle");
        majorVersion = VariableGetI("bgAlignX");
        r6 = VariableGetI("bgAlignY");
        r2 = VariableGetI("bgOffsetX");
        r3 = VariableGetI("bgOffsetY");
        r19 = VariableGetI("fgImage");
        r22 = VariableGetI("fgStyle");
        r17 = VariableGetI("fgAlignX");
        r18 = VariableGetI("fgAlignY");
        r20 = VariableGetI("fgOffsetX");
        r21 = VariableGetI("fgOffsetY");
        r13 = new Rectangle(r30 + r10 + r25, r63 + r10 + r25, super.projectSize.width - (r30 + r10 + r25) * 2, super.projectSize.height - (r63 + r10 + r25) * 2);
        r58 = r52 = null;
        if(r50 && (r37 == 0 || r37 == 1 || r37 >= 6 && r37 <= 9))
        {
            int ai4[] = {
                0, r57 / 2, r57, 0
            };
            int ai5[] = {
                r57, 0, r57, r57
            };
            int ai6[] = {
                0, r57 / 2, r57, 0
            };
            int ai7[] = {
                0, r57, 0, 0
            };
            for(int j1 = 0; j1 < ai4.length; j1++)
            {
                ai4[j1] += r59;
                ai5[j1] += r60;
                ai6[j1] += r53;
                ai7[j1] += r54;
            }

            r58 = new Polygon(ai4, ai5, ai4.length);
            r52 = new Polygon(ai6, ai7, ai6.length);
        }
        for(int k = 0; k < r27; k++)
        {
            int l = r0(k, 0);
            if(r0(k, 14) == 1 && (r0(k, 8) & 1 << j) == 1 << j && ((String)((Object[])r28.elementAt(k))[9] == "0" || !date.after(new Date((String)((Object[])r28.elementAt(k))[9]))) && ((String)((Object[])r28.elementAt(k))[10] == "0" || !date.before(new Date((String)((Object[])r28.elementAt(k))[10]))))
label0:
                switch(l)
                {
                default:
                    break;

                case 0: // '\0'
                    String s = null;
                    if(r48 && ((String)((Object[])r28.elementAt(k))[15]).length() != 0)
                    {
                        if(r0(Expand((String)((Object[])r28.elementAt(k))[15])) == null)
                            break;
                        String s1 = r0(Expand((String)((Object[])r28.elementAt(k))[15]));
                        ((Object[])r28.elementAt(k))[2] = s1;
                    }
                    Object obj = null;
                    int k1 = 0;
                    boolean flag = true;
                    s = Expand((String)((Object[])r28.elementAt(k))[2]) + '\n';
                    do
                    {
                        int l1 = r0(s.toCharArray(), super.appletGraphics, r0((String)((Object[])r28.elementAt(k))[4], r0(k, 6), r0(k, 5)), k1, ai, ai1, ai3, ai2);
                        if(l1 == k1)
                            break label0;
                        Object aobj[] = r0(l, k, s.substring(k1, l1), ai1[0], ai[0], ai2[0], ai3[0], false);
                        if(flag)
                            aobj[7] = new Integer(r0(k, 11));
                        flag = false;
                        r35.addElement(((Object) (aobj)));
                        i += ai1[0];
                        char ac[] = s.toCharArray();
                        int i2;
                        for(i2 = l1; i2 < ac.length && (ac[i2] == ' ' || ac[i2] == '\t'); i2++);
                        l1 = i2;
                        k1 = l1;
                    } while(true);

                case 1: // '\001'
                    Image image = r1(r0(k, 3));
                    if(image != null)
                    {
                        int i1 = image.getHeight(this);
                        r35.addElement(((Object) (r0(l, k, new Integer(r0(k, 3)), i1, image.getWidth(this), 0, 0, r0(k, 11) == 1))));
                        i += i1;
                    }
                    break;

                case 2: // '\002'
                    r35.addElement(((Object) (r0(l, k, new Integer(0), 1, 0, 0, 0, r0(k, 11) == 1))));
                    i++;
                    break;
                }
        }

        r48 = false;
        r32 = System.currentTimeMillis();
    }

    private void r0(Graphics g, int i, int j, Image image, int k, int l, int i1, 
            int j1, int k1, int l1, int i2, int j2)
    {
        if(image == null)
            return;
        int k2 = image.getWidth(this);
        int l2 = image.getHeight(this);
        if(k2 == -1 || l2 == -1)
            return;
        switch(i1)
        {
        case 0: // '\0'
            g.drawImage(image, Align(k, k2, j1, l1, j2) + i, Align(l, l2, k1, i2, j2) + j, this);
            return;

        case 1: // '\001'
            for(int i3 = j2; i3 < k; i3 += k2)
            {
                for(int j3 = j2; j3 < l; j3 += l2)
                    g.drawImage(image, i3 + i, j3 + j, this);

            }

            return;

        case 2: // '\002'
            g.drawImage(image, i + j2, j + j2, k - j2 * 2 - 1, l - j2 * 2 - 1, this);
            return;
        }
    }

    private Image r1(int i)
    {
        Image image = (Image)r31.elementAt(i * 2);
        if(i >= 0 && i * 2 < r31.size() && image != null)
        {
            if((r49.statusID(i, true) & 4) != 0)
            {
                Message("Problem loading image '" + (String)r31.elementAt(i * 2 + 1) + "'");
                r31.setElementAt(null, i * 2);
                return null;
            } else
            {
                return image;
            }
        } else
        {
            return null;
        }
    }

    private void r1(String s)
    {
        Image image = null;
        for(int i = 0; i < r31.size(); i += 2)
            if(((String)r31.elementAt(i + 1)).equals(s))
                image = (Image)r31.elementAt(i);

        if(image == null)
        {
            image = getImage(getDocumentBase(), s);
            r49.addImage(image, r31.size() / 2);
            r49.statusID(r31.size() / 2, true);
        }
        r31.addElement(image);
        r31.addElement(s);
    }

    public boolean imageUpdate(Image image, int i, int j, int k, int l, int i1)
    {
        int j1 = -1;
        boolean flag = false;
        boolean flag1 = false;
        for(int k1 = 0; k1 < r31.size(); k1 += 2)
        {
            if((Image)r31.elementAt(k1) != image)
                continue;
            j1 = k1 / 2;
            break;
        }

        if((i & 0x40) != 0)
            return true;
        if((i & 0x30) != 0 && r64 != null && advertising)
        {
            l = image.getWidth(this);
            i1 = image.getHeight(this);
            if(j1 != -1 && (j1 == r1 || j1 == r19))
                flag = true;
            int l1 = 0;
            if(r35 != null)
            {
                for(int i2 = 0; i2 < r35.size(); i2++)
                {
                    if(((Integer)((Object[])r35.elementAt(i2))[0]).intValue() == 1 && ((Integer)((Object[])r35.elementAt(i2))[1]).intValue() == j1)
                    {
                        if(((Integer)((Object[])r35.elementAt(i2))[3]).intValue() == -1 || ((Integer)((Object[])r35.elementAt(i2))[2]).intValue() == -1)
                        {
                            ((Object[])r35.elementAt(i2))[3] = new Integer(l);
                            ((Object[])r35.elementAt(i2))[2] = new Integer(i1);
                            flag1 = flag = true;
                        }
                        if(r45[4] + l1 <= r13.height && r45[4] + l1 + i1 >= r13.y)
                            flag = true;
                    }
                    l1 += r5(i2, i2);
                }

            }
            if(flag1)
                r2();
            if(flag)
                r0(false, ((int []) (null)));
        }
        return (i & 0x20) == 0;
    }

    public void init()
    {
        r49 = new MediaTracker(this);
        super.init();
    }

    private int r0(char ac[], int i)
    {
        for(; i < ac.length && (ac[i] == ' ' || ac[i] == '\t'); i++);
        return i;
    }

    private int r0(char ac[], Graphics g, Font font, int i, int ai[], int ai1[], int ai2[], 
            int ai3[])
    {
        int j = -1;
        int k = 0;
        int l = i;
        int i1 = super.projectSize.width - 2 * (r30 + r10 + r25) - 2;
        char c = '\0';
        FontMetrics fontmetrics = g.getFontMetrics(font);
        ai[0] = ai3[0] = 0;
        ai2[0] = fontmetrics.getMaxAscent();
        ai1[0] = ai2[0] + fontmetrics.getMaxDescent() + fontmetrics.getLeading();
        int j1;
        for(j1 = l; j1 < ac.length && (ac[j1] == ' ' || ac[j1] == '\t'); j1++);
        for(l = j1; l < ac.length; l++)
        {
            char c1 = ac[l];
            if(c1 == '\n')
            {
                ai3[0] = 0;
                l++;
                break;
            }
            if(Character.isSpace(c1) && !Character.isSpace(c))
            {
                k = ai[0];
                j = l;
                ai3[0]++;
            }
            ai[0] += fontmetrics.charWidth(c1);
            if(ai[0] > i1)
            {
                if(j == -1)
                {
                    l--;
                } else
                {
                    l = j;
                    ai[0] = k;
                    if(ai3[0] > 0)
                        ai3[0]--;
                }
                break;
            }
            c = c1;
        }

        return l;
    }

    private Object[] r0(int i, int j, Object obj, int k, int l, int i1, int j1, 
            boolean flag)
    {
        Object aobj[] = new Object[8];
        aobj[0] = new Integer(i);
        aobj[4] = new Integer(j);
        aobj[1] = obj;
        aobj[2] = new Integer(k);
        aobj[3] = new Integer(l);
        aobj[5] = new Integer(i1);
        aobj[6] = new Integer(j1);
        aobj[7] = new Integer(flag ? 1 : 0);
        return aobj;
    }

    private int r0(Graphics g, int i, int j, int k, boolean flag, boolean flag1, int l, 
            int ai[])
    {
        int i1 = ((Integer)((Object[])r35.elementAt(i))[2]).intValue();
        if(k + i1 < r13.y || k > r13.y + r13.height)
            return i1;
        int j1 = ((Integer)((Object[])r35.elementAt(i))[3]).intValue();
        int k1 = ((Integer)((Object[])r35.elementAt(i))[5]).intValue();
        int l1 = ((Integer)((Object[])r35.elementAt(i))[6]).intValue();
        int i2 = ((Integer)((Object[])r35.elementAt(i))[4]).intValue();
        int j2 = r0(i2, 1);
        int k2 = r0(i2, 7);
        if(i >= r41 && i <= r38 && oldScriptStart)
            k2 = r29;
        else
            k2 = flag1 ? r0(r0.getRGB(), k2, l, true) : k2;
        switch(((Integer)((Object[])r35.elementAt(i))[0]).intValue())
        {
        case 0: // '\0'
            String s = (String)((Object[])r35.elementAt(i))[1];
            g.setColor(new Color(k2));
            int l2 = s.length();
            if(flag)
            {
                if(ai[5] != i)
                {
                    ai[6] = 0;
                    ai[5] = i;
                }
                ai[6]++;
                if(ai[6] >= l2)
                {
                    ai[5] = -1;
                    ai[6] = l2;
                } else
                {
                    ai[7] = 0;
                    Script("OnType", true);
                }
                l2 = ai[6];
            }
            r0(g, r0((String)((Object[])r28.elementAt(i2))[4], r0(i2, 6), r0(i2, 5)), k, s.toCharArray(), 
j1, i1, l1, j2, k1, l2);
            break;

        case 1: // '\001'
            if(j1 == -1 || i1 == -1)
                return 0;
            r0(g, r13.x, k, r1(((Integer)((Object[])r35.elementAt(i))[1]).intValue()), r13.width, i1, 0, 0, 0,
 j2 != 3 ? j2 : 1, 0, 0);
            break;

        default:
            g.setColor(new Color(k2));
            g.drawLine(r13.x, k, r13.x + r13.width, k);
            break;
        }
        return i1;
    }

    private void r0(Graphics g, Font font, int i, char ac[], int j, int k, int l, 
            int i1, int j1, int k1)
    {
        int l1 = r30 + r10 + r25;
        int i2 = 0;
        int j2 = super.projectSize.width - 2 * l1 - 2 - j;
        boolean flag = false;
        char c = '\0';
        boolean flag1 = false;
        if(!g.getFont().equals(font))
            g.setFont(font);
        i += l;
        for(; k1 > 0 && Character.isSpace(ac[k1 - 1]); k1--);
        switch(i1)
        {
        default:
            break;

        case 1: // '\001'
            l1 += j2 / 2;
            break;

        case 2: // '\002'
            l1 += j2;
            break;

        case 3: // '\003'
            FontMetrics fontmetrics = g.getFontMetrics(font);
            int k2;
            int l2;
            if(j1 == 0 || ac[k1 - 1] == '\n')
            {
                k2 = 0;
                l2 = 0;
            } else
            {
                k2 = j2 / Math.max(j1, 1);
                l2 = j2 % Math.max(j1, 1);
            }
            for(int i3 = 0; i3 < k1; i3++)
            {
                if(Character.isSpace(ac[i3]) && !Character.isSpace(c))
                {
                    g.drawChars(ac, i2, i3 - i2, l1, i);
                    l1 += fontmetrics.stringWidth(String.copyValueOf(ac, i2, i3 - i2)) + k2;
                    if(l2 > 0)
                    {
                        l1++;
                        l2--;
                    }
                    i2 = i3;
                }
                c = ac[i3];
            }

            break;
        }
        g.drawChars(ac, i2, k1 - i2, l1, i);
    }

    private Object[] r2(int i)
    {
        return (Object[])r35.elementAt(i);
    }

    private int r3(int i, int j)
    {
        return ((Integer)((Object[])r35.elementAt(i))[j]).intValue();
    }

    private synchronized void r3()
    {
        if(r43 < 0 || r43 > super.projectSize.height || r42 < 0 || r42 > super.projectSize.width || r4(r42, r43) != 0)
            break MISSING_BLOCK_LABEL_141;
        r41 = r0(r43);
        this;
        if(r41 == -1) goto _L2; else goto _L1
_L1:
        int i;
        for(i = r41; i + 1 < r35.size(); i++)
        {
            int k = i + 1;
            if(((Integer)((Object[])r35.elementAt(k))[7]).intValue() == 1)
                break;
        }

        i;
          goto _L3
_L2:
        -1;
_L3:
        r38;
        break MISSING_BLOCK_LABEL_151;
        r41 = r38 = -1;
        if(r41 != r44)
            if(r41 == -1)
            {
                showStatus("");
            } else
            {
                int j = r41;
                j = ((Integer)((Object[])r35.elementAt(j))[4]).intValue();
                String s = (String)((Object[])r28.elementAt(j))[13];
                int l = r41;
                l = ((Integer)((Object[])r35.elementAt(l))[4]).intValue();
                String s1 = (String)((Object[])r28.elementAt(l))[12];
                if(s.length() > 0 || s1.length() > 0)
                    Script(s, false);
                else
                    r41 = r38 = -1;
            }
        r44 = r41;
        return;
    }

    public boolean mouseDown(Event event, int i, int j)
    {
        if(r64 != null && MouseEvent(event, i, j, 501, "OnMouseDown"))
        {
            registered = true;
            r42 = r39 = i;
            r43 = r40 = j;
        }
        return true;
    }

    public boolean mouseDrag(Event event, int i, int j)
    {
        if(r64 != null && MouseEvent(event, i, j, 506, "OnMouseDrag"))
        {
            r45[4] += j - r40;
            r0(false, ((int []) (null)));
            r40 = r43 = j;
            r42 = i;
        }
        return true;
    }

    public boolean mouseEnter(Event event, int i, int j)
    {
        if(r64 != null && MouseEvent(event, i, j, 504, "OnMouseEnter"))
        {
            r43 = j;
            r42 = i;
            BlockTest();
        }
        return true;
    }

    public boolean mouseExit(Event event, int i, int j)
    {
        if(r64 != null && MouseEvent(event, i, j, 505, "OnMouseExit"))
        {
            r42 = -1;
            r43 = -1;
            BlockTest();
        }
        return true;
    }

    public boolean mouseMove(Event event, int i, int j)
    {
        if(r64 != null && MouseEvent(event, i, j, 503, "OnMouseMove"))
        {
            r43 = j;
            r42 = i;
            BlockTest();
        }
        return true;
    }

    public boolean mouseUp(Event event, int i, int j)
    {
        if(r64 != null && MouseEvent(event, i, j, 502, "OnMouseUp"))
        {
            int k = r4(i, j);
            registered = false;
            r43 = j;
            r42 = i;
            if(k != 0)
            {
                int ai[] = {
                    0, 0, 0, 0, 0, 0, 0, 0
                };
                System.arraycopy(r45, 0, ai, 0, r45.length);
                r55 += k;
                ai[4] += k;
                r0(false, ai);
                return true;
            }
            if(Math.abs(r39 - i) <= 2 && Math.abs(r40 - j) <= 2)
            {
                r3();
                int l;
                if(r41 != -1)
                    Script((String)((Object[])r28.elementAt(l = ((Integer)((Object[])r35.elementAt(l = r41))[4]).intValue()))[12], false);
            }
        }
        return true;
    }

    private int r3(int i)
    {
        for(; i + 1 < r35.size(); i++)
        {
            int j = i + 1;
            if(((Integer)((Object[])r35.elementAt(j))[7]).intValue() == 1)
                break;
        }

        return i;
    }

    private synchronized long r0(boolean flag, int ai[])
    {
        if(!advertising)
            return 0L;
        long l = 0L;
        if(ai == null)
        {
            ai = new int[r45.length];
            System.arraycopy(r45, 0, ai, 0, r45.length);
        }
        Graphics g = super.appletImage.getGraphics();
        r0(g);
        g.clipRect(r13.x, r13.y, r13.width, r13.height);
        r3();
        switch(r37)
        {
        case 0: // '\0'
        case 1: // '\001'
        case 6: // '\006'
        case 7: // '\007'
        case 8: // '\b'
        case 9: // '\t'
            if(flag && (ai[0] == 0x7fffffff || ai[4] > r13.y + r13.height))
                ai[4] = r13.y + r13.height;
            ai[2] = r35.size() - 1;
            l = r2(g, flag, ai);
            break;

        case 3: // '\003'
        case 5: // '\005'
            ai[4] = r13.y;
            l = r1(g, flag, ai);
            break;

        case 2: // '\002'
        case 4: // '\004'
        default:
            ai[4] = r13.y;
            l = r0(g, flag, ai);
            break;
        }
        r1(g);
        g.dispose();
        if(!super.advertising)
        {
            synchronized(super.offGraphics)
            {
                super.offGraphics.drawImage(super.appletImage, 0, 0, null);
            }
            repaint();
        }
        return l;
    }

    private int r0(Graphics g, boolean flag, int ai[])
    {
        int i = 0;
        int j = r13.y;
        long l1 = System.currentTimeMillis();
        if(flag)
        {
            if(ai[0] < 0)
                r15 = l1 + (long)r16;
            long l2 = Math.max(0L, r15 - l1);
            double d = (double)r16 / (double)Math.max(1L, (long)r16 - l2);
            long l3 = (long)(255D / d);
            i += 12 / (256 - ai[0]);
            ai[0] = (int)l3;
        }
        int i1;
        for(i1 = ai[1]; i1 + 1 < r35.size(); i1++)
        {
            int j1 = i1 + 1;
            if(((Integer)((Object[])r35.elementAt(j1))[7]).intValue() == 1)
                break;
        }

        int k;
        i1 = k = i1;
        int k1;
        for(k1 = ai[3]; k1 + 1 < r35.size(); k1++)
        {
            int k2 = k1 + 1;
            if(((Integer)((Object[])r35.elementAt(k2))[7]).intValue() == 1)
                break;
        }

        int l = k1;
        if(r37 != 4)
        {
            int i2;
            for(; i1 < r35.size(); i1 = i2)
            {
                if(r5(ai[1], i1) > r13.y + r13.height)
                    break;
                k = i1;
                for(i2 = i1 + 1; i2 + 1 < r35.size(); i2++)
                {
                    int i3 = i2 + 1;
                    if(((Integer)((Object[])r35.elementAt(i3))[7]).intValue() == 1)
                        break;
                }

            }

        }
        if(flag)
            ai[2] = l;
        i1 = k;
        for(int j2 = ai[1]; j2 <= l; j2++)
        {
            j += r36 + r0(g, j2, 0, j, false, j2 >= ai[3] && j2 <= l, ai[0], ai);
            if(j2 + 1 < r35.size())
            {
                int j3 = j2 + 1;
                if(((Integer)((Object[])r35.elementAt(j3))[7]).intValue() == 1)
                    j += r7;
            }
        }

        if(flag && ai[0] >= 255)
        {
            ai[3] = l + 1;
            i += r5;
            if(ai[3] > i1)
            {
                i += r46;
                ai[3] = ai[1] = i1 + 1;
            }
            if(ai[1] >= r35.size())
            {
                r0();
                ai[3] = ai[1] = 0;
            }
            ai[0] = -1;
            i += r5;
        }
        return i;
    }

    private int r1(Graphics g, boolean flag, int ai[])
    {
        int i = 0;
        int j = r13.y;
        if(flag)
            ai[7] = 1;
        int l;
        for(l = ai[1]; l + 1 < r35.size(); l++)
        {
            int i1 = l + 1;
            if(((Integer)((Object[])r35.elementAt(i1))[7]).intValue() == 1)
                break;
        }

        int k;
        l = k = l;
        int j1;
        for(j1 = ai[3]; j1 + 1 < r35.size(); j1++)
        {
            int k1 = j1 + 1;
            if(((Integer)((Object[])r35.elementAt(k1))[7]).intValue() == 1)
                break;
        }

        j1 = j1;
        if(r37 != 5)
        {
            int l1;
            for(; l < r35.size(); l = l1)
            {
                if(r5(ai[1], l) > r13.y + r13.height)
                    break;
                k = l;
                for(l1 = l + 1; l1 + 1 < r35.size(); l1++)
                {
                    int j2 = l1 + 1;
                    if(((Integer)((Object[])r35.elementAt(j2))[7]).intValue() == 1)
                        break;
                }

            }

        }
        ai[2] = l;
        l = k;
        for(int i2 = ai[1]; i2 <= ai[3]; i2++)
        {
            j += r36 + r0(g, i2, 0, j, i2 == ai[3] && flag, false, 0, ai);
            if(i2 + 1 < r35.size())
            {
                int k2 = i2 + 1;
                if(((Integer)((Object[])r35.elementAt(k2))[7]).intValue() == 1)
                    j += r7;
            }
        }

        if(ai[7] != 0 && flag)
        {
            if(ai[3]++ == j1)
                i += r5;
            i += r34;
            if(ai[3] > l)
            {
                i += r46;
                ai[3] = ai[1] = l + 1;
            }
            if(ai[1] >= r35.size())
            {
                r0();
                ai[3] = ai[1] = 0;
            }
            int l2;
            for(l2 = ai[1]; l2 + 1 < r35.size(); l2++)
            {
                int i3 = l2 + 1;
                if(((Integer)((Object[])r35.elementAt(i3))[7]).intValue() == 1)
                    break;
            }

            ai[2] = l2;
        } else
        {
            i += r61;
        }
        return i;
    }

    public void paint(Graphics g)
    {
        if(super.offImage != null && super.offGraphics != null)
        {
            synchronized(super.offGraphics)
            {
                g.drawImage(super.offImage, 0, 0, null);
            }
            return;
        } else
        {
            return;
        }
    }

    protected synchronized String Read(String s, boolean flag, boolean flag1)
    {
        r48 = true;
        return super.Read(s, flag, flag1);
    }

    protected boolean ReadParams(boolean flag)
    {
        if(flag)
            ScriptInit();
        for(StringTokenizer stringtokenizer = new StringTokenizer(Expand(ParamGet("Images")), "|"); stringtokenizer.hasMoreTokens(); r1(stringtokenizer.nextToken()));
        return true;
    }

    public RiadaHeadline()
    {
        audio = new Vector(1, 1);
        r48 = false;
        advertising = false;
        registered = false;
        r43 = -1;
        r42 = -1;
        r41 = -1;
        r38 = -1;
        r44 = -2;
        docBase = "refresh,0,lineSpacing,0,blockSpacing,20,scrollRate,20,linePause,250,blockPause,1000,pagePause,2000,"+
"fadeRate,1000,typePause,100,fileCycles,0,mode,0,highlight,1,highlightColor,16777215,random,0,hMargin,5,"+
"vMargin,0,borderTopColor,15792112,borderMidColor,8961416,borderBotColor,0,frameSize,0,frameColor,0,"+
"borderSize,5,borderSmooth,1,borderStyle,2,scrollButtons,0,scrollDownX,0,scrollDownY,0,scrollUpX,0,scrollUpY,"+
"0,scrollColor,65280,scrollSize,10,bgColor,8961416,bgImage,-1,bgStyle,0,bgAlignX,1,bgAlignY,1,bgOffsetX,0,"+
"bgOffsetY,0,fgImage,-1,fgStyle,0,fgAlignX,1,fgAlignY,1,fgOffsetX,0,fgOffsetY,0";
        super.requiredLibrary = "1.03";
        super.productName = "RiadaHeadline";
        super.productCode = "005";
        super.oldScriptStart = false;
    }

    public void run()
    {
        long l = 0L;
        super.run();
        if(Thread.currentThread() == r64)
        {
            ScriptStart();
            advertising = true;
            r45[4] = 0x7fffffff;
            r45[0] = -1;
            int ai[] = {
                0, 0, 0, 0, 0, 0, 0, 0
            };
            while(r64 == Thread.currentThread()) 
            {
                long l1 = System.currentTimeMillis();
                System.arraycopy(r45, 0, ai, 0, r45.length);
                long l3 = r0(!registered, ai);
                if(!registered)
                {
                    Pause(Math.max(0L, l3 - (System.currentTimeMillis() - l1)));
                    System.arraycopy(ai, 0, r45, 0, r45.length);
                }
                r45[4] += r55;
                r55 = 0;
            }
        }
        if(Thread.currentThread() == r62)
            while(r62 == Thread.currentThread()) 
            {
                long l2 = System.currentTimeMillis();
                if(advertising && r47 > 0L)
                {
                    r2();
                    r0(!registered, ((int []) (null)));
                    Pause(Math.max(0L, r47 - (System.currentTimeMillis() - l2)));
                } else
                {
                    Pause(1000L);
                }
            }
    }

    protected void ScriptInit()
    {
        super.ScriptInit();
        ReadTokens(docBase);
        r28 = new Vector(5, 5);
        r31 = new Vector(0, 2);
        r27 = 0;
        Script("OnInitialize", true);
        Script("OnStart", true);
    }

    private int r4(int i, int j)
    {
        if(r58 != null && r52 != null)
        {
            if(r58.inside(i, j))
                return -10;
            if(r52.inside(i, j))
                return 10;
        }
        return 0;
    }

    private int r2(Graphics g, boolean flag, int ai[])
    {
        int i = 0;
        int k = r56;
        int l = 0;
        boolean flag2 = r37 >= 6 && r37 <= 9;
        ai[7] = 1;
        for(int i1 = 0; i1 < r35.size(); i1++)
        {
            int j = ((Integer)((Object[])r35.elementAt(i1))[2]).intValue();
            boolean flag1 = (r37 == 1 || r37 == 8 || r37 == 9) && j + i + ai[4] == r13.y + r13.height;
            if((r37 == 1 || r37 == 8 || r37 == 9) && j + i + ai[4] > r13.y + r13.height)
            {
                i += j;
            } else
            {
                if(flag2)
                {
                    l = (int)(255D / Math.max(1.0D, (double)r13.height / Math.max(1.0D, r13.height - (ai[4] + i))));
                    if(r37 == 6 || r37 == 8)
                        l = 255 - l;
                }
                i += r0(g, i1, 0, ai[4] + i, flag1, flag2, l, ai);
            }
            if(i1 + 1 < r35.size())
            {
                int j1 = i1 + 1;
                if(((Integer)((Object[])r35.elementAt(j1))[7]).intValue() == 1)
                {
                    i += r7;
                    if(ai[7] != 0 && i + ai[4] == r13.y + r13.height)
                        k += r5;
                }
            }
            if(ai[7] != 0 && i + ai[4] == r13.y + r13.height)
                k += r34;
            i += r36;
        }

        k += ai[7] == 0 ? r61 : r56;
        if(ai[7] != 0 && ai[4] + i == r13.y + r13.height)
            k += r46;
        if(ai[7] != 0 && flag && --ai[4] + i < r13.y)
        {
            r0();
            ai[4] = r13.y + r13.height;
        }
        return k;
    }

    public void start()
    {
        super.start();
        if(r64 == null)
        {
            r64 = new Thread(this);
            r64.start();
        }
        if(r62 == null)
        {
            r62 = new Thread(this);
            r62.start();
        }
    }

    public void stop()
    {
        Script("OnStop", true);
        super.stop();
        r64 = null;
        r62 = null;
        System.gc();
    }

    private int r5(int i, int j)
    {
        int k = 0;
        if(i < r35.size())
            for(; i <= j; i++)
            {
                if(((Integer)((Object[])r35.elementAt(i))[2]).intValue() != -1)
                    k += ((Integer)((Object[])r35.elementAt(i))[2]).intValue();
                if(i + 1 < r35.size())
                {
                    int l = i + 1;
                    if(((Integer)((Object[])r35.elementAt(l))[7]).intValue() == 1)
                        k += r7;
                }
                k += r36;
            }

        return k;
    }

    public final void update(Graphics g)
    {
        paint(g);
    }

    private boolean advertising;
    private int majorVersion;
    private int r6;
    private Color r0;
    private int r1;
    private int r2;
    private int r3;
    private int r4;
    private int r5;
    private int r7;
    private Color r8;
    private Color r9;
    private int r10;
    private boolean executing;
    private int r11;
    private Color r12;
    private Rectangle r13;
    private long r14;
    private long r15;
    private int r16;
    private int r17;
    private int r18;
    private int r19;
    private int r20;
    private int r21;
    private int r22;
    private long r23;
    private Vector audio;
    private Color r24;
    private int r25;
    private static final int r26 = 16;
    private int r27;
    private Vector r28;
    private boolean oldScriptStart;
    private int r29;
    private int r30;
    private Vector r31;
    private long r32;
    private static final int r33 = 8;
    private int r34;
    private Vector r35;
    private int r36;
    private int r37;
    private boolean registered;
    private int r38;
    private int r39;
    private int r40;
    private int r41;
    private int r42;
    private int r43;
    private int r44;
    private int r45[] = {
        -1, 0, 0, 0, 0x7fffffff, -1, -1, 0
    };
    private int r46;
    private long r47;
    private boolean r48;
    private MediaTracker r49;
    private boolean r50;
    private Color r51;
    private Polygon r52;
    private int r53;
    private int r54;
    private int r55;
    private int r56;
    private int r57;
    private Polygon r58;
    private int r59;
    private int r60;
    private String docBase;
    private int r61;
    private Thread r62;
    private int r63;
    private Thread r64;
}
```


----------



## Guest (31. Jan 2006)

un noch die 2te...


```
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 31.01.2006 10:31:07
// Home Page : [url]http://members.fortunecity.com/neshkov/dj.html[/url]  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   RiadaJfc3.java

import java.applet.*;
import java.awt.*;
import java.io.InputStream;
import java.io.PrintStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;

public abstract class RiadaJfc3 extends Applet
    implements Runnable
{

    protected boolean ActionExecute(char ac[], int ai[], String as[])
    {
        int i = ai[0];
        String as1[] = {
            ""
        };
label0:
        switch(TokenGetI(ac, ai, -1, true, as1))
        {
        case -2: 
            break;

        case 1: // '\001'
            JumpUrl(true, TokenGetS(ac, ai, "", true), TokenGetS(ac, ai, "_self", true));
            break;

        case 2: // '\002'
            int j = TokenGetI(ac, ai, 0, true, as1);
            r8[j] = TokenGetI(ac, ai, 0, true, as1);
            if(executing && r9 != null)
                (r9[j] = new Thread(this)).start();
            break;

        case 3: // '\003'
            as[0] = Script(TokenGetS(ac, ai, "", true), true);
            break;

        case 4: // '\004'
            int j1 = TokenGetI(ac, ai, 0, true, as1);
            int k;
            if((k = TokenGetI(ac, ai, -1, true, as1)) == -1)
                k = AudioLoad(as1[0]);
            switch(j1)
            {
            case 0: // '\0'
                ((AudioClip)audio.elementAt(k * 2)).play();
                break;

            case 1: // '\001'
                ((AudioClip)audio.elementAt(k * 2)).loop();
                break;

            case 2: // '\002'
                ((AudioClip)audio.elementAt(k * 2)).stop();
                break;
            }
            break;

        case 5: // '\005'
            if(TokenGetI(ac, ai, 0, true, as1) == 0)
                showStatus(Expand(TokenGetS(ac, ai, "", true)));
            else
                System.out.println(Expand(TokenGetS(ac, ai, "", true)));
            break;

        case 6: // '\006'
            CursorSet(TokenGetI(ac, ai, 0, true, as1));
            break;

        case 7: // '\007'
            String s = TokenGetS(ac, ai, "error", false);
            TokenGetI(ac, ai, 0, true, as1);
            VariableSet(s, as1[0]);
            break;

        case 8: // '\b'
            if(TokenGetI(ac, ai, 0, true, as1) != 0)
                break;
            String s1 = TokenGetS(ac, ai, "", true);
            for(Enumeration enumeration = getAppletContext().getApplets(); enumeration.hasMoreElements();)
            {
                Applet applet = (Applet)enumeration.nextElement();
                if(applet != null && (applet instanceof RiadaJfc3) && applet.getParameter("name").equals(s1))
                {
                    as[0] = ((RiadaJfc3)applet).Script(TokenGetS(ac, ai, "", true), false);
                    break label0;
                }
            }

            break;

        case 9: // '\t'
            Read(TokenGetS(ac, ai, "error", true), TokenGetI(ac, ai, 0, true, as1) != 0, true);
            break;

        case 10: // '\n'
            Pause(TokenGetI(ac, ai, 0, true, as1));
            break;

        case 11: // '\013'
            int l = TokenGetI(ac, ai, 0, true, as1);
            int k1 = TokenGetI(ac, ai, 0, true, as1);
            as[0] = Integer.toString(l + k1);
            break;

        case 12: // '\f'
            int i1 = TokenGetI(ac, ai, 0, true, as1);
            int l1 = TokenGetI(ac, ai, 0, true, as1);
            as[0] = Integer.toString(i1 - l1);
            break;

        case 13: // '\r'
            as[0] = VariableFormat(TokenGetS(ac, ai, "", true));
            break;

        case -1: 
        case 0: // '\0'
        default:
            ai[0] = i;
            return false;
        }
        return true;
    }

    protected void AdvertiseStart()
    {
        advertising = true;
        r6 = CursorSet(12);
    }

    protected void AdvertiseStop()
    {
        CursorSet(r6);
        advertising = false;
    }

    protected int Align(int i, int j, int k, int l, int i1)
    {
        if(l == 1)
            return (k + i / 2) - j / 2;
        if(l == 2)
            return (k + i) - i1 - j;
        else
            return k + i1;
    }

    protected int AudioLoad(String s)
    {
        for(int i = 0; i < audio.size(); i += 2)
            if(((String)audio.elementAt(i + 1)).equals(s))
                return i / 2;

        audio.addElement(getAudioClip(getDocumentBase(), s));
        audio.addElement(s);
        return audio.size() / 2 - 1;
    }

    protected int CursorSet(int i)
    {
        int j = 0;
        java.awt.Container container = getParent();
        if(container instanceof Frame)
        {
            j = ((Frame)container).getCursorType();
            ((Frame)container).setCursor(i);
        }
        return j;
    }

    protected String Expand(String s)
    {
        if(s == null)
            return null;
        StringBuffer stringbuffer = new StringBuffer();
        for(int k = 0; k < s.length(); k++)
        {
            char c = s.charAt(k);
            int i;
            int j;
            if(k + 1 < s.length())
                if(c == '\\' && s.charAt(k + 1) == 'x' && k + 4 <= s.length())
                    try
                    {
                        c = (char)Integer.parseInt(s.substring(k + 2, k + 4), 16);
                        k += 3;
                    }
                    catch(NumberFormatException _ex)
                    {
                        continue;
                    }
                else
                if(c == '\\' && (j = "btnfr\"'\\{}\b\t\n\f\r\"'\\{}".indexOf(s.charAt(k + 1))) != -1)
                {
                    c = "btnfr\"'\\{}\b\t\n\f\r\"'\\{}".charAt(j + "btnfr\"'\\{}\b\t\n\f\r\"'\\{}".length() / 2);
                    k++;
                } else
                if(c == '$' && s.charAt(k + 1) == '{' && (i = s.indexOf('}', ++k)) != -1 && i != k)
                {
                    stringbuffer.append(VariableFormat(s.substring(k + 1, i)));
                    k = i;
                    continue;
                }
            stringbuffer.append(c);
        }

        return stringbuffer.toString();
    }

    public void init()
    {
        projectSize = size();
        offImage = createImage(projectSize.width, projectSize.height);
        offGraphics = offImage.getGraphics();
        setBackground(ParamGet("InitBackColor", Color.black));
        show();
        offGraphics.clearRect(0, 0, projectSize.width, projectSize.height);
        offGraphics.setColor(ParamGet("InitTextColor", Color.white));
        offGraphics.drawString(ParamGet("InitMessage", "Loading...", false), ParamGet("InitX", 10, 10), ParamGet("InitY", 20, 10));
        repaint();
        appletImage = createImage(projectSize.width, projectSize.height);
        appletGraphics = appletImage.getGraphics();
        serialNumber = getParameter("SerialNumber");
        docBase = getDocumentBase().getHost();
        r3 = getParameter("Copyright");
        variables = new Hashtable();
        if(requiredLibrary.compareTo("1.03") > 0)
        {
            throw new RuntimeException(Message("Requires RiadaJfc3, version " + requiredLibrary + " or greater!"));
        } else
        {
            ScriptInit();
            return;
        }
    }

    protected void JumpUrl(boolean flag, String s, String s1)
    {
        try
        {
            getAppletContext().showDocument(new URL(flag ? getDocumentBase() : null, s), s1);
            return;
        }
        catch(Exception _ex)
        {
            return;
        }
    }

    public boolean keyDown(Event event, int i)
    {
        if(executing && !advertising)
        {
            VariableSet("keyDown", String.valueOf(i));
            Script("OnKeyDown", true);
        }
        return true;
    }

    protected String Message(String s)
    {
        String s1 = productName + ": " + s + ": " + (new Date()).toString();
        System.out.println(s1);
        return s1;
    }

    protected boolean MouseEvent(Event event, int i, int j, int k, String s)
    {
        if(advertising)
        {
            String s1 = docBase;
            if(s1 == null || s1.length() <= 0)
                s1 = "(Local)";
            if(event.id == 502)
                JumpUrl(true, "http://www.riada.com/cgi-bin/main.cgi?prod=" + productCode + "&serialNumber=" + serialNumber + "&baseURL=" + s1, "_blank");
            return false;
        }
        VariableSet("mouseX", Integer.toString(i));
        VariableSet("mouseY", Integer.toString(j));
        Script(s, true);
        if(event.id == 501 && event.clickCount == 2)
            Script("OnMouseDblClick", true);
        return true;
    }

    protected boolean ParamCheck(String s)
    {
        return (paramProperties == null ? getParameter(s) : paramProperties.getProperty(s)) != null;
    }

    protected Color ParamGet(String s, Color color)
    {
        return new Color(ParamGet(s, color.getRGB(), 16));
    }

    protected String ParamGet(String s)
    {
        String s1 = "";
        for(int i = 0; ParamCheck(s + i); i++)
            s1 = s1 + ParamGet(s + i, "", false);

        return s1;
    }

    protected int ParamGet(String s, int i, int j)
    {
        try
        {
            return Integer.parseInt(ParamGet(s, Integer.toString(i, j), false).trim(), j);
        }
        catch(Exception _ex)
        {
            return i;
        }
    }

    protected String ParamGet(String s, String s1, boolean flag)
    {
        String s2 = paramProperties == null ? getParameter(s) : paramProperties.getProperty(s);
        if(s2 != null)
        {
            s1 = s2;
            if(flag)
                s1 = Expand(s1);
        }
        if(s1.length() > 0 && s1.charAt(0) == '+' && s1.charAt(s1.length() - 1) == '+')
            s1 = s1.substring(1, s1.length() - 1);
        return s1;
    }

    protected void Pause(long l)
    {
        try
        {
            Thread.sleep(l);
            return;
        }
        catch(InterruptedException _ex)
        {
            return;
        }
    }

    protected synchronized String Read(String s, boolean flag, boolean flag1)
    {
        String s1 = "";
        try
        {
            InputStream inputstream = null;
            s = Expand(s);
            if(s != null)
            {
                URLConnection urlconnection = (new URL(getDocumentBase(), s)).openConnection();
                urlconnection.setUseCaches(false);
                inputstream = Runtime.getRuntime().getLocalizedInputStream(urlconnection.getInputStream());
                paramProperties = new Properties();
                paramProperties.load(inputstream);
            }
            if(!ReadParams(flag))
                return "";
            if(flag)
            {
                if(oldScriptStart)
                    ReadTokens(r10);
                ReadTokens(ParamGet("Tokens"));
                r9 = new Thread[10];
                r8 = new int[10];
                audio = new Vector();
            }
            for(StringTokenizer stringtokenizer = new StringTokenizer(Expand(ParamGet("Audio")), r4); stringtokenizer.hasMoreTokens(); AudioLoad(stringtokenizer.nextToken()));
            s1 = ParamGet("Script");
            if(inputstream != null)
            {
                paramProperties = null;
                inputstream.close();
                showStatus("");
            }
        }
        catch(Exception _ex)
        {
            Message("Problem reading parameters");
            return "";
        }
        if(flag1)
            s1 = Script(s1, false);
        return s1;
    }

    protected abstract boolean ReadParams(boolean flag);

    protected void ReadTokens(String s)
    {
        for(StringTokenizer stringtokenizer = new StringTokenizer(s, r4); stringtokenizer.hasMoreTokens(); VariableSet(stringtokenizer.nextToken(), stringtokenizer.nextToken()));
    }

    protected boolean Register()
    {
        String s = getParameter("Reg");
        String s1 = getParameter("RegDebug");
        if((s1 == null || !s1.equals("1")) && (docBase == null || docBase.length() <= 0 || docBase.indexOf("riada") != -1))
            return true;
        if(r3 == null || serialNumber == null || s == null)
            return false;
        if(!serialNumber.startsWith(productCode))
        {
            Message("Invalid serial number");
            return false;
        }
        char ac[] = (productCode + (char)(majorVersion + 48) + serialNumber + r3).toUpperCase().toCharArray();
        int i = 0x384a7;
        for(int j = 0; j < ac.length; j++)
            i ^= ac[j] << j % 8;

        return Integer.toString(i).equals(s);
    }

    public RiadaJfc3()
    {
        r10 = "Day0,Sunday,Day1,Monday,Day2,Tuesday,Day3,Wednesday,Day4,Thursday,Day5,Friday,Day6,Saturday,Month0,"+
"January,Month1,February,Month2,March,Month3,April,Month4,May,Month5,June,Month6,July,Month7,August,Month8,"+
"September,Month9,October,Month10,November,Month11,December,AM,AM,PM,PM,timeOffset,0";
        r4 = " \t\n\f\r=,|";
        majorVersion = 1;
        requiredLibrary = "1.00";
        serialNumber = "";
        r3 = "";
        docBase = "";
        script = "";
        advertising = false;
        registered = false;
        executing = false;
        oldScriptStart = true;
    }

    public void run()
    {
        for(; Thread.currentThread() == r2; AdvertiseStop())
        {
            Pause(0x1d4c0L);
            AdvertiseStart();
            offGraphics.setFont(new Font("Arial", 1, 11));
            offGraphics.setColor(Color.black);
            offGraphics.fillRect(0, 0, projectSize.width, projectSize.height);
            offGraphics.setColor(Color.white);
            FontMetrics fontmetrics = offGraphics.getFontMetrics();
            int i = 0;
            int j = fontmetrics.getAscent();
            do
            {
                offGraphics.drawString("Courtesy of Riada - click here", i, j);
                i += 10;
                j += fontmetrics.getHeight();
            } while(j <= projectSize.height);
            repaint();
            Pause(20000L);
        }

        TimerHandle();
    }

    public String Script(String s, boolean flag)
    {
        String as[] = {
            ""
        };
        int ai[] = {
            0
        };
        if(flag)
        {
            Object obj = VariableGet(s);
            if(obj == null || !(obj instanceof String))
                return "";
            s = (String)obj;
        }
        char ac[] = s.toCharArray();
        try
        {
            while(ai[0] < ac.length) 
                if(!ActionExecute(ac, ai, as))
                {
                    if(ai[0] < ac.length)
                        Message("Script Error '" + s.substring(ai[0]) + "'");
                    break;
                }
        }
        catch(Exception _ex) { }
        return as[0];
    }

    protected void ScriptInit()
    {
        ReadTokens(r10);
    }

    public void ScriptNR(String s, boolean flag)
    {
        Script(s, flag);
    }

    protected void ScriptStart()
    {
        script = Read(null, true, false);
        Script(script, false);
    }

    public void start()
    {
        if(!(registered = Register()))
        {
            Message("Unregistered version");
            if(r3 != null)
                Message(r3);
            if(r2 == null)
            {
                r2 = new Thread(this);
                r2.start();
            }
        }
        executing = true;
        if(oldScriptStart)
            ScriptStart();
    }

    public void stop()
    {
        executing = false;
        if(r9 != null)
        {
            for(int i = 0; i < 10; i++)
                if(r9[i] != null)
                    r9[i].interrupt();

        }
        r2 = null;
        if(audio != null)
        {
            for(int j = 0; j < audio.size() / 2; j++)
                ((AudioClip)audio.elementAt(j * 2)).stop();

        }
    }

    protected void TimerHandle()
    {
        Thread thread = Thread.currentThread();
        if(r9 != null)
        {
            for(int i = 0; i < 10; i++)
                if(r9[i] == thread)
                {
                    Pause(r8[i]);
                    r9[i] = null;
                    if(executing)
                        Script("OnTimer" + i, true);
                }

        }
    }

    protected int TokenGetI(char ac[], int ai[], int i, boolean flag, String as[])
    {
        as[0] = TokenGetS(ac, ai, "", flag);
        if(as[0] != null && as[0] != "")
            try
            {
                int j = as[0].indexOf("0x") != 0 ? Integer.parseInt(as[0]) : Integer.parseInt(as[0].substring(2), 16);
                as[0] = Integer.toString(j);
                return j;
            }
            catch(NumberFormatException _ex) { }
        return i;
    }

    protected String TokenGetS(char ac[], int ai[], String s, boolean flag)
    {
        String s1 = s;
        for(; ai[0] < ac.length && r4.indexOf(ac[ai[0]]) != -1; ai[0]++);
        if(ai[0] >= ac.length)
            return "-1";
        int i = ai[0]++;
        char c = ac[i];
        if(c == ';')
            return "-2";
        if("({')}'".indexOf(c) != -1 && "({')}'".indexOf(c) < 3)
        {
            char c1 = "({')}'".charAt("({')}'".indexOf(c) + 3);
            int j = 0;
            for(int k = 1; ai[0] < ac.length && k > 0;)
            {
                if(ac[ai[0]] == c1 && j != 92)
                    k--;
                else
                if(ac[ai[0]] == c && j != 92)
                    k++;
                j = ac[ai[0]++];
            }

            s1 = String.copyValueOf(ac, i + 1, ai[0] - i - 2);
            if(c == '(')
                s1 = Script(s1, false);
            if(c == '\'' || c == '{')
                flag = false;
        } else
        {
            for(ai[0]--; ai[0] < ac.length && r4.indexOf(ac[ai[0]]) == -1 && ac[ai[0]] != ';'; ai[0]++);
            s1 = String.copyValueOf(ac, i, ai[0] - i);
        }
        if(flag)
        {
            s1 = Expand(s1);
            Object obj = VariableGet(s1);
            if(obj != null && (obj instanceof String))
                s1 = (String)obj;
        }
        return s1;
    }

    protected String VariableFormat(String s)
    {
        if(s.length() <= 0)
            return "";
        VariableSet("date", new Date());
        StringTokenizer stringtokenizer = new StringTokenizer(s, ".");
        StringBuffer stringbuffer = new StringBuffer();
        String s1 = stringtokenizer.nextToken();
        Object obj = VariableGet(s1);
        if(obj == null)
            return "???";
        if(obj instanceof Date)
        {
            Date date = (Date)obj;
            if(date.getTime() <= 0L)
                return "???";
            if(s.length() <= 0)
                s = "%y/%m/%d";
            int i = s1.length() + 1;
            boolean flag = false;
            boolean flag1 = true;
            while(i < s.length()) 
            {
                int j = -1;
                if(s.charAt(i) == '%' && i + 1 < s.length())
                {
                    i++;
                    flag = !flag;
                    continue;
                }
                if(flag)
                {
                    switch(s.charAt(i))
                    {
                    case 35: // '#'
                        flag1 = false;
                        i++;
                        continue;

                    case 65: // 'A'
                        stringbuffer.append(VariableGet("Day" + date.getDay()));
                        break;

                    case 66: // 'B'
                        stringbuffer.append(VariableGet("Month" + date.getMonth()));
                        break;

                    case 99: // 'c'
                        stringbuffer.append(date.toLocaleString());
                        break;

                    case 103: // 'g'
                        stringbuffer.append(date.toGMTString());
                        break;

                    case 100: // 'd'
                        j = date.getDate();
                        break;

                    case 72: // 'H'
                        j = date.getHours();
                        break;

                    case 73: // 'I'
                        if((j = date.getHours()) > 12)
                            j -= 12;
                        break;

                    case 109: // 'm'
                        j = date.getMonth() + 1;
                        break;

                    case 77: // 'M'
                        j = date.getMinutes();
                        break;

                    case 112: // 'p'
                        stringbuffer.append(date.getHours() < 12 ? VariableGet("AM") : VariableGet("PM"));
                        break;

                    case 83: // 'S'
                        j = date.getSeconds();
                        break;

                    case 119: // 'w'
                        j = date.getDay() + 1;
                        break;

                    case 121: // 'y'
                        if((j = date.getYear()) >= 100)
                            j -= 100;
                        break;

                    case 89: // 'Y'
                        j = date.getYear() + 1900;
                        break;

                    default:
                        stringbuffer.append(s.charAt(i));
                        break;
                    }
                    if(j != -1)
                        stringbuffer.append(j > 9 || !flag1 ? Integer.toString(j) : "0" + j);
                } else
                {
                    stringbuffer.append(s.charAt(i));
                }
                i++;
                flag = false;
                flag1 = true;
            }
        } else
        if(obj instanceof String)
            return (String)obj;
        return stringbuffer.toString();
    }

    protected Object VariableGet(String s)
    {
        return variables.get(s.toLowerCase());
    }

    protected int VariableGetI(String s)
    {
        return Integer.parseInt((String)VariableGet(s));
    }

    protected void VariableSet(String s, Object obj)
    {
        variables.put(s.toLowerCase(), obj);
    }

    private static final int r0 = 0x1d4c0;
    private static final int r1 = 20000;
    private Thread r2;
    protected boolean advertising;
    protected Graphics appletGraphics;
    protected Image appletImage;
    protected Vector audio;
    private String r3;
    private String r4;
    protected String docBase;
    protected boolean executing;
    static final String r5 = "1.03";
    protected int majorVersion;
    protected Graphics offGraphics;
    protected Image offImage;
    protected boolean oldScriptStart;
    protected Properties paramProperties;
    private int r6;
    protected String productCode;
    protected String productName;
    protected Dimension projectSize;
    protected boolean registered;
    protected String requiredLibrary;
    protected String script;
    protected String serialNumber;
    private static final byte r7 = 10;
    private int r8[];
    private Thread r9[];
    private String r10;
    protected Hashtable variables;
}
```


----------



## Beni (31. Jan 2006)

Wirf 2000 Zeilen kryptischen, undokumentieren Code in das Forum, sag es gäbe da "irgendeine Fehlermeldung" ohne nähere Angaben, und dann soll das jemand "mal so eben" lösen.

Sorry, aber :bloed: 

Besorg dir den originalen Sourcecode und liefere eine ordentliche Fehlermeldung (StackTrace!). Ansonsten hat auch hier niemand eine Chance in vernünftiger Zeit was zu finden.


----------



## Guest (31. Jan 2006)

Sry, war vielleicht ein wenig Blauäugig. Habe leider Keine Doku, weil ich das Aplett vom Vorgänger übernommen habe.
Mir ist allerding klar, dass sich niemand durch die 200 Zeilen Code arbeiten wird um mit zu helfen. 
Vielmahr hab ich darauf spekuliert, dass jemand das gleiche Problem hatte und mir in dieser Angelegenheit weiterhelfen kann.

Zu den Fehlermeldungen:

Beim erstmaligen laden (Es wird kein Applett angezeigt) ergibt sich folgende Konsolenausgabe:



> java.lang.SecurityException: illegal URL redirect
> at sun.plugin.net.protocol.http.HttpUtils.followRedirects(Unknown Source)
> at sun.plugin.cache.CachedJarLoader.download(Unknown Source)
> at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
> ...



Beim erwähnten reload der Seite nach welchem das Applett wieder seinen erwarteten Dienst tut ergibt sich nur noch diese Ausgabe.




> RiadaHeadline: Script Error ' 1 3 0 ;51;': Tue Jan 31 13:10:30 CET 2006



Da ich für mich so wirklich überhaupf keinen Anhaltspunkt für die ursache gefunden habe, postete ich quasi in Verzweiflung den Klassen-Code.
Nochmal sry.

Vielleicht ergeben sich weitere Fragen nach betrachung der Seite......

Christian


----------



## Bleiglanz (31. Jan 2006)

pff

das Applet nutzt Threads und irgendwelchen esoterischen Javascript sachen

und

Heutzutage will kein Mensch mehr so lächerliche Animatiönschen sehen, schick deinen Boss zu useit.com und überrede ihn, das Applet in die Tonne zu treten

kein Mehrwert, und absurd schlechter Code


----------



## Guest (31. Jan 2006)

Danke sehr!
Ich denke diese Antwort reicht mir schon und belegt was ich schon vermutete.  8)


----------

