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

📄 area.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:   Area.java

package jxl.biff.formula;

import common.Assert;
import common.Logger;
import jxl.biff.CellReferenceHelper;
import jxl.biff.IntegerHelper;

// Referenced classes of package jxl.biff.formula:
//            Operand, ParsedThing, Token

class Area extends Operand
    implements ParsedThing
{

    private static Logger logger;
    private int columnFirst;
    private int rowFirst;
    private int columnLast;
    private int rowLast;
    private boolean columnFirstRelative;
    private boolean rowFirstRelative;
    private boolean columnLastRelative;
    private boolean rowLastRelative;
    static Class class$jxl$biff$formula$Area; /* synthetic field */

    Area()
    {
    }

    Area(String s)
    {
        int seppos = s.indexOf(":");
        Assert.verify(seppos != -1);
        String startcell = s.substring(0, seppos);
        String endcell = s.substring(seppos + 1);
        columnFirst = CellReferenceHelper.getColumn(startcell);
        rowFirst = CellReferenceHelper.getRow(startcell);
        columnLast = CellReferenceHelper.getColumn(endcell);
        rowLast = CellReferenceHelper.getRow(endcell);
        columnFirstRelative = CellReferenceHelper.isColumnRelative(startcell);
        rowFirstRelative = CellReferenceHelper.isRowRelative(startcell);
        columnLastRelative = CellReferenceHelper.isColumnRelative(endcell);
        rowLastRelative = CellReferenceHelper.isRowRelative(endcell);
    }

    int getFirstColumn()
    {
        return columnFirst;
    }

    int getFirstRow()
    {
        return rowFirst;
    }

    int getLastColumn()
    {
        return columnLast;
    }

    int getLastRow()
    {
        return rowLast;
    }

    public int read(byte data[], int pos)
    {
        rowFirst = IntegerHelper.getInt(data[pos], data[pos + 1]);
        rowLast = IntegerHelper.getInt(data[pos + 2], data[pos + 3]);
        int columnMask = IntegerHelper.getInt(data[pos + 4], data[pos + 5]);
        columnFirst = columnMask & 0xff;
        columnFirstRelative = (columnMask & 0x4000) != 0;
        rowFirstRelative = (columnMask & 0x8000) != 0;
        columnMask = IntegerHelper.getInt(data[pos + 6], data[pos + 7]);
        columnLast = columnMask & 0xff;
        columnLastRelative = (columnMask & 0x4000) != 0;
        rowLastRelative = (columnMask & 0x8000) != 0;
        return 8;
    }

    public void getString(StringBuffer buf)
    {
        CellReferenceHelper.getCellReference(columnFirst, rowFirst, buf);
        buf.append(':');
        CellReferenceHelper.getCellReference(columnLast, rowLast, buf);
    }

    byte[] getBytes()
    {
        byte data[] = new byte[9];
        data[0] = useAlternateCode() ? Token.AREA.getCode2() : Token.AREA.getCode();
        IntegerHelper.getTwoBytes(rowFirst, data, 1);
        IntegerHelper.getTwoBytes(rowLast, data, 3);
        int grcol = columnFirst;
        if(rowFirstRelative)
            grcol |= 0x8000;
        if(columnFirstRelative)
            grcol |= 0x4000;
        IntegerHelper.getTwoBytes(grcol, data, 5);
        grcol = columnLast;
        if(rowLastRelative)
            grcol |= 0x8000;
        if(columnLastRelative)
            grcol |= 0x4000;
        IntegerHelper.getTwoBytes(grcol, data, 7);
        return data;
    }

    public void adjustRelativeCellReferences(int colAdjust, int rowAdjust)
    {
        if(columnFirstRelative)
            columnFirst += colAdjust;
        if(columnLastRelative)
            columnLast += colAdjust;
        if(rowFirstRelative)
            rowFirst += rowAdjust;
        if(rowLastRelative)
            rowLast += rowAdjust;
    }

    void columnInserted(int sheetIndex, int col, boolean currentSheet)
    {
        if(!currentSheet)
            return;
        if(col <= columnFirst)
            columnFirst++;
        if(col <= columnLast)
            columnLast++;
    }

    void columnRemoved(int sheetIndex, int col, boolean currentSheet)
    {
        if(!currentSheet)
            return;
        if(col < columnFirst)
            columnFirst--;
        if(col <= columnLast)
            columnLast--;
    }

    void rowInserted(int sheetIndex, int row, boolean currentSheet)
    {
        if(!currentSheet)
            return;
        if(rowLast == 65535)
            return;
        if(row <= rowFirst)
            rowFirst++;
        if(row <= rowLast)
            rowLast++;
    }

    void rowRemoved(int sheetIndex, int row, boolean currentSheet)
    {
        if(!currentSheet)
            return;
        if(rowLast == 65535)
            return;
        if(row < rowFirst)
            rowFirst--;
        if(row <= rowLast)
            rowLast--;
    }

    protected void setRangeData(int colFirst, int colLast, int rwFirst, int rwLast, boolean colFirstRel, boolean colLastRel, boolean rowFirstRel, 
            boolean rowLastRel)
    {
        columnFirst = colFirst;
        columnLast = colLast;
        rowFirst = rwFirst;
        rowLast = rwLast;
        columnFirstRelative = colFirstRel;
        columnLastRelative = colLastRel;
        rowFirstRelative = rowFirstRel;
        rowLastRelative = rowLastRel;
    }

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

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

⌨️ 快捷键说明

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