1 19 20 package jxl.biff.drawing; 21 22 import common.Logger; 23 import jxl.biff.IntegerHelper; 24 25 class Sp extends EscherAtom 26 { 27 30 private static Logger logger = Logger.getLogger(Sp.class); 31 32 private byte[] data; 33 private int shapeType; 34 private int shapeId; 35 private int persistenceFlags; 36 37 42 public Sp(EscherRecordData erd) 43 { 44 super(erd); 45 shapeType = getInstance(); 46 byte[] bytes = getBytes(); 47 shapeId = IntegerHelper.getInt(bytes[0], bytes[1], bytes[2], bytes[3]); 48 persistenceFlags = IntegerHelper.getInt(bytes[4], bytes[5], 49 bytes[6], bytes[7]); 50 } 51 52 59 public Sp(ShapeType st, int sid, int p) 60 { 61 super(EscherRecordType.SP); 62 setVersion(2); 63 shapeType = st.value; 64 shapeId = sid; 65 persistenceFlags = p; 66 setInstance(shapeType); 67 } 68 69 int getShapeId() 70 { 71 return shapeId; 72 } 73 74 int getShapeType() 75 { 76 return shapeType; 77 } 78 79 byte[] getData() 80 { 81 data = new byte[8]; 82 IntegerHelper.getFourBytes(shapeId, data, 0); 83 IntegerHelper.getFourBytes(persistenceFlags, data, 4); 84 return setHeaderData(data); 85 } 86 } 87 | Popular Tags |