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

📄 numbervalue.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:   NumberValue.java

package jxl.read.biff;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import jxl.*;
import jxl.biff.FormattingRecords;
import jxl.format.CellFormat;

// Referenced classes of package jxl.read.biff:
//            CellFeaturesAccessor, SheetImpl, ColumnInfoRecord, RowRecord

class NumberValue
    implements NumberCell, CellFeaturesAccessor
{

    private int row;
    private int column;
    private double value;
    private NumberFormat format;
    private CellFormat cellFormat;
    private CellFeatures features;
    private int xfIndex;
    private FormattingRecords formattingRecords;
    private boolean initialized;
    private SheetImpl sheet;
    private static DecimalFormat defaultFormat = new DecimalFormat("#.###");

    public NumberValue(int r, int c, double val, int xfi, FormattingRecords fr, SheetImpl si)
    {
        row = r;
        column = c;
        value = val;
        format = defaultFormat;
        xfIndex = xfi;
        formattingRecords = fr;
        sheet = si;
        initialized = false;
    }

    final void setNumberFormat(NumberFormat f)
    {
        if(f != null)
            format = f;
    }

    public final int getRow()
    {
        return row;
    }

    public final int getColumn()
    {
        return column;
    }

    public double getValue()
    {
        return value;
    }

    public String getContents()
    {
        return format.format(value);
    }

    public CellType getType()
    {
        return CellType.NUMBER;
    }

    public CellFormat getCellFormat()
    {
        if(!initialized)
        {
            cellFormat = formattingRecords.getXFRecord(xfIndex);
            initialized = true;
        }
        return cellFormat;
    }

    public boolean isHidden()
    {
        ColumnInfoRecord cir = sheet.getColumnInfo(column);
        if(cir != null && cir.getWidth() == 0)
            return true;
        RowRecord rr = sheet.getRowInfo(row);
        return rr != null && (rr.getRowHeight() == 0 || rr.isCollapsed());
    }

    public NumberFormat getNumberFormat()
    {
        return format;
    }

    public CellFeatures getCellFeatures()
    {
        return features;
    }

    public void setCellFeatures(CellFeatures cf)
    {
        features = cf;
    }

}

⌨️ 快捷键说明

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