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

📄 opt.java

📁 实现JAVA界面的代码GWT
💻 JAVA
字号:
// 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 
// Source File Name:   Opt.java

package jxl.biff.drawing;

import common.Logger;
import java.util.ArrayList;
import java.util.Iterator;
import jxl.biff.IntegerHelper;
import jxl.biff.StringHelper;

// Referenced classes of package jxl.biff.drawing:
//            EscherAtom, EscherRecordType, EscherRecordData

class Opt extends EscherAtom
{
    static final class Property
    {

        int id;
        boolean blipId;
        boolean complex;
        int value;
        String stringValue;

        public Property(int i, boolean bl, boolean co, int v)
        {
            id = i;
            blipId = bl;
            complex = co;
            value = v;
        }

        public Property(int i, boolean bl, boolean co, int v, String s)
        {
            id = i;
            blipId = bl;
            complex = co;
            value = v;
            stringValue = s;
        }
    }


    private static Logger logger;
    private byte data[];
    private int numProperties;
    private ArrayList properties;
    static Class class$jxl$biff$drawing$Opt; /* synthetic field */

    public Opt(EscherRecordData erd)
    {
        super(erd);
        numProperties = getInstance();
        readProperties();
    }

    private void readProperties()
    {
        properties = new ArrayList();
        int pos = 0;
        byte bytes[] = getBytes();
        for(int i = 0; i < numProperties; i++)
        {
            int val = IntegerHelper.getInt(bytes[pos], bytes[pos + 1]);
            int id = val & 0x3fff;
            int value = IntegerHelper.getInt(bytes[pos + 2], bytes[pos + 3], bytes[pos + 4], bytes[pos + 5]);
            Property p = new Property(id, (val & 0x4000) != 0, (val & 0x8000) != 0, value);
            pos += 6;
            properties.add(p);
        }

        Iterator i = properties.iterator();
        do
        {
            if(!i.hasNext())
                break;
            Property p = (Property)i.next();
            if(p.complex)
            {
                p.stringValue = StringHelper.getUnicodeString(bytes, p.value / 2, pos);
                pos += p.value;
            }
        } while(true);
    }

    public Opt()
    {
        super(EscherRecordType.OPT);
        properties = new ArrayList();
        setVersion(3);
    }

    byte[] getData()
    {
        numProperties = properties.size();
        setInstance(numProperties);
        data = new byte[numProperties * 6];
        int pos = 0;
        Iterator i;
        for(i = properties.iterator(); i.hasNext();)
        {
            Property p = (Property)i.next();
            int val = p.id & 0x3fff;
            if(p.blipId)
                val |= 0x4000;
            if(p.complex)
                val |= 0x8000;
            IntegerHelper.getTwoBytes(val, data, pos);
            IntegerHelper.getFourBytes(p.value, data, pos + 2);
            pos += 6;
        }

        i = properties.iterator();
        do
        {
            if(!i.hasNext())
                break;
            Property p = (Property)i.next();
            if(p.complex && p.stringValue != null)
            {
                byte newData[] = new byte[data.length + p.stringValue.length() * 2];
                System.arraycopy(data, 0, newData, 0, data.length);
                StringHelper.getUnicodeBytes(p.stringValue, newData, data.length);
                data = newData;
            }
        } while(true);
        return setHeaderData(data);
    }

    void addProperty(int id, boolean blip, boolean complex, int val)
    {
        Property p = new Property(id, blip, complex, val);
        properties.add(p);
    }

    void addProperty(int id, boolean blip, boolean complex, int val, String s)
    {
        Property p = new Property(id, blip, complex, val, s);
        properties.add(p);
    }

    Property getProperty(int id)
    {
        boolean found = false;
        Property p = null;
        Iterator i = properties.iterator();
        do
        {
            if(!i.hasNext() || found)
                break;
            p = (Property)i.next();
            if(p.id == id)
                found = true;
        } while(true);
        return found ? p : null;
    }

    static Class class$(String x0)
    {
        return Class.forName(x0);
        ClassNotFoundException x1;
        x1;
        throw new NoClassDefFoundError(x1.getMessage());
    }

    static 
    {
        logger = Logger.getLogger(class$jxl$biff$drawing$Opt != null ? class$jxl$biff$drawing$Opt : (class$jxl$biff$drawing$Opt = class$("jxl.biff.drawing.Opt")));
    }
}

⌨️ 快捷键说明

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