1 19 20 package jxl.biff.drawing; 21 22 import jxl.biff.IntegerHelper; 23 24 27 class Dg extends EscherAtom 28 { 29 32 private byte[] data; 33 34 37 private int drawingId; 38 39 42 private int shapeCount; 43 44 47 private int seed; 48 49 54 public Dg(EscherRecordData erd) 55 { 56 super(erd); 57 drawingId = getInstance(); 58 59 byte[] bytes = getBytes(); 60 shapeCount = IntegerHelper.getInt(bytes[0], bytes[1], bytes[2], bytes[3]); 61 seed = IntegerHelper.getInt(bytes[4], bytes[5], bytes[6], bytes[7]); 62 } 63 64 69 public Dg(int numDrawings) 70 { 71 super(EscherRecordType.DG); 72 drawingId = 1; 73 shapeCount = numDrawings+1; 74 seed = 1024+shapeCount+1; 75 setInstance(drawingId); 76 } 77 78 83 public int getDrawingId() 84 { 85 return drawingId; 86 } 87 88 93 byte[] getData() 94 { 95 data = new byte[8]; 96 IntegerHelper.getFourBytes(shapeCount, data, 0); 97 IntegerHelper.getFourBytes(seed, data, 4); 98 99 return setHeaderData(data); 100 } 101 } 102 | Popular Tags |