1 19 20 package jxl.write.biff; 21 22 import jxl.biff.Type; 23 import jxl.biff.IntegerHelper; 24 import jxl.biff.WritableRecordData; 25 26 29 class SelectionRecord extends WritableRecordData 30 { 31 34 private PaneType pane; 35 36 39 private int column; 40 41 44 private int row; 45 46 private static class PaneType 48 { 49 int val; 50 51 PaneType(int v) 52 {val = v;} 53 } 54 55 public final static PaneType lowerRight = new PaneType(0); 57 public final static PaneType upperRight = new PaneType(1); 58 public final static PaneType lowerLeft = new PaneType(2); 59 public final static PaneType upperLeft = new PaneType(3); 60 61 64 public SelectionRecord(PaneType pt, int col, int r) 65 { 66 super(Type.SELECTION); 67 column = col; 68 row = r; 69 pane = pt; 70 } 71 72 77 public byte[] getData() 78 { 79 byte[] data = new byte[15]; 81 82 data[0] = (byte) pane.val; 83 IntegerHelper.getTwoBytes(row, data, 1); 84 IntegerHelper.getTwoBytes(column, data, 3); 85 86 data[7] = (byte) 0x01; 87 88 IntegerHelper.getTwoBytes(row, data, 9); 89 IntegerHelper.getTwoBytes(row, data, 11); 90 data[13] = (byte) column; 91 data[14] = (byte) column; 92 93 return data; 94 } 95 } 96 | Popular Tags |