FileDocCategorySizeDatePackage
GutsRecord.javaAPI DocApache Poi 3.0.16056Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record

GutsRecord

public class GutsRecord extends Record
Title: Guts Record

Description: Row/column gutter sizes

REFERENCE: PG 320 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

author
Andrew C. Oliver (acoliver at apache dot org)
author
Jason Height (jheight at chariot dot net dot au)
version
2.0-pre

Fields Summary
public static final short
sid
private short
field_1_left_row_gutter
private short
field_2_top_col_gutter
private short
field_3_row_level_max
private short
field_4_col_level_max
Constructors Summary
public GutsRecord()

     // maximum outline level for column gutters

     
    
    
public GutsRecord(RecordInputStream in)
Constructs a Guts record and sets its fields appropriately.

param
id id must be 0x80 or an exception will be throw upon validation
param
size the size of the data area of the record
param
data data of the record (should not contain sid/len)

        super(in);
    
Methods Summary
public java.lang.Objectclone()

      GutsRecord rec = new GutsRecord();
      rec.field_1_left_row_gutter = field_1_left_row_gutter;
      rec.field_2_top_col_gutter = field_2_top_col_gutter;
      rec.field_3_row_level_max = field_3_row_level_max;
      rec.field_4_col_level_max = field_4_col_level_max;
      return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

        field_1_left_row_gutter = in.readShort();
        field_2_top_col_gutter  = in.readShort();
        field_3_row_level_max   = in.readShort();
        field_4_col_level_max   = in.readShort();
    
public shortgetColLevelMax()
get the maximum outline level for the col gutter.

return
maximum outline level

        return field_4_col_level_max;
    
public shortgetLeftRowGutter()
get the size of the gutter that appears at the left of the rows

return
gutter size in screen units

        return field_1_left_row_gutter;
    
public intgetRecordSize()

        return 12;
    
public shortgetRowLevelMax()
get the maximum outline level for the row gutter.

return
maximum outline level

        return field_3_row_level_max;
    
public shortgetSid()

        return sid;
    
public shortgetTopColGutter()
get the size of the gutter that appears at the above the columns

return
gutter size in screen units

        return field_2_top_col_gutter;
    
public intserialize(int offset, byte[] data)

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, ( short ) 0x8);
        LittleEndian.putShort(data, 4 + offset, getLeftRowGutter());
        LittleEndian.putShort(data, 6 + offset, getTopColGutter());
        LittleEndian.putShort(data, 8 + offset, getRowLevelMax());
        LittleEndian.putShort(data, 10 + offset, getColLevelMax());
        return getRecordSize();
    
public voidsetColLevelMax(short max)
set the maximum outline level for the col gutter.

param
max maximum outline level

        field_4_col_level_max = max;
    
public voidsetLeftRowGutter(short gut)
set the size of the gutter that appears at the left of the rows

param
gut gutter size in screen units

        field_1_left_row_gutter = gut;
    
public voidsetRowLevelMax(short max)
set the maximum outline level for the row gutter.

param
max maximum outline level

        field_3_row_level_max = max;
    
public voidsetTopColGutter(short gut)
set the size of the gutter that appears at the above the columns

param
gut gutter size in screen units

        field_2_top_col_gutter = gut;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[GUTS]\n");
        buffer.append("    .leftgutter     = ")
            .append(Integer.toHexString(getLeftRowGutter())).append("\n");
        buffer.append("    .topgutter      = ")
            .append(Integer.toHexString(getTopColGutter())).append("\n");
        buffer.append("    .rowlevelmax    = ")
            .append(Integer.toHexString(getRowLevelMax())).append("\n");
        buffer.append("    .collevelmax    = ")
            .append(Integer.toHexString(getColLevelMax())).append("\n");
        buffer.append("[/GUTS]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)

        if (id != sid)
        {
            throw new RecordFormatException("NOT A Guts RECORD");
        }