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

📄 htmlstream.java

📁 一款J2ME浏览器
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
                    if (centertext2.bold) {
                        virtualgraphics.drawString(centertext2.text, j1 + 1, j, 20);
                    }
                    if (centertext2.underline) {
                        if (k1 == 0 && centertext2.text.startsWith(" ")) {
                            virtualgraphics.drawLine(j1 + slen, j + strHeight(), j1 + strWidth(centertext2.text), j + strHeight());
                        } else {
                            virtualgraphics.drawLine(j1, j + strHeight(), j1 + strWidth(centertext2.text), j + strHeight());
                        }
                    }
                    j1 += strWidth(centertext2.text);
                }

                _mth0102();
            }
        }
        _fld010E = false;
    }

    void _mth0104() {
        if (vx + _fld0104 < CanvasWidth) {
            vx += _fld0104;
        } else {
            vx = _fld0112 * _fld0114 + _fld0104;
            vy += strHeight();
        }
    }

    void render(VirtualGraphics virtualgraphics) {
        vx = 0;
        vy = 0;
        slen = strWidth(" ");
        _fld010A = false;
        _fld010B = false;
        _fld010C = false;
        _fld010D = "";
        _fld010E = false;
        _fld010F = false;
        _fld0110 = false;
        _fld0111 = false;
        _fld0112 = 0;
        _fld0109 = false;
        hsindex = 0;
        hsvector.removeAllElements();
        formindex = -1;
        FormObj formobj = null;
        formvector.removeAllElements();
        _fld0106 = 0xffffff;
        _fld0107 = 0;
        lcolor = 255;
        SelectObj selectobj = null;
        OptionObj optionobj = null;
        boolean flag = false;
        String s3 = "";
        TextObj textobj = null;
        boolean flag1 = false;
        String s4 = "";
        virtualgraphics.setBgColor(_fld0106);
        virtualgraphics.setColor(_fld0107);
        Tools.initColorStack();
        Tools.pushColorStack(_fld0107);
        ErrorLine = null;
        label0:
        for (int k = 0; k < sv.size(); k++) {
            String s;
            if (ErrorLine == null) {
                s = (String) sv.elementAt(k);
                sv.setElementAt(null, k);
            } else {
                s = ErrorLine;
                ErrorLine = null;
            }
            s = s.trim();
            if (s.length() == 0) {
                continue;
            }
            String s1 = s.toLowerCase();
            if (s1.endsWith("-->")) {
                _fld010B = false;
                continue;
            }
            if (s1.equals("</head>")) {
                _fld010B = false;
                continue;
            }
            if (s1.equals("</title>")) {
                _fld010B = false;
                continue;
            }
            if (_fld010B) {
                continue;
            }
            if (s1.startsWith("<!--")) {
                _fld010B = true;
                continue;
            }
            if (s1.equals("<head>")) {
                _fld010B = true;
                continue;
            }
            if (s1.equals("<title>")) {
                _fld010B = true;
                continue;
            }
            if (s1.startsWith("<")) {
                if (s1.startsWith("<a")) {
                    if (_fld010C) {
                        _fld010C = false;
                        if (vx != _fld0112 * _fld0114) {
                            _fld010E = true;
                            _mth0103(virtualgraphics, "", vx, vy);
                            vx = _fld0112 * _fld0114;
                            vy += strHeight();
                        }
                    }
                    hs = new HotSpot();
                    hs.setBxBy(vx, vy);
                    _mth0104();
                    _fld0109 = true;
                    Vector vector = _mth0101(s);
                    boolean flag3 = false;
                    for (int l2 = 0; l2 < vector.size(); l2++) {
                        String s18 = (String) vector.elementAt(l2);
                        if (s18.toLowerCase().startsWith("href=")) {
                            flag3 = true;
                            hs.setObj(0, FF(s18.substring(5)), strHeight());
                        }
                    }

                    if (flag3) {
                        virtualgraphics.setColor(lcolor);
                        _fld0111 = true;
                        _fld0110 = true;
                    } else {
                        hs = null;
                        _fld0109 = false;
                    }
                    continue;
                }
                if (s1.equals("</a>")) {
                    _fld0109 = false;
                    _mth0104();
                    if (hs != null) {
                        hs.setExEy(vx, vy);
                        hsvector.addElement(hs);
                    }
                    virtualgraphics.setColor(_fld0107);
                    _fld0111 = false;
                    continue;
                }
                if (s1.equals("<b>")) {
                    _fld010A = true;
                    continue;
                }
                if (s1.equals("</b>")) {
                    _fld010A = false;
                    continue;
                }
                if (s1.startsWith("<body")) {
                    Vector vector1 = _mth0101(s);
                    int i2 = 0;
                    do {
                        if (i2 >= vector1.size()) {
                            continue label0;
                        }
                        String s15 = (String) vector1.elementAt(i2);
                        if (s15.toLowerCase().startsWith("bgcolor=")) {
                            _fld0106 = Tools.GetColor(s15.substring(8));
                            virtualgraphics.setBgColor(_fld0106);
                        }
                        if (s15.toLowerCase().startsWith("text=")) {
                            _fld0107 = Tools.GetColor(s15.substring(5));
                            Tools.initColorStack();
                            Tools.pushColorStack(_fld0107);
                            virtualgraphics.setColor(_fld0107);
                        }
                        if (s15.toLowerCase().startsWith("link=")) {
                            lcolor = Tools.GetColor(s15.substring(5));
                        }
                        if (s15.toLowerCase().startsWith("background=")) {
                            String s19 = FF(s15.substring(11));
                            Image image2 = Tools.LoadHtmlImage(s19);
                            virtualgraphics.setBgImage(image2);
                        }
                        i2++;
                    } while (true);
                }
                if (s1.startsWith("<br")) {
                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                    }
                    vx = _fld0112 * _fld0114;
                    vy += strHeight();
                    continue;
                }
                if (s1.equals("<center>")) {
                    if (vx != _fld0112 * _fld0114) {
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    _fld010C = true;
                    _fld010D = "";
                    _mth0102();
                    continue;
                }
                if (s1.equals("</center>")) {
                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    _fld010C = false;
                    continue;
                }
                if (s1.startsWith("<form")) {
                    String s5 = "get";
                    String s12 = "";
                    Vector vector8 = _mth0101(s);
                    for (int l4 = 0; l4 < vector8.size(); l4++) {
                        String s25 = (String) vector8.elementAt(l4);
                        if (s25.toLowerCase().startsWith("method=")) {
                            s5 = s25.substring(7).toLowerCase();
                        }
                        if (s25.toLowerCase().startsWith("action=")) {
                            s12 = s25.substring(7);
                        }
                    }

                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    formobj = new FormObj(s5, FF(s12));
                    formindex++;
                    continue;
                }
                if (s1.equals("</form>")) {
                    if (formobj != null) {
                        formvector.addElement(formobj);
                    }
                    formobj = null;
                    continue;
                }
                if (s1.startsWith("<font")) {
                    Tools.pushColorStack(_fld0107);
                    Vector vector2 = _mth0101(s);
                    int j2 = 0;
                    do {
                        if (j2 >= vector2.size()) {
                            continue label0;
                        }
                        String s16 = (String) vector2.elementAt(j2);
                        if (s16.toLowerCase().startsWith("color=")) {
                            _fld0107 = Tools.GetColor(s16.substring(6));
                            virtualgraphics.setColor(_fld0107);
                        }
                        j2++;
                    } while (true);
                }
                if (s1.equals("</font>")) {
                    _fld0107 = Tools.popColorStack();
                    virtualgraphics.setColor(_fld0107);
                    continue;
                }
                if (s1.startsWith("<hr")) {
                    int l = 1;
                    Vector vector3 = _mth0101(s);
                    for (int i3 = 0; i3 < vector3.size(); i3++) {
                        String s20 = (String) vector3.elementAt(i3);
                        if (!s20.toLowerCase().startsWith("size=")) {
                            continue;
                        }
                        l = Tools.toInt(s20.substring(5));
                        if (l == 0) {
                            l = 1;
                        }
                    }

                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    vy += _fld0105;
                    virtualgraphics.fillRect(0, vy, CanvasWidth, l);
                    vy += l + _fld0105;
                    continue;
                }
                if (s1.startsWith("<h")) {
                    if (!s1.equals("<h1>") && !s1.equals("<h2>") && !s1.equals("<h3>") && !s1.equals("<h4>") && !s1.equals("<h5>") && !s1.equals("<h6>"))
                    {
                        continue;
                    }
                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    _fld010A = true;
                    continue;
                }
                if (s1.startsWith("</h")) {
                    if (!s1.equals("</h1>") && !s1.equals("</h2>") && !s1.equals("</h3>") && !s1.equals("</h4>") && !s1.equals("</h5>") && !s1.equals("</h6>"))
                    {
                        continue;
                    }
                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    _fld010A = false;
                    continue;
                }
                if (s1.startsWith("<img")) {
                    String s6 = "";
                    Vector vector4 = _mth0101(s);
                    for (int j3 = 0; j3 < vector4.size(); j3++) {
                        String s21 = (String) vector4.elementAt(j3);
                        if (s21.toLowerCase().startsWith("src=")) {
                            s6 = FF(s21.substring(4));
                        }
                    }

                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    GF = new GifFrame();
                    Image image = Tools.LoadHtmlImage(s6);
                    if (image == null) {
                        image = MapCanvas.NoneImage;
                    }
                    vy += _fld0105;
                    if (_fld010C) {
                        virtualgraphics.drawImage(image, CanvasWidth / 2, vy, 17);
                        GF.setXY(CanvasWidth / 2, vy);
                    } else {
                        virtualgraphics.drawImage(image, 0, vy, 20);
                        GF.setXY(0, vy);
                    }
                    if (GF.size() > 1) {
                        VirtualGraphics.GFV.addElement(GF);
                    }
                    GF = null;
                    vy += image.getHeight() + _fld0105;
                    image = null;
                    continue;
                }
                if (s1.startsWith("<mvideo")) {
                    String s7 = "";
                    Vector vector5 = _mth0101(s);
                    for (int k3 = 0; k3 < vector5.size(); k3++) {
                        String s22 = (String) vector5.elementAt(k3);
                        if (s22.toLowerCase().startsWith("src=")) {
                            s7 = FF(s22.substring(4));
                        }
                    }

                    if (vx != _fld0112 * _fld0114) {
                        _fld010E = true;
                        _mth0103(virtualgraphics, "", vx, vy);
                        vx = _fld0112 * _fld0114;
                        vy += strHeight();
                    }
                    VF = new VideoFrame();
                    Image image1 = Tools.LoadVideoImage(s7);
                    if (image1 == null) {
                        continue;
                    }
                    vy += _fld0105;
                    if (_fld010C) {
                        virtualgraphics.drawImage(image1, CanvasWidth / 2, vy, 17);
                        VF.setXY(CanvasWidth / 2, vy);
                    } else {
                        virtualgraphics.drawImage(image1, 0, vy, 20);
                        VF.setXY(0, vy);
                    }
                    VirtualGraphics.VFV.addElement(VF);

⌨️ 快捷键说明

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