1 19 20 package jxl.biff.drawing; 21 22 import common.Logger; 23 import jxl.biff.IntegerHelper; 24 import jxl.biff.StringHelper; 25 import jxl.biff.WritableRecordData; 26 import jxl.biff.Type; 27 import jxl.read.biff.Record; 28 29 32 public class NoteRecord extends WritableRecordData 33 { 34 37 private static Logger logger = Logger.getLogger(NoteRecord.class); 38 39 42 private byte[] data; 43 44 47 private int row; 48 49 52 private int column; 53 54 57 private int objectId; 58 59 64 public NoteRecord(Record t) 65 { 66 super(t); 67 data = getRecord().getData(); 68 row = IntegerHelper.getInt(data[0], data[1]); 69 column = IntegerHelper.getInt(data[2], data[3]); 70 objectId = IntegerHelper.getInt(data[6], data[7]); 71 } 72 73 78 public NoteRecord(byte[] d) 79 { 80 super(Type.NOTE); 81 data = d; 82 } 83 84 87 public NoteRecord(int c, int r, int id) 88 { 89 super(Type.NOTE); 90 row = r; 91 column = c; 92 objectId = id; 93 } 94 95 100 public byte[] getData() 101 { 102 if (data != null) 103 { 104 return data; 105 } 106 107 String author = ""; 108 data = new byte[8 + author.length() + 4]; 109 110 IntegerHelper.getTwoBytes(row, data, 0); 112 113 IntegerHelper.getTwoBytes(column, data, 2); 115 116 IntegerHelper.getTwoBytes(objectId, data, 6); 118 119 IntegerHelper.getTwoBytes(author.length(), data, 8); 121 122 125 127 return data; 128 } 129 130 133 int getRow() 134 { 135 return row; 136 } 137 138 141 int getColumn() 142 { 143 return column; 144 } 145 146 149 public int getObjectId() 150 { 151 return objectId; 152 } 153 } 154 155 156 157 158 | Popular Tags |