📄 area3d.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: Area3d.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, FormulaException, ParsedThing, ExternalSheet,
// Token
class Area3d extends Operand
implements ParsedThing
{
private static Logger logger;
private int sheet;
private int columnFirst;
private int rowFirst;
private int columnLast;
private int rowLast;
private boolean columnFirstRelative;
private boolean rowFirstRelative;
private boolean columnLastRelative;
private boolean rowLastRelative;
private ExternalSheet workbook;
static Class class$jxl$biff$formula$Area3d; /* synthetic field */
Area3d(ExternalSheet es)
{
workbook = es;
}
Area3d(String s, ExternalSheet es)
throws FormulaException
{
workbook = es;
int seppos = s.lastIndexOf(":");
Assert.verify(seppos != -1);
String endcell = s.substring(seppos + 1);
int sep = s.indexOf(33);
String cellString = s.substring(sep + 1, seppos);
columnFirst = CellReferenceHelper.getColumn(cellString);
rowFirst = CellReferenceHelper.getRow(cellString);
String sheetName = s.substring(0, sep);
if(sheetName.charAt(0) == '\'' && sheetName.charAt(sheetName.length() - 1) == '\'')
sheetName = sheetName.substring(1, sheetName.length() - 1);
sheet = es.getExternalSheetIndex(sheetName);
if(sheet < 0)
{
throw new FormulaException(FormulaException.SHEET_REF_NOT_FOUND, sheetName);
} else
{
columnLast = CellReferenceHelper.getColumn(endcell);
rowLast = CellReferenceHelper.getRow(endcell);
columnFirstRelative = true;
rowFirstRelative = true;
columnLastRelative = true;
rowLastRelative = true;
return;
}
}
int getFirstColumn()
{
return columnFirst;
}
int getFirstRow()
{
return rowFirst;
}
int getLastColumn()
{
return columnLast;
}
int getLastRow()
{
return rowLast;
}
public int read(byte data[], int pos)
{
sheet = IntegerHelper.getInt(data[pos], data[pos + 1]);
rowFirst = IntegerHelper.getInt(data[pos + 2], data[pos + 3]);
rowLast = IntegerHelper.getInt(data[pos + 4], data[pos + 5]);
int columnMask = IntegerHelper.getInt(data[pos + 6], data[pos + 7]);
columnFirst = columnMask & 0xff;
columnFirstRelative = (columnMask & 0x4000) != 0;
rowFirstRelative = (columnMask & 0x8000) != 0;
columnMask = IntegerHelper.getInt(data[pos + 8], data[pos + 9]);
columnLast = columnMask & 0xff;
columnLastRelative = (columnMask & 0x4000) != 0;
rowLastRelative = (columnMask & 0x8000) != 0;
return 10;
}
public void getString(StringBuffer buf)
{
CellReferenceHelper.getCellReference(sheet, columnFirst, rowFirst, workbook, buf);
buf.append(':');
CellReferenceHelper.getCellReference(columnLast, rowLast, buf);
}
byte[] getBytes()
{
byte data[] = new byte[11];
data[0] = Token.AREA3D.getCode();
IntegerHelper.getTwoBytes(sheet, data, 1);
IntegerHelper.getTwoBytes(rowFirst, data, 3);
IntegerHelper.getTwoBytes(rowLast, data, 5);
int grcol = columnFirst;
if(rowFirstRelative)
grcol |= 0x8000;
if(columnFirstRelative)
grcol |= 0x4000;
IntegerHelper.getTwoBytes(grcol, data, 7);
grcol = columnLast;
if(rowLastRelative)
grcol |= 0x8000;
if(columnLastRelative)
grcol |= 0x4000;
IntegerHelper.getTwoBytes(grcol, data, 9);
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;
}
public void columnInserted(int sheetIndex, int col, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(columnFirst >= col)
columnFirst++;
if(columnLast >= col)
columnLast++;
}
void columnRemoved(int sheetIndex, int col, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(col < columnFirst)
columnFirst--;
if(col <= columnLast)
columnLast--;
}
void rowInserted(int sheetIndex, int row, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(rowLast == 65535)
return;
if(row <= rowFirst)
rowFirst++;
if(row <= rowLast)
rowLast++;
}
void rowRemoved(int sheetIndex, int row, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(rowLast == 65535)
return;
if(row < rowFirst)
rowFirst--;
if(row <= rowLast)
rowLast--;
}
protected void setRangeData(int sht, int colFirst, int colLast, int rwFirst, int rwLast, boolean colFirstRel, boolean colLastRel,
boolean rowFirstRel, boolean rowLastRel)
{
sheet = sht;
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$Area3d != null ? class$jxl$biff$formula$Area3d : (class$jxl$biff$formula$Area3d = class$("jxl.biff.formula.Area3d")));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -