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

📄 drawing2.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:   Drawing2.java

package jxl.biff.drawing;

import common.Assert;
import common.Logger;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

// Referenced classes of package jxl.biff.drawing:
//            DrawingGroupObject, Origin, MsoDrawingRecord, DrawingData, 
//            DrawingGroup, ShapeType, EscherContainer

public class Drawing2
    implements DrawingGroupObject
{

    private static Logger logger;
    private EscherContainer readSpContainer;
    private MsoDrawingRecord msoDrawingRecord;
    private boolean initialized;
    private File imageFile;
    private byte imageData[];
    private int objectId;
    private int blipId;
    private double x;
    private double y;
    private double width;
    private double height;
    private int referenceCount;
    private EscherContainer escherData;
    private Origin origin;
    private DrawingGroup drawingGroup;
    private DrawingData drawingData;
    private ShapeType type;
    private int shapeId;
    private int drawingNumber;
    static Class class$jxl$biff$drawing$Drawing; /* synthetic field */

    public Drawing2(MsoDrawingRecord mso, DrawingData dd, DrawingGroup dg)
    {
        initialized = false;
        drawingGroup = dg;
        msoDrawingRecord = mso;
        drawingData = dd;
        initialized = false;
        origin = Origin.READ;
        drawingData.addRawData(msoDrawingRecord.getData());
        drawingGroup.addDrawing(this);
        Assert.verify(mso != null);
        initialize();
    }

    protected Drawing2(DrawingGroupObject dgo, DrawingGroup dg)
    {
        initialized = false;
        Drawing2 d = (Drawing2)dgo;
        Assert.verify(d.origin == Origin.READ);
        msoDrawingRecord = d.msoDrawingRecord;
        initialized = false;
        origin = Origin.READ;
        drawingData = d.drawingData;
        drawingGroup = dg;
        drawingNumber = d.drawingNumber;
        drawingGroup.addDrawing(this);
    }

    public Drawing2(double x, double y, double w, double h, File image)
    {
        initialized = false;
        imageFile = image;
        initialized = true;
        origin = Origin.WRITE;
        this.x = x;
        this.y = y;
        width = w;
        height = h;
        referenceCount = 1;
        type = ShapeType.PICTURE_FRAME;
    }

    public Drawing2(double x, double y, double w, double h, byte image[])
    {
        initialized = false;
        imageData = image;
        initialized = true;
        origin = Origin.WRITE;
        this.x = x;
        this.y = y;
        width = w;
        height = h;
        referenceCount = 1;
        type = ShapeType.PICTURE_FRAME;
    }

    private void initialize()
    {
        initialized = true;
    }

    public final void setObjectId(int objid, int bip, int sid)
    {
        objectId = objid;
        blipId = bip;
        shapeId = sid;
        if(origin == Origin.READ)
            origin = Origin.READ_WRITE;
    }

    public final int getObjectId()
    {
        if(!initialized)
            initialize();
        return objectId;
    }

    public int getShapeId()
    {
        if(!initialized)
            initialize();
        return shapeId;
    }

    public final int getBlipId()
    {
        if(!initialized)
            initialize();
        return blipId;
    }

    public MsoDrawingRecord getMsoDrawingRecord()
    {
        return msoDrawingRecord;
    }

    public EscherContainer getSpContainer()
    {
        if(!initialized)
            initialize();
        Assert.verify(origin == Origin.READ);
        return getReadSpContainer();
    }

    public void setDrawingGroup(DrawingGroup dg)
    {
        drawingGroup = dg;
    }

    public DrawingGroup getDrawingGroup()
    {
        return drawingGroup;
    }

    public Origin getOrigin()
    {
        return origin;
    }

    public int getReferenceCount()
    {
        return referenceCount;
    }

    public void setReferenceCount(int r)
    {
        referenceCount = r;
    }

    public double getX()
    {
        if(!initialized)
            initialize();
        return x;
    }

    public void setX(double x)
    {
        if(origin == Origin.READ)
        {
            if(!initialized)
                initialize();
            origin = Origin.READ_WRITE;
        }
        this.x = x;
    }

    public double getY()
    {
        if(!initialized)
            initialize();
        return y;
    }

    public void setY(double y)
    {
        if(origin == Origin.READ)
        {
            if(!initialized)
                initialize();
            origin = Origin.READ_WRITE;
        }
        this.y = y;
    }

    public double getWidth()
    {
        if(!initialized)
            initialize();
        return width;
    }

    public void setWidth(double w)
    {
        if(origin == Origin.READ)
        {
            if(!initialized)
                initialize();
            origin = Origin.READ_WRITE;
        }
        width = w;
    }

    public double getHeight()
    {
        if(!initialized)
            initialize();
        return height;
    }

    public void setHeight(double h)
    {
        if(origin == Origin.READ)
        {
            if(!initialized)
                initialize();
            origin = Origin.READ_WRITE;
        }
        height = h;
    }

    private EscherContainer getReadSpContainer()
    {
        if(!initialized)
            initialize();
        return readSpContainer;
    }

    public byte[] getImageData()
    {
        Assert.verify(false);
        Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE);
        if(!initialized)
            initialize();
        return drawingGroup.getImageData(blipId);
    }

    public byte[] getImageBytes()
        throws IOException
    {
        Assert.verify(false);
        if(origin == Origin.READ || origin == Origin.READ_WRITE)
            return getImageData();
        Assert.verify(origin == Origin.WRITE);
        if(imageFile == null)
        {
            Assert.verify(imageData != null);
            return imageData;
        } else
        {
            byte data[] = new byte[(int)imageFile.length()];
            FileInputStream fis = new FileInputStream(imageFile);
            fis.read(data, 0, data.length);
            fis.close();
            return data;
        }
    }

    public ShapeType getType()
    {
        return type;
    }

    public void writeAdditionalRecords(jxl.write.biff.File file)
        throws IOException
    {
    }

    public void writeTailRecords(jxl.write.biff.File file)
        throws IOException
    {
    }

    public double getColumn()
    {
        return getX();
    }

    public double getRow()
    {
        return getY();
    }

    public boolean isFirst()
    {
        return msoDrawingRecord.isFirst();
    }

    public boolean isFormObject()
    {
        return false;
    }

    public void removeRow(int r)
    {
        if(y > (double)r)
            setY(r);
    }

    public String getImageFilePath()
    {
        Assert.verify(false);
        return 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$Drawing != null ? class$jxl$biff$drawing$Drawing : (class$jxl$biff$drawing$Drawing = class$("jxl.biff.drawing.Drawing")));
    }
}

⌨️ 快捷键说明

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