📄 combobox.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: ComboBox.java
package jxl.biff.drawing;
import common.Assert;
import common.Logger;
import java.io.IOException;
import jxl.WorkbookSettings;
import jxl.write.biff.File;
// Referenced classes of package jxl.biff.drawing:
// Sp, ClientAnchor, SpContainer, Opt,
// ClientData, ObjRecord, DrawingGroupObject, Origin,
// MsoDrawingRecord, DrawingData, DrawingGroup, ShapeType,
// EscherContainer, EscherRecord, EscherRecordType
public class ComboBox
implements DrawingGroupObject
{
private static Logger logger;
private EscherContainer readSpContainer;
private EscherContainer spContainer;
private MsoDrawingRecord msoDrawingRecord;
private ObjRecord objRecord;
private boolean initialized;
private int objectId;
private int blipId;
private int shapeId;
private int column;
private int row;
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 drawingNumber;
private WorkbookSettings workbookSettings;
static Class class$jxl$biff$drawing$ComboBox; /* synthetic field */
public ComboBox(MsoDrawingRecord mso, ObjRecord obj, DrawingData dd, DrawingGroup dg, WorkbookSettings ws)
{
initialized = false;
drawingGroup = dg;
msoDrawingRecord = mso;
drawingData = dd;
objRecord = obj;
initialized = false;
workbookSettings = ws;
origin = Origin.READ;
drawingData.addData(msoDrawingRecord.getData());
drawingNumber = drawingData.getNumDrawings() - 1;
drawingGroup.addDrawing(this);
Assert.verify(mso != null && obj != null);
initialize();
}
public ComboBox(DrawingGroupObject dgo, DrawingGroup dg, WorkbookSettings ws)
{
initialized = false;
ComboBox d = (ComboBox)dgo;
Assert.verify(d.origin == Origin.READ);
msoDrawingRecord = d.msoDrawingRecord;
objRecord = d.objRecord;
initialized = false;
origin = Origin.READ;
drawingData = d.drawingData;
drawingGroup = dg;
drawingNumber = d.drawingNumber;
drawingGroup.addDrawing(this);
workbookSettings = ws;
}
public ComboBox()
{
initialized = false;
initialized = true;
origin = Origin.WRITE;
referenceCount = 1;
type = ShapeType.HOST_CONTROL;
}
private void initialize()
{
readSpContainer = drawingData.getSpContainer(drawingNumber);
Assert.verify(readSpContainer != null);
EscherRecord children[] = readSpContainer.getChildren();
Sp sp = (Sp)readSpContainer.getChildren()[0];
objectId = objRecord.getObjectId();
shapeId = sp.getShapeId();
type = ShapeType.getType(sp.getShapeType());
if(type == ShapeType.UNKNOWN)
logger.warn("Unknown shape type");
ClientAnchor clientAnchor = null;
for(int i = 0; i < children.length && clientAnchor == null; i++)
if(children[i].getType() == EscherRecordType.CLIENT_ANCHOR)
clientAnchor = (ClientAnchor)children[i];
if(clientAnchor == null)
{
logger.warn("Client anchor not found");
} else
{
column = (int)clientAnchor.getX1();
row = (int)clientAnchor.getY1();
}
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 final 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();
if(origin == Origin.READ)
{
return getReadSpContainer();
} else
{
SpContainer spc = new SpContainer();
Sp sp = new Sp(type, shapeId, 2560);
spc.add(sp);
Opt opt = new Opt();
opt.addProperty(127, false, false, 0x1040104);
opt.addProperty(191, false, false, 0x80008);
opt.addProperty(511, false, false, 0x80000);
opt.addProperty(959, false, false, 0x20000);
spc.add(opt);
ClientAnchor clientAnchor = new ClientAnchor(column, row, column + 1, row + 1);
spc.add(clientAnchor);
ClientData clientData = new ClientData();
spc.add(clientData);
return spc;
}
}
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 (double)column;
}
public void setX(double x)
{
if(origin == Origin.READ)
{
if(!initialized)
initialize();
origin = Origin.READ_WRITE;
}
column = (int)x;
}
public double getY()
{
if(!initialized)
initialize();
return (double)row;
}
public void setY(double y)
{
if(origin == Origin.READ)
{
if(!initialized)
initialize();
origin = Origin.READ_WRITE;
}
row = (int)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(origin == Origin.READ || origin == Origin.READ_WRITE);
if(!initialized)
initialize();
return drawingGroup.getImageData(blipId);
}
public ShapeType getType()
{
return type;
}
public byte[] getImageBytes()
{
Assert.verify(false);
return null;
}
public String getImageFilePath()
{
Assert.verify(false);
return null;
}
public void writeAdditionalRecords(File outputFile)
throws IOException
{
if(origin == Origin.READ)
{
outputFile.write(objRecord);
return;
} else
{
ObjRecord objrec = new ObjRecord(objectId, ObjRecord.COMBOBOX);
outputFile.write(objrec);
return;
}
}
public void writeTailRecords(File file)
{
}
public int getRow()
{
return 0;
}
public int getColumn()
{
return 0;
}
public int hashCode()
{
return getClass().getName().hashCode();
}
public boolean isFirst()
{
return msoDrawingRecord.isFirst();
}
public boolean isFormObject()
{
return false;
}
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$ComboBox != null ? class$jxl$biff$drawing$ComboBox : (class$jxl$biff$drawing$ComboBox = class$("jxl.biff.drawing.ComboBox")));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -