⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webviewer.java

📁 webviwer,一个基于j2me的浏览器
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 

import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.rms.*;

public class WebViewer extends MIDlet
    implements CommandListener, m
{

    private static String D;
    Form k;
    Form L;
    private l p;
    private TextBox z;
    private Display m;
    private h v;
    private List w;
    private Form u;
    private Form l;
    private ChoiceGroup P[];
    private TextField I;
    private int d;
    private int q;
    private g h[];
    private Image O;
    public boolean j;
    private boolean K[] = {
        true, true, true, false, false
    };
    private int N[] = {
        2
    };
    private Command a;
    private static Command r = new Command("Stop", 6, 1);
    private static Command B = new Command("Back", 2, 4);
    private static final Command o = new Command("URL", 1, 8);
    private static final Command C = new Command("Go", 8, 8);
    private static final Command G = new Command("Reload", 1, 20);
    private static final Command t = new Command("Bookmarks", 1, 24);
    private static final Command c = new Command("Add Bookmark", 1, 28);
    private static final Command E = new Command("Add Bookmark", 8, 28);
    private static Command i = new Command("History", 1, 29);
    private static Command e = new Command("Full Image", 1, 30);
    private static Command b = new Command("OCR Image", 1, 31);
    private static final Command x = new Command("Settings", 1, 32);
    private static Command A = new Command("Clear Cache", 1, 40);
    private static final Command f = new Command("User's Guide", 5, 48);
    private static final Command g = new Command("About", 5, 64);
    private static final Command F = new Command("OK", 4, 1);
    private static final Command H = new Command("Advanced", 1, 2);
    private static final Command s = new Command("Cookies", 1, 3);
    private static final Command M = new Command("Cancel", 3, 69);
    private static final Command J = new Command("Clear", 1, 48);
    public static final Command y = new Command("Register", 1, 55);
    private String n;

    public WebViewer()
    {
        j = false;
        k = new Form(null);
        try
        {
            k.append(Image.createImage("/r.png"));
            O = Image.createImage("/c.png");
        }
        catch(IOException ioexception) { }
        k.append("\nWebViewer 3.5\nby Reqwireless");
    }

    public void startApp()
    {
label0:
        {
label1:
            {
label2:
                {
                    m = Display.getDisplay(this);
                    if(p == null)
                    {
                        p = new l(m);
                        int i1 = p.getWidth();
                        int k1 = p.getHeight();
                        if(i1 == 208 && (k1 == 173 || k1 == 253))
                        {
                            B = new Command("Back", 2, 1000);
                            i = new Command("History", 1, 1000);
                            e = new Command("Full Image", 1, 1000);
                            b = new Command("OCR Image", 1, 1000);
                            A = new Command("Clear Cache", 1, 1000);
                            r = new Command("Stop", 6, 1000);
                            j = true;
                        }
                        p.x = "https://proxy1.reqwireless.com/Web/";
                        p.d(10);
                        p.a(B, i);
                        p.addCommand(o);
                        p.addCommand(G);
                        p.addCommand(t);
                        p.addCommand(c);
                        p.addCommand(x);
                        p.addCommand(f);
                        WebViewer _tmp = this;
                        if(!l.V)
                            p.addCommand(y);
                        p.addCommand(g);
                        p.b(e);
                        p.a(b);
                        p.setCommandListener(this);
                        p.a(this);
                        n = p.o();
                        if(i1 == 176 && k1 == 144 || i1 == 208 || i1 == 460 || i1 == 130 && k1 == 130 || i1 == 160 && k1 == 144)
                        {
                            d = 2;
                        } else
                        {
                            String s1 = System.getProperty("microedition.profiles");
                            if(s1 != null && s1.indexOf("MIDP-2.0") >= 0)
                                d = 1;
                        }
                        if(i1 != 176 || k1 != 144)
                            p.addCommand(a = new Command("Exit", 7, 999));
                    }
                    if(v == null)
                        v = new h(this, m);
                    if(z == null)
                    {
                        z = new TextBox("Enter URL", null, 512, 4);
                        z.addCommand(F);
                        z.addCommand(J);
                        z.addCommand(M);
                        z.setCommandListener(this);
                    }
                    if(u != null)
                        break label0;
                    u = new Form("Settings");
                    P = new ChoiceGroup[K.length];
                    for(int j1 = 0; j1 < K.length; j1++)
                        P[j1] = new ChoiceGroup(null, 2);

                    P[0].append("Enable images", null);
                    P[1].append("Enable cookies", null);
                    P[2].append("Identify as MSIE", null);
                    P[3].append("Use small fonts", null);
                    P[4].append("Use fewer colors", null);
                    for(int l1 = 0; l1 < K.length; l1++)
                        u.append(P[l1]);

                    WebViewer _tmp1 = this;
                    if(p.Q != 1)
                    {
                        WebViewer _tmp2 = this;
                        if(p.Q != 2)
                        {
                            WebViewer _tmp3 = this;
                            if(p.Q != 3)
                                break label2;
                        }
                    }
                    I = new TextField(null, null, 2, 2);
                    u.append("Number of pages to cache: ");
                    break label1;
                }
                I = new TextField("Number of pages to cache: ", null, 2, 2);
            }
            u.append(I);
            u.addCommand(F);
            u.addCommand(H);
            u.addCommand(s);
            u.addCommand(M);
            u.setCommandListener(this);
            WebViewer _tmp4 = this;
            if(p.Q == 5)
                K[0] = false;
            h();
        }
        if(m.getCurrent() == null)
            if(k != null)
            {
                k.addCommand(o);
                k.addCommand(t);
                k.addCommand(x);
                k.addCommand(f);
                WebViewer _tmp5 = this;
                if(!l.V)
                    k.addCommand(y);
                k.addCommand(g);
                if(a != null)
                    k.addCommand(a);
                k.setCommandListener(this);
                m.setCurrent(k);
            } else
            {
                m.setCurrent(p);
            }
    }

    private void f()
    {
        if(p != null)
        {
            p.f();
            p.removeCommand(r);
        }
    }

    public void pauseApp()
    {
        try
        {
            if(p != null)
            {
                WebViewer _tmp = this;
                if(p.Q != 3)
                    f();
            }
        }
        catch(OutOfMemoryError outofmemoryerror) { }
    }

    public void destroyApp(boolean flag)
    {
        if(p != null)
            p.f();
    }

    private void a()
    {
        if(k != null)
            m.setCurrent(k);
        else
            m.setCurrent(p);
    }

    public void commandAction(Command command, Displayable displayable)
    {
        if(command != o) goto _L2; else goto _L1
_L1:
        String s1 = p.h();
        if(s1 != null && s1.length() > 5 && s1.length() <= z.getMaxSize() && !s1.startsWith("reqwireless:"))
            z.setString(s1);
        else
            z.setString("http://");
        m.setCurrent(z);
          goto _L3
_L2:
        if(command != r) goto _L5; else goto _L4
_L4:
        f();
          goto _L3
_L5:
        if(command != B) goto _L7; else goto _L6
_L6:
        m.setCurrent(p);
        p.b(-1);
          goto _L3
_L7:
        if(command != G) goto _L9; else goto _L8
_L8:
        m.setCurrent(p);
        p.b(0);
          goto _L3
_L9:
        if(command != e) goto _L11; else goto _L10
_L10:
        p.s();
          goto _L3
_L11:
        if(command != b) goto _L13; else goto _L12
_L12:
        p.d();
          goto _L3
_L13:
        if(command != F) goto _L15; else goto _L14
_L14:
        if(displayable == z)
            a(z.getString(), false);
        else
        if(displayable == L)
        {
            N[0] = ((ChoiceGroup)L.get(0)).isSelected(0) ? 0 : 1;
            e();
            L = null;
            m.setCurrent(u);
        } else
        if(displayable == u)
        {
            for(int i1 = 0; i1 < K.length; i1++)
                K[i1] = P[i1].isSelected(0);

            q = 0;
            try
            {
                q = Integer.parseInt(I.getString());
                if(q < 0)
                    q = 0;
            }
            catch(NumberFormatException numberformatexception) { }
            if(q > d)
            {
                l = new Form("Warning");
                l.append("Increasing the cache size may increase \"Low memory\" errors.  Are you sure you want to increase the cache size?");
                l.addCommand(F);
                l.addCommand(M);
                l.setCommandListener(this);
                m.setCurrent(l);
            } else
            {
                d();
            }
        } else
        if(displayable == l)
        {
            d();
            l = null;
        }
          goto _L3
_L15:
        if(command != M) goto _L17; else goto _L16
_L16:
        if(displayable == u)
        {
            a();
            for(int j1 = 0; j1 < K.length; j1++)
                P[j1].setSelectedIndex(0, K[j1]);

            I.setString(String.valueOf(d));
        } else
        if(displayable == l)
        {
            I.setString(String.valueOf(d));
            m.setCurrent(u);
            l = null;
        } else
        if(displayable == L)
        {
            m.setCurrent(u);
            L = null;
        } else
        {
            a();
            h = null;
            w = null;
        }
          goto _L3
_L17:
        if(command != J) goto _L19; else goto _L18
_L18:
        z.setString("http://");
          goto _L3
_L19:
        if(command != t) goto _L21; else goto _L20
_L20:
        v.a();
          goto _L3
_L21:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -