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

📄 h.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.*;
import javax.microedition.lcdui.*;
import javax.microedition.rms.*;

public class h
    implements CommandListener
{

    j i[][];
    Display x;
    Displayable o;
    List f;
    List h;
    Command e;
    Command y;
    Command r;
    Command t;
    Command n;
    Command k;
    Command g;
    Command C;
    Command p;
    Command z;
    Command l;
    Command u;
    Command d;
    Command a;
    WebViewer j;
    Form w;
    Form v;
    Form s;
    TextField b;
    TextField c;
    TextField D;
    int m;
    int B;
    String q;
    Image A;

    public h(WebViewer webviewer, Display display)
    {
        B = 0;
        j = webviewer;
        x = display;
        i = new j[2][];
        try
        {
            A = Image.createImage("/f.png");
            a(((String) (null)));
        }
        catch(Exception exception) { }
        e = new Command("Open", 8, 2);
        n = new Command("Edit", 8, 69);
        d = new Command("New Bookmark", 1, 99);
        a = new Command("New", 1, 99);
        k = new Command("Back", 2, 1);
        r = new Command("New Folder", 1, 100);
        t = new Command("Delete", 8, 666);
        z = new Command("Move Up", 8, 777);
        l = new Command("Move Down", 8, 888);
        g = new Command("Move to Folder", 8, 889);
        C = new Command("OK", 4, 1);
        p = new Command("Cancel", 3, 69);
        u = new Command("Move To", 8, 1);
        if(webviewer.j)
        {
            k = new Command("Back", 2, 1000);
            y = new Command("New Bookmark", 1, 1000);
            r = new Command("New Folder", 1, 1000);
            e = new Command("Open", 8, 1000);
            n = new Command("Edit", 8, 1000);
            t = new Command("Delete", 8, 1000);
            z = new Command("Move Up", 8, 1000);
            l = new Command("Move Down", 8, 1000);
            g = new Command("Move to Folder", 8, 1000);
        }
    }

    public void a()
    {
        o = x.getCurrent();
        try
        {
            a("Bookmarks", ((String) (null)));
            if(w == null)
            {
                w = new Form("Bookmark");
                b = new TextField("Title:", null, 30, 0);
                w.append(b);
                c = new TextField("URL:", null, 512, 4);
                w.append(c);
                w.addCommand(C);
                w.addCommand(p);
                w.setCommandListener(this);
                v = new Form("Folder");
                D = new TextField("Name:", null, 30, 0);
                v.append(D);
                v.addCommand(C);
                v.addCommand(p);
                v.setCommandListener(this);
            }
        }
        catch(Exception exception)
        {
            a(exception, o);
        }
    }

    public boolean d()
    {
        return i[0] != null && i[0].length > 0;
    }

    private void c()
    {
        if(f != null)
        {
            f.addCommand(e);
            f.addCommand(n);
            f.addCommand(t);
            f.addCommand(z);
            f.addCommand(l);
            f.addCommand(g);
        }
    }

    private void e()
    {
        if(j.j)
        {
            f.addCommand(y);
            return;
        }
        f.removeCommand(d);
        f.removeCommand(a);
        if(d())
            f.addCommand(y = d);
        else
        if(i[1] == null)
            f.addCommand(y = d);
        else
            f.addCommand(y = a);
    }

    protected void a(Exception exception, Displayable displayable)
    {
        String s1 = exception.getMessage();
        if(s1 == null)
            s1 = exception.toString();
        Alert alert = new Alert("Error", s1, null, AlertType.ERROR);
        alert.setTimeout(-2);
        if(displayable != null && displayable == f)
            e();
        if(displayable != null)
            x.setCurrent(alert, displayable);
        else
            x.setCurrent(alert, j.k);
    }

    private String a(int i1)
        throws RecordStoreException, IOException
    {
        RecordStore recordstore = null;
        String s1;
        recordstore = RecordStore.openRecordStore(q, false);
        DataInputStream datainputstream = new DataInputStream(new ByteArrayInputStream(recordstore.getRecord(i1)));
        datainputstream.readUTF();
        s1 = datainputstream.readUTF();
        if(recordstore != null)
            recordstore.closeRecordStore();
        return s1;
        Exception exception;
        exception;
        if(recordstore != null)
            recordstore.closeRecordStore();
        throw exception;
    }

    private void a(String s1, int i1, Image image, boolean flag)
    {
        int j1 = 0;
        if(!flag)
            j1 = 1;
        j j2 = new j();
        j2.c = s1;
        j2.a = i1;
        j2.b = image;
        j aj[] = i[j1];
        i[j1] = new j[i[j1].length + 1];
        System.arraycopy(aj, 0, i[j1], 0, aj.length);
        i[j1][i[j1].length - 1] = j2;
    }

    public void a(String s1, String s2, String s3, int i1)
    {
        Image image;
        RecordStore recordstore;
        image = null;
        recordstore = null;
        Object obj = null;
        Object obj1 = null;
        if(s1 == null || s1.trim().length() == 0)
            s1 = "Untitled";
        if(s1.length() > 30)
            s1 = s1.substring(0, 30);
        if(s2 == null)
        {
            B++;
            s2 = String.valueOf(B);
            image = A;
        }
        recordstore = RecordStore.openRecordStore(s3, true);
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);
        dataoutputstream.writeUTF(s1);
        dataoutputstream.writeUTF(s2);
        dataoutputstream.writeBoolean(image != null);
        dataoutputstream.flush();
        byte abyte0[] = bytearrayoutputstream.toByteArray();
        int j1 = recordstore.addRecord(abyte0, 0, abyte0.length);
        if(i1 == 1)
        {
            if(s3.equals("bookmarks"))
                a(s1, j1, image, false);
        } else
        if(i1 == 2 || i1 == 0 && i[0] != null)
        {
            a(s1, j1, image, true);
            if(i1 == 2 && f != null)
            {
                c();
                f.append(s1, image);
            }
        }
        try
        {
            if(recordstore != null)
                recordstore.closeRecordStore();
        }
        catch(Exception exception2)
        {
            a(exception2, x.getCurrent());
        }
        break MISSING_BLOCK_LABEL_349;
        Exception exception;
        exception;
        a(exception, x.getCurrent());
        try
        {
            if(recordstore != null)
                recordstore.closeRecordStore();
        }
        catch(Exception exception3)
        {
            a(exception3, x.getCurrent());
        }
        break MISSING_BLOCK_LABEL_349;
        Exception exception1;
        exception1;
        try
        {
            if(recordstore != null)
                recordstore.closeRecordStore();
        }
        catch(Exception exception4)
        {
            a(exception4, x.getCurrent());
        }
        throw exception1;
    }

    private void b(String s1, String s2)
        throws RecordStoreException, IOException
    {
        RecordStore recordstore;
        recordstore = null;
        Object obj = null;
        Object obj1 = null;
        recordstore = RecordStore.openRecordStore(q, false);
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);
        dataoutputstream.writeUTF(s1);
        dataoutputstream.writeUTF(s2);
        dataoutputstream.writeBoolean(i[0][m].b != null);
        dataoutputstream.flush();
        byte abyte0[] = bytearrayoutputstream.toByteArray();
        recordstore.setRecord(i[0][m].a, abyte0, 0, abyte0.length);
        i[0][m].c = s1;
        f.set(m, s1, i[0][m].b);
        if(recordstore != null)
            recordstore.closeRecordStore();
        break MISSING_BLOCK_LABEL_177;
        Exception exception;
        exception;
        if(recordstore != null)
            recordstore.closeRecordStore();
        throw exception;
    }

    private void b()
        throws RecordStoreException, IOException
    {
        RecordStore recordstore = null;
        recordstore = RecordStore.openRecordStore(q, false);
        if(i[0][m].b != null)
        {
            String s1 = "bookmarks";
            s1 = s1 + a(i[0][m].a);
            try
            {
                RecordStore.deleteRecordStore(s1);
            }
            catch(RecordStoreNotFoundException recordstorenotfoundexception) { }
        }
        recordstore.deleteRecord(i[0][m].a);
        f.delete(m);
        j aj[] = i[0];
        i[0] = new j[i[0].length - 1];
        if(m > 0)
            System.arraycopy(aj, 0, i[0], 0, m);
        if(i[0].length > m)
            System.arraycopy(aj, m + 1, i[0], m, i[0].length - m);
        aj = null;
        if(!d())
        {
            f.removeCommand(t);
            f.removeCommand(n);
            f.removeCommand(e);
            f.removeCommand(z);
            f.removeCommand(l);
            f.removeCommand(g);
        }
        e();
        if(recordstore != null)
            recordstore.closeRecordStore();

⌨️ 快捷键说明

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