1 2 17 18 19 package org.apache.poi.hssf.record; 20 21 import org.apache.poi.util.LittleEndian; 22 23 30 31 public class HideObjRecord 32 extends Record 33 { 34 public final static short sid = 0x8d; 35 public final static short HIDE_ALL = 2; 36 public final static short SHOW_PLACEHOLDERS = 1; 37 public final static short SHOW_ALL = 0; 38 private short field_1_hide_obj; 39 40 public HideObjRecord() 41 { 42 } 43 44 51 52 public HideObjRecord(short id, short size, byte [] data) 53 { 54 super(id, size, data); 55 } 56 57 65 66 public HideObjRecord(short id, short size, byte [] data, int offset) 67 { 68 super(id, size, data, offset); 69 } 70 71 protected void validateSid(short id) 72 { 73 if (id != sid) 74 { 75 throw new RecordFormatException("NOT A HIDEOBJ RECORD"); 76 } 77 } 78 79 protected void fillFields(byte [] data, short size, int offset) 80 { 81 field_1_hide_obj = LittleEndian.getShort(data, 0 + offset); 82 } 83 84 92 93 public void setHideObj(short hide) 94 { 95 field_1_hide_obj = hide; 96 } 97 98 106 107 public short getHideObj() 108 { 109 return field_1_hide_obj; 110 } 111 112 public String toString() 113 { 114 StringBuffer buffer = new StringBuffer (); 115 116 buffer.append("[HIDEOBJ]\n"); 117 buffer.append(" .hideobj = ") 118 .append(Integer.toHexString(getHideObj())).append("\n"); 119 buffer.append("[/HIDEOBJ]\n"); 120 return buffer.toString(); 121 } 122 123 public int serialize(int offset, byte [] data) 124 { 125 LittleEndian.putShort(data, 0 + offset, sid); 126 LittleEndian.putShort(data, 2 + offset, 127 (( short ) 0x02)); LittleEndian.putShort(data, 4 + offset, getHideObj()); 129 return getRecordSize(); 130 } 131 132 public int getRecordSize() 133 { 134 return 6; 135 } 136 137 public short getSid() 138 { 139 return this.sid; 140 } 141 } 142 | Popular Tags |