// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov  Date: 12.08.2011 2:53:57
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 

import agent.JAgent;
import java.util.Vector;
import javax.microedition.lcdui.*;

public final class j extends ad
{

    public j(String s)
    {
        super(s);
        a = ad.b_javax_microedition_lcdui_Image_static_fld.getHeight();
        super.l = super.k / (a + 2);
        super.g = (super.k / (a + 2)) * ((super.j - ad.c_int_static_fld) / (a + 2));
        if(super.g > 74)
            super.g = 74;
    }

    public final void paint(Graphics g)
    {
        byte byte0;
        int i;
        super.j = getHeight();
        if(super.g == 0)
            a(false);
        byte0 = 0;
        i = 0;
        int k = 2;
        g.setColor(0xffffff);
        g.setClip(0, 0, super.k, super.j);
        g.fillRect(0, 0, super.k, super.j);
        int l = 0;
        l = super.a_a_fld.a(g, ad.a_javax_microedition_lcdui_Image_static_fld, 0, super.k, false, 2);
        int i1 = super.l;
        int j1;
        if((j1 = super.f + super.g) >= super.b_java_util_Vector_fld.size())
            j1 = super.b_java_util_Vector_fld.size();
        for(int k1 = super.f; k1 < j1; k1++)
        {
            ((a)super.b_java_util_Vector_fld.elementAt(k1)).a(g, ad.b_javax_microedition_lcdui_Image_static_fld, l, a + 2, k1 == super.e, k);
            i1--;
            if(k1 == super.e)
            {
                byte0 = k;
                i = l;
            }
            if(i1 == 0)
            {
                i1 = super.l;
                l += a + 2;
                k = 2;
            } else
            {
                k += a + 2;
            }
        }

        g.setClip(0, 0, super.k, super.j);
        g.setColor(0);
        g.setStrokeStyle(0);
        g.drawRoundRect(byte0, i, a, a, 4, 4);
        return;
        JVM INSTR dup ;
        Exception exception;
        exception;
        printStackTrace();
    }

    public final void a(int i)
    {
        super.a(i);
        super.a(v.a(48) + ad.a(super.e), -1);
    }

    public final boolean a(boolean flag)
    {
        if(flag)
            for(super.f = 74; super.f > super.e; super.f -= super.g);
        if(super.f < 0)
            super.f = 0;
        return true;
    }

    public final void keyPressed(int i)
    {
        if(super.d_boolean_fld)
            return;
        if(i == -11 && JAgent.b)
        {
            super.a_javax_microedition_lcdui_CommandListener_fld.commandAction(y.B, this);
            return;
        }
        String s = getKeyName(i).toUpperCase();
        int k;
        if((k = getGameAction(i)) == 8 || s.equals("SEND"))
        {
            if(super.c_javax_microedition_lcdui_Command_fld != null)
                super.a_javax_microedition_lcdui_CommandListener_fld.commandAction(super.c_javax_microedition_lcdui_Command_fld, this);
        } else
        if(s.equals("CLEAR") && super.d_javax_microedition_lcdui_Command_fld != null)
            super.a_javax_microedition_lcdui_CommandListener_fld.commandAction(super.d_javax_microedition_lcdui_Command_fld, this);
        switch(k)
        {
        case 3: // '\003'
        case 4: // '\004'
        default:
            break;

        case 1: // '\001'
            a(super.e - super.l);
            break;

        case 6: // '\006'
            a(super.e + super.l);
            break;

        case 5: // '\005'
            if(super.i != 0)
                a(super.f + super.g);
            else
                a(super.e + 1);
            break;

        case 2: // '\002'
            if(super.i != 0)
                a(super.f - 1);
            else
                a(super.e - 1);
            break;
        }
        c();
    }

    public final void pointerPressed(int i, int k)
    {
        int l;
        int i1;
        l = 0;
        i1 = ad.c_int_static_fld;
_L2:
        int k1;
        if(l >= super.g)
            break MISSING_BLOCK_LABEL_104;
        int j1 = super.f + l * super.l;
        k1 = i1 + a + 2;
        j1 += i / (a + 2);
        if(k >= i1 && k <= k1)
        {
            if(j1 != super.e)
                a(j1);
            repaint();
            keyPressed(getKeyCode(8));
            return;
        }
        i1 = k1;
        l++;
        if(true) goto _L2; else goto _L1
_L1:
        return;
        JVM INSTR pop ;
    }

    public int a;
}