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

WSBoolRecord

public class WSBoolRecord extends Record
Title: WSBool Record.

Description: stores workbook settings (aka its a big "everything we didn't put somewhere else")

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

author
Andrew C. Oliver (acoliver at apache dot org)
author
Glen Stampoultzis (gstamp@iprimus.com.au)
author
Jason Height (jheight at chariot dot net dot au)
version
2.0-pre

Fields Summary
public static final short
sid
private byte
field_1_wsbool
private byte
field_2_wsbool
private static final BitField
autobreaks
private static final BitField
dialog
private static final BitField
applystyles
private static final BitField
rowsumsbelow
private static final BitField
rowsumsright
private static final BitField
fittopage
private static final BitField
displayguts
private static final BitField
alternateexpression
private static final BitField
alternateformula
Constructors Summary
public WSBoolRecord()


     
    
    
public WSBoolRecord(RecordInputStream in)
Constructs a WSBool record and sets its fields appropriately.

param
id id must be 0x81 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()

      WSBoolRecord rec = new WSBoolRecord();
      rec.field_1_wsbool = field_1_wsbool;
      rec.field_2_wsbool = field_2_wsbool;
      return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

       byte data[] = in.readRemainder();
        field_1_wsbool =
            data[ 1 ];   // backwards because theoretically this is one short field
        field_2_wsbool =
            data[ 0 ];   // but it was easier to implement it this way to avoid confusion
    
public booleangetAlternateExpression()
whether alternate expression evaluation is on

return
alternative expression evaluation or not

        return alternateexpression.isSet(field_2_wsbool);
    
public booleangetAlternateFormula()
whether alternative formula entry is on

return
alternative formulas or not

        return alternateformula.isSet(field_2_wsbool);
    
public booleangetAutobreaks()
show automatic page breaks or not

return
whether to show auto page breaks

        return autobreaks.isSet(field_1_wsbool);
    
public booleangetDialog()
get whether sheet is a dialog sheet or not

return
isDialog or not

        return dialog.isSet(field_1_wsbool);
    
public booleangetDisplayGuts()
get whether to display the guts or not

return
guts or no guts (or glory)

        return displayguts.isSet(field_2_wsbool);
    
public booleangetFitToPage()
fit to page option is on

return
fit or not

        return fittopage.isSet(field_2_wsbool);
    
public intgetRecordSize()

        return 6;
    
public booleangetRowSumsBelow()
get if row summaries appear below detail in the outline

return
below or not

        return rowsumsbelow.isSet(field_1_wsbool);
    
public booleangetRowSumsRight()
get if col summaries appear right of the detail in the outline

return
right or not

        return rowsumsright.isSet(field_1_wsbool);
    
public shortgetSid()

        return sid;
    
public bytegetWSBool1()
get first byte (see bit getters)

        return field_1_wsbool;
    
public bytegetWSBool2()
get the second byte (see bit getters)

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

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
        data[ 5 + offset ] = getWSBool1();
        data[ 4 + offset ] = getWSBool2();
        return getRecordSize();
    
public voidsetAlternateExpression(boolean altexp)
whether alternate expression evaluation is on

param
altexp alternative expression evaluation or not

        field_2_wsbool = alternateexpression.setByteBoolean(field_2_wsbool,
                altexp);
    
public voidsetAlternateFormula(boolean formula)
whether alternative formula entry is on

param
formula alternative formulas or not

        field_2_wsbool = alternateformula.setByteBoolean(field_2_wsbool,
                formula);
    
public voidsetAutobreaks(boolean ab)
show automatic page breaks or not

param
ab whether to show auto page breaks

        field_1_wsbool = autobreaks.setByteBoolean(field_1_wsbool, ab);
    
public voidsetDialog(boolean isDialog)
set whether sheet is a dialog sheet or not

param
isDialog or not

        field_1_wsbool = dialog.setByteBoolean(field_1_wsbool, isDialog);
    
public voidsetDisplayGuts(boolean guts)
set whether to display the guts or not

param
guts or no guts (or glory)

        field_2_wsbool = displayguts.setByteBoolean(field_2_wsbool, guts);
    
public voidsetFitToPage(boolean fit2page)
fit to page option is on

param
fit2page fit or not

        field_2_wsbool = fittopage.setByteBoolean(field_2_wsbool, fit2page);
    
public voidsetRowSumsBelow(boolean below)
set if row summaries appear below detail in the outline

param
below or not

        field_1_wsbool = rowsumsbelow.setByteBoolean(field_1_wsbool, below);
    
public voidsetRowSumsRight(boolean right)
set if col summaries appear right of the detail in the outline

param
right or not

        field_1_wsbool = rowsumsright.setByteBoolean(field_1_wsbool, right);
    
public voidsetWSBool1(byte bool1)
set first byte (see bit setters)

        field_1_wsbool = bool1;
    
public voidsetWSBool2(byte bool2)
set the second byte (see bit setters)

        field_2_wsbool = bool2;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[WSBOOL]\n");
        buffer.append("    .wsbool1        = ")
            .append(Integer.toHexString(getWSBool1())).append("\n");
        buffer.append("        .autobreaks = ").append(getAutobreaks())
            .append("\n");
        buffer.append("        .dialog     = ").append(getDialog())
            .append("\n");
        buffer.append("        .rowsumsbelw= ").append(getRowSumsBelow())
            .append("\n");
        buffer.append("        .rowsumsrigt= ").append(getRowSumsRight())
            .append("\n");
        buffer.append("    .wsbool2        = ")
            .append(Integer.toHexString(getWSBool2())).append("\n");
        buffer.append("        .fittopage  = ").append(getFitToPage())
            .append("\n");
        buffer.append("        .displayguts= ").append(getDisplayGuts())
            .append("\n");
        buffer.append("        .alternateex= ")
            .append(getAlternateExpression()).append("\n");
        buffer.append("        .alternatefo= ").append(getAlternateFormula())
            .append("\n");
        buffer.append("[/WSBOOL]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)

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