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

TextObjectBaseRecord

public class TextObjectBaseRecord extends Record
The TXO record is used to define the properties of a text box. It is followed by two continue records unless there is no actual text. The first continue record contains the text data and the next continue record contains the formatting runs. NOTE: This source is automatically generated please do not modify this file. Either subclass or remove the record in src/records/definitions.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
public static final short
sid
private short
field_1_options
private BitField
reserved1
private BitField
HorizontalTextAlignment
public static final short
HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED
public static final short
HORIZONTAL_TEXT_ALIGNMENT_CENTERED
public static final short
HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED
public static final short
HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED
private BitField
VerticalTextAlignment
public static final short
VERTICAL_TEXT_ALIGNMENT_TOP
public static final short
VERTICAL_TEXT_ALIGNMENT_CENTER
public static final short
VERTICAL_TEXT_ALIGNMENT_BOTTOM
public static final short
VERTICAL_TEXT_ALIGNMENT_JUSTIFY
private BitField
reserved2
private BitField
textLocked
private BitField
reserved3
private short
field_2_textOrientation
public static final short
TEXT_ORIENTATION_NONE
public static final short
TEXT_ORIENTATION_TOP_TO_BOTTOM
public static final short
TEXT_ORIENTATION_ROT_RIGHT
public static final short
TEXT_ORIENTATION_ROT_LEFT
private short
field_3_reserved4
private short
field_4_reserved5
private short
field_5_reserved6
private short
field_6_textLength
private short
field_7_formattingRunLength
private int
field_8_reserved7
Constructors Summary
public TextObjectBaseRecord()



     
    

    
public TextObjectBaseRecord(RecordInputStream in)
Constructs a TextObjectBase record and sets its fields appropriately.

param
id id must be 0x1B6 or an exception will be throw upon validation
param
size 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()

        TextObjectBaseRecord rec = new TextObjectBaseRecord();
    
        rec.field_1_options = field_1_options;
        rec.field_2_textOrientation = field_2_textOrientation;
        rec.field_3_reserved4 = field_3_reserved4;
        rec.field_4_reserved5 = field_4_reserved5;
        rec.field_5_reserved6 = field_5_reserved6;
        rec.field_6_textLength = field_6_textLength;
        rec.field_7_formattingRunLength = field_7_formattingRunLength;
        rec.field_8_reserved7 = field_8_reserved7;
        return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

        field_1_options                = in.readShort();
        field_2_textOrientation        = in.readShort();
        field_3_reserved4              = in.readShort();
        field_4_reserved5              = in.readShort();
        field_5_reserved6              = in.readShort();
        field_6_textLength             = in.readShort();
        field_7_formattingRunLength    = in.readShort();
        field_8_reserved7              = in.readInt();

    
public shortgetFormattingRunLength()
Get the formatting run length field for the TextObjectBase record.

        return field_7_formattingRunLength;
    
public shortgetHorizontalTextAlignment()

return
the Horizontal text alignment field value.

        return HorizontalTextAlignment.getShortValue(field_1_options);
    
public shortgetOptions()
Get the options field for the TextObjectBase record.

        return field_1_options;
    
public intgetRecordSize()
Size of record (exluding 4 byte header)

        return 4  + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;
    
public shortgetReserved2()

return
the reserved2 field value.

        return reserved2.getShortValue(field_1_options);
    
public shortgetReserved3()

return
the reserved3 field value.

        return reserved3.getShortValue(field_1_options);
    
public shortgetReserved4()
Get the reserved4 field for the TextObjectBase record.

        return field_3_reserved4;
    
public shortgetReserved5()
Get the reserved5 field for the TextObjectBase record.

        return field_4_reserved5;
    
public shortgetReserved6()
Get the reserved6 field for the TextObjectBase record.

        return field_5_reserved6;
    
public intgetReserved7()
Get the reserved7 field for the TextObjectBase record.

        return field_8_reserved7;
    
public shortgetSid()

        return sid;
    
public shortgetTextLength()
Get the text length field for the TextObjectBase record.

        return field_6_textLength;
    
public shortgetTextOrientation()
Get the text orientation field for the TextObjectBase record.

return
One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT

        return field_2_textOrientation;
    
public shortgetVerticalTextAlignment()

return
the Vertical text alignment field value.

        return VerticalTextAlignment.getShortValue(field_1_options);
    
public booleanisReserved1()
reserved field

return
the reserved1 field value.

        return reserved1.isSet(field_1_options);
    
public booleanisTextLocked()
Text has been locked

return
the text locked field value.

        return textLocked.isSet(field_1_options);
    
public intserialize(int offset, byte[] data)

        int pos = 0;

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));

        LittleEndian.putShort(data, 4 + offset + pos, field_1_options);
        LittleEndian.putShort(data, 6 + offset + pos, field_2_textOrientation);
        LittleEndian.putShort(data, 8 + offset + pos, field_3_reserved4);
        LittleEndian.putShort(data, 10 + offset + pos, field_4_reserved5);
        LittleEndian.putShort(data, 12 + offset + pos, field_5_reserved6);
        LittleEndian.putShort(data, 14 + offset + pos, field_6_textLength);
        LittleEndian.putShort(data, 16 + offset + pos, field_7_formattingRunLength);
        LittleEndian.putInt(data, 18 + offset + pos, field_8_reserved7);

        return getRecordSize();
    
public voidsetFormattingRunLength(short field_7_formattingRunLength)
Set the formatting run length field for the TextObjectBase record.

        this.field_7_formattingRunLength = field_7_formattingRunLength;
    
public voidsetHorizontalTextAlignment(short value)
Sets the Horizontal text alignment field value.

        field_1_options = HorizontalTextAlignment.setShortValue(field_1_options, value);
    
public voidsetOptions(short field_1_options)
Set the options field for the TextObjectBase record.

        this.field_1_options = field_1_options;
    
public voidsetReserved1(boolean value)
Sets the reserved1 field value. reserved field

        field_1_options = reserved1.setShortBoolean(field_1_options, value);
    
public voidsetReserved2(short value)
Sets the reserved2 field value.

        field_1_options = reserved2.setShortValue(field_1_options, value);
    
public voidsetReserved3(short value)
Sets the reserved3 field value.

        field_1_options = reserved3.setShortValue(field_1_options, value);
    
public voidsetReserved4(short field_3_reserved4)
Set the reserved4 field for the TextObjectBase record.

        this.field_3_reserved4 = field_3_reserved4;
    
public voidsetReserved5(short field_4_reserved5)
Set the reserved5 field for the TextObjectBase record.

        this.field_4_reserved5 = field_4_reserved5;
    
public voidsetReserved6(short field_5_reserved6)
Set the reserved6 field for the TextObjectBase record.

        this.field_5_reserved6 = field_5_reserved6;
    
public voidsetReserved7(int field_8_reserved7)
Set the reserved7 field for the TextObjectBase record.

        this.field_8_reserved7 = field_8_reserved7;
    
public voidsetTextLength(short field_6_textLength)
Set the text length field for the TextObjectBase record.

        this.field_6_textLength = field_6_textLength;
    
public voidsetTextLocked(boolean value)
Sets the text locked field value. Text has been locked

        field_1_options = textLocked.setShortBoolean(field_1_options, value);
    
public voidsetTextOrientation(short field_2_textOrientation)
Set the text orientation field for the TextObjectBase record.

param
field_2_textOrientation One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT

        this.field_2_textOrientation = field_2_textOrientation;
    
public voidsetVerticalTextAlignment(short value)
Sets the Vertical text alignment field value.

        field_1_options = VerticalTextAlignment.setShortValue(field_1_options, value);
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[TXO]\n");
        buffer.append("    .options              = ")
            .append("0x").append(HexDump.toHex(  getOptions ()))
            .append(" (").append( getOptions() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("         .reserved1                = ").append(isReserved1()).append('\n"); 
            buffer.append("         .HorizontalTextAlignment     = ").append(getHorizontalTextAlignment()).append('\n"); 
            buffer.append("         .VerticalTextAlignment     = ").append(getVerticalTextAlignment()).append('\n"); 
            buffer.append("         .reserved2                = ").append(getReserved2()).append('\n"); 
        buffer.append("         .textLocked               = ").append(isTextLocked()).append('\n"); 
            buffer.append("         .reserved3                = ").append(getReserved3()).append('\n"); 
        buffer.append("    .textOrientation      = ")
            .append("0x").append(HexDump.toHex(  getTextOrientation ()))
            .append(" (").append( getTextOrientation() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .reserved4            = ")
            .append("0x").append(HexDump.toHex(  getReserved4 ()))
            .append(" (").append( getReserved4() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .reserved5            = ")
            .append("0x").append(HexDump.toHex(  getReserved5 ()))
            .append(" (").append( getReserved5() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .reserved6            = ")
            .append("0x").append(HexDump.toHex(  getReserved6 ()))
            .append(" (").append( getReserved6() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .textLength           = ")
            .append("0x").append(HexDump.toHex(  getTextLength ()))
            .append(" (").append( getTextLength() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .formattingRunLength  = ")
            .append("0x").append(HexDump.toHex(  getFormattingRunLength ()))
            .append(" (").append( getFormattingRunLength() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .reserved7            = ")
            .append("0x").append(HexDump.toHex(  getReserved7 ()))
            .append(" (").append( getReserved7() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 

        buffer.append("[/TXO]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)
Checks the sid matches the expected side for this record

param
id the expected sid.

        if (id != sid)
        {
            throw new RecordFormatException("Not a TextObjectBase record");
        }