版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、10342198176543215161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263package jxl.biff.drawing;import common.Assert;import common.Logger;import java.io.IOException;import jxl.WorkbookSettings;import jxl.write.biff.File;Store management class ComboBoximpleme
2、nts DrawingGroupObjectprivate static Logger logger = Logger.getLogger(ComboBox.class);private EscherContainer readSpContainer;private EscherContainer spContainer;private MsoDrawingRecord msoDrawingRecord;private ObjRecord objRecord;private boolean initialized = false;private int objectId;private int
3、 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 drawingNu
4、mber;private WorkbookSettings workbookSettings;Store management ComboBox(MsoDrawingRecord mso, ObjRecord obj, DrawingData dd, DrawingGroup dg, WorkbookSettings ws)this.drawingGroup = dg; this.msoDrawingRecord = mso;this.drawingData = dd;this.objRecord = obj;this.initialized = false;this.workbookSett
5、ings = ws; this.origin = Origin.READ; this.drawingData.addData(this.msoDrawingRecord.getData(); this.drawingNumber = (this.drawingData.getNumDrawings() - 1); this.drawingGroup.addDrawing(this);Assert.verify(mso != null) & (obj != null);6465666768697071727374757677787980818283848586878889909192939495
6、96979899 100 101 102 103 104 105 106 107 108 109 110 111 112 113initialize();dg,Store management ComboBox(DrawingGroupObject dgo, DrawingGroup WorkbookSettings ws)ComboBox d = (ComboBox)dgo;Assert.verify(d.origin = Origin.READ); this.msoDrawingRecord = d.msoDrawingRecord;this.objRecord = d.objRecord
7、; this.initialized = false;this.origin = Origin.READ; this.drawingData = d.drawingData;this.drawingGroup = dg;this.drawingNumber = d.drawingNumber; this.drawingGroup.addDrawing(this);this.workbookSettings = ws;Store management ComboBox()this.initialized = true;this.origin = Origin.WRITE;this.referen
8、ceCount = 1;this.type = ShapeType.HOST_CONTROL;private void initialize()this.readSpContainer = this.drawingData.getSpContainer(this.drawingNumber);Assert.verify(this.readSpContainer != null);EscherRecord children = this.readSpContainer.getChildren();Sp sp = (Sp)this.readSpContainer.getChildren()0; t
9、his.objectId = this.objRecord.getObjectId();this.shapeId = sp.getShapeId();this.type = ShapeType.getType(sp.getShapeType();if (this.type = ShapeType.UNKNOWN) logger.warn(Unknown shape type);ClientAnchor clientAnchor = null;for (int i = 0; (i children.length) & (clientAnchor = null); i+)if (childreni
10、.getType() = EscherRecordType.CLIENT_ANCHOR)114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163clientAnchor = (ClientAnchor)childreni; if (clientAnchor = null)logger.warn(Client anchor not found);elset
11、his.column = (int)clientAnchor.getX1(); this.row = (int)clientAnchor.getY1();this.initialized = true;Store management final void setObjectId(int objid, int bip, int sid) this.objectId = objid; this.blipId = bip;this.shapeId = sid;if (this.origin = Origin.READ)this.origin = Origin.READ_WRITE;Store ma
12、nagement final int getObjectId() if (!this.initialized)initialize();return this.objectId;Store management final int getShapeId() if (!this.initialized)initialize();return this.shapeId;Store management final int getBlipId()164165166167168169170171172173174175176177178179180181182183184185186187188189
13、190191192193194195196197198199200201202203204205206207208209210211212213if (!this.initialized) initialize();return this.blipId;Store management MsoDrawingRecord getMsoDrawingRecord()return this.msoDrawingRecord;Store management EscherContainer getSpContainer()if (!this.initialized) initialize();if (
14、this.origin = Origin.READ) return getReadSpContainer();SpContainer spc = new SpContainer();Sp sp = new Sp(this.type, this.shapeId, 2560); spc.add(sp);Opt opt = new Opt(); opt.addProperty(127, false, false, 17039620); opt.addProperty(191, false, false, 524296); opt.addProperty(511, false, false, 5242
15、88); opt.addProperty(959, false, false, 131072);spc.add(opt);this.column + 1,ClientAnchor clientAnchor = new ClientAnchor(this.column, this.row, this.row + 1);spc.add(clientAnchor);ClientData clientData = new ClientData(); spc.add(clientData);return spc;Store management void setDrawingGroup(DrawingG
16、roup dg) this.drawingGroup = dg;214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263Store management DrawingGroup getDrawingGroup() return this.drawingGroup;Store management Origin getOrigin()return thi
17、s.origin;Store management int getReferenceCount()return this.referenceCount;Store management void setReferenceCount(int r) this.referenceCount = r;Store management double getX()if (!this.initialized) initialize();return this.column;Store management void setX(double x)if (this.origin = Origin.READ)if
18、 (!this.initialized) initialize(); this.origin = Origin.READ_WRITE;this.column = (int)x);Store management double getY()if (!this.initialized) initialize();2642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113
19、12313return this.row;Store management void setY(double y)if (this.origin = Origin.READ)if (!this.initialized) initialize();this.origin = Origin.READ_WRITE;this.row = (int)y);Store management double getWidth()if (!this.initialized) initialize();return this.width;Store management void setWidth(double
20、w) if (this.origin = Origin.READ)if (!this.initialized) initialize();this.origin = Origin.READ_WRITE;this.width = w;Store management double getHeight()if (!this.initialized) initialize();31431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035
21、1352353354355356357358359360361362363return this.height;Store management void setHeight(double h)if (this.origin = Origin.READ)if (!this.initialized)initialize();this.origin = Origin.READ_WRITE;this.height = h;private EscherContainer getReadSpContainer() if (!this.initialized)initialize();return thi
22、s.readSpContainer; Store management byte getImageData()Assert.verify(this.origin = Origin.READ) | (this.origin = Origin.READ_WRITE);if (!this.initialized) initialize();return this.drawingGroup.getImageData(this.blipId); Store management ShapeType getType()return this.type;Store management byte getIm
23、ageBytes()Assert.verify(false);return null;364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413Store management String getImageFilePath()Assert.verify(false);return null;Store management void writeAddit
24、ionalRecords(File outputFile)throws IOExceptionif (this.origin = Origin.READ) outputFile.write(this.objRecord); return;ObjRecord objrec = new ObjRecord(this.objectId, ObjRecord.COMBOBOX);outputFile.write(objrec);Store management void writeTailRecords(File outputFile) Store management int getRow()ret
25、urn 0;Store management int getColumn()return 0;Store management int hashCode()return getClass().getName().hashCode();Store management boolean isFirst()return this.msoDrawingRecord.isFirst();Store management boolean isFormObject()return false;4144154164174184194204214224234244254264274284294304314324
26、33434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463package jxl.biff.drawing;import common.Assert;import common.Logger;import java.io.IOException;import jxl.WorkbookSettings;import jxl.biff.ContinueRecord;import jxl.biff.IntegerHelper;import jxl.biff.StringHel
27、per;import jxl.write.biff.File;Store management class Commentimplements DrawingGroupObjectprivate static Logger logger = Logger.getLogger(Comment.class);private EscherContainer readSpContainer;private EscherContainer spContainer;private MsoDrawingRecord msoDrawingRecord;private ObjRecord objRecord;p
28、rivate boolean initialized = false;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 D
29、rawingData drawingData;private ShapeType type;private int drawingNumber;private MsoDrawingRecord mso;private TextObjectRecord txo;private NoteRecord note;private ContinueRecord text;private ContinueRecord formatting;private String commentText;private WorkbookSettings workbookSettings;Store managemen
30、t Comment(MsoDrawingRecord msorec, ObjRecord obj, DrawingData dd, DrawingGroup dg, WorkbookSettings ws)this.drawingGroup = dg; this.msoDrawingRecord = msorec;this.drawingData = dd;this.objRecord = obj;464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
31、49749849950050150250350450550650750850951051151251310this.initialized = false; this.workbookSettings = ws;this.origin = Origin.READ; this.drawingData.addData(this.msoDrawingRecord.getData(); this.drawingNumber = (this.drawingData.getNumDrawings() - 1); this.drawingGroup.addDrawing(this);Assert.verif
32、y(this.msoDrawingRecord != null) & (this.objRecord != null);if (!this.initialized)initialize();Store management Comment(DrawingGroupObject dgo, DrawingGroup dg, WorkbookSettings ws)Comment d = (Comment)dgo;Assert.verify(d.origin = Origin.READ); this.msoDrawingRecord = d.msoDrawingRecord;this.objReco
33、rd = d.objRecord; this.initialized = false;this.origin = Origin.READ; this.drawingData = d.drawingData;this.drawingGroup = dg; this.drawingNumber = d.drawingNumber; this.drawingGroup.addDrawing(this);this.mso = d.mso;this.txo = d.txo;this.text = d.text;this.formatting = d.formatting; this.note = d.n
34、ote;this.width = d.width;this.height = d.height; this.workbookSettings = ws;Store management Comment(String txt, int c, int r) this.initialized = true; this.origin = Origin.WRITE; this.column = c;this.row = r; this.referenceCount = 1;this.type = ShapeType.TEXT_BOX; mentText = txt;this.width = 3.0D;
35、this.height = 4.0D;51451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256311private void initialize()this.readSpContainer = this.drawingData.getSpContainer(this.drawingNumber);Assert.verify(this.readSpCont
36、ainer != null);EscherRecord children = this.readSpContainer.getChildren();Sp sp = (Sp)this.readSpContainer.getChildren()0;this.objectId = this.objRecord.getObjectId();this.shapeId = sp.getShapeId();this.type = ShapeType.getType(sp.getShapeType();if (this.type = ShapeType.UNKNOWN)logger.warn(Unknown
37、shape type);ClientAnchor clientAnchor = null;for (int i = 0; (i children.length) & (clientAnchor = null); i+)if (childreni.getType() = EscherRecordType.CLIENT_ANCHOR)clientAnchor = (ClientAnchor)childreni;if (clientAnchor = null)logger.warn(client anchor not found);elsethis.column = (int)clientAncho
38、r.getX1() - 1);this.row = (int)clientAnchor.getY1() + 1);this.width = (clientAnchor.getX2() - clientAnchor.getX1();this.height = (clientAnchor.getY2() - clientAnchor.getY1();this.initialized = true;Store management final void setObjectId(int objid, int bip, int sid)this.objectId = objid;this.blipId
39、= bip;this.shapeId = sid;56456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261312if (this.origin = Origin.READ)this.origin = Origin.READ_WRITE;Store management final int getObjectId()if (!this.initialized
40、)initialize();return this.objectId;Store management final int getShapeId()if (!this.initialized)initialize();return this.shapeId;Store management final int getBlipId()if (!this.initialized)initialize();return this.blipId;Store management MsoDrawingRecord getMsoDrawingRecord() return this.msoDrawingR
41、ecord;Store management EscherContainer getSpContainer() if (!this.initialized) initialize();if (this.origin = Origin.READ)61461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266313return getReadSpContainer(
42、);if (this.spContainer = null) this.spContainer = new SpContainer(); Sp sp = new Sp(this.type, this.shapeId, 2560); this.spContainer.add(sp); Opt opt = new Opt(); opt.addProperty(344, false, false, 0); opt.addProperty(385, false, false, 134217808); opt.addProperty(387, false, false, 134217808); opt.
43、addProperty(959, false, false, 131074); this.spContainer.add(opt);ClientAnchor clientAnchor = new ClientAnchor(this.column + 1.3D, Math.max(0.0D, this.row - 0.6D), this.column + 1.3D + this.width, this.row + this.height);this.spContainer.add(clientAnchor);ClientData clientData = new ClientData(); th
44、is.spContainer.add(clientData);ClientTextBox clientTextBox = new ClientTextBox(); this.spContainer.add(clientTextBox);return this.spContainer;Store management void setDrawingGroup(DrawingGroup dg)this.drawingGroup = dg;Store management DrawingGroup getDrawingGroup()return this.drawingGroup;Store man
45、agement Origin getOrigin()return this.origin;Store management int getReferenceCount()return this.referenceCount;66466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271314Store management void setReferenceCo
46、unt(int r) this.referenceCount = r;Store management double getX() if (!this.initialized) initialize();return this.column;Store management void setX(double x) if (this.origin = Origin.READ)if (!this.initialized) initialize(); this.origin = Origin.READ_WRITE;this.column = (int)x);Store management doub
47、le getY() if (!this.initialized) initialize();return this.row;Store management void setY(double y) if (this.origin = Origin.READ)if (!this.initialized) initialize(); this.origin = Origin.READ_WRITE;this.row = (int)y);71471571671771871972072172272372472572672772872973073173273373473573673773873974074
48、174274374474574674774874975075175275375475575675775875976076176276315Store management double getWidth()if (!this.initialized) initialize();return this.width;Store management void setWidth(double w)if (this.origin = Origin.READ)if (!this.initialized) initialize();this.origin = Origin.READ_WRITE;this.
49、width = w;Store management double getHeight()if (!this.initialized) initialize();return this.height;Store management void setHeight(double h)if (this.origin = Origin.READ)if (!this.initialized) initialize();this.origin = Origin.READ_WRITE;this.height = h;764765766767768769770771772773774775776777778
50、77978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281316private EscherContainer getReadSpContainer() if (!this.initialized)initialize();return this.readSpContainer; Store management byte getImageData()Assert.verify(this.origin = Origin.READ) | (this.origin = Origin.READ_WRITE);if (!this.initialized) i
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 校運會彩繪施工合同
- 國際地下工程合同模板
- 煙草公司研發(fā)人員聘用合同
- 地下商場建設鉆孔服務協(xié)議
- 商務合作事業(yè)部管理辦法
- 交通運輸安全員聘任合同樣本
- 電商運營博雅聘用合同
- 供冷安全管理辦法
- 電信弱電工程承包合同模板
- 鐵路運輸用電安全協(xié)議
- 金手指外觀檢驗重點標準
- 電機維護保養(yǎng)作業(yè)指導書
- 國家開放大學《實用心理學》形考任務1-4參考答案
- 撤回支付令異議申請書
- 公元紀年法-完整版PPT
- 小學語文人教五年級上冊(統(tǒng)編2023年更新)第五單元-群文閱讀《說明方法的妙用》教學設計
- 高中英語外研版高中選修7Scopeandsequence-英語長難句教學反思
- 內部控制案例第06章案例18 樂視
- 科技金融項目銀行工作總結匯報PPT模板
- 品質異常升級管理規(guī)定
- 實驗室ISO17025認證推進計劃表
評論
0/150
提交評論