Top Description Fields Constructors Methods
org.apache.poi.hssf.record

public final Class TextObjectRecord

extends ContinuableRecord
Class Inheritance
Imports
java.util.Collections, .LinkedHashMap, .Map, java.util.function.Supplier, org.apache.poi.hssf.record.cont.ContinuableRecord, .ContinuableRecordOutput, org.apache.poi.hssf.usermodel.HSSFRichTextString, org.apache.poi.ss.formula.ptg.OperandPtg, .Ptg, org.apache.poi.util.BitField, .BitFieldFactory, .RecordFormatException

The TXO record (0x01B6) is used to define the properties of a text box. It is followed by two or more continue records unless there is no actual text. The first continue records contain the text data and the last continue record contains the formatting runs.

Field Summary

Modifier and TypeField and Description
private OperandPtg
_linkRefPtg

expect tRef, tRef3D, tArea, tArea3D or tName

private HSSFRichTextString
private Byte
_unknownPostFormulaByte

Not clear if needed .

private int
private int
private int
private int
private int
private int
private int
private static final int
public static final short
public static final short
public static final short
public static final short
private static final BitField
public static final short
public static final short
public static final short
public static final short
public static final short
private static final BitField
public static final short
public static final short
public static final short
public static final short
private static final BitField

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public TextObjectRecord
private int
public Map<String, Supplier<?>>
public HSSFRecordTypes
public int

Returns:

the Horizontal text alignment field value.
getHorizontalTextAlignment
()

public Ptg
public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public HSSFRichTextString
public int

Returns:

One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT
getTextOrientation
()

Get the text orientation field for the TextObjectBase record.

public int

Returns:

the Vertical text alignment field value.
getVerticalTextAlignment
()

public boolean

Returns:

the text locked field value.
isTextLocked
()

private static void
processFontRuns(RecordInputStream in, HSSFRichTextString str, int formattingRunDataLength)

private static String
readRawString(RecordInputStream in, int textLength)

protected void
serialize(ContinuableRecordOutput
a data output stream
out
)

Implements abstract org.apache.poi.hssf.record.cont.ContinuableRecord.serialize.

Serializes this record's content to the supplied data output.

private void
private void
public void
setHorizontalTextAlignment(int
The horizontal alignment, use one of the HORIZONTAL_TEXT_ALIGNMENT_... constants in this class
value
)

Sets the Horizontal text alignment field value.

public void
public void
setTextLocked(boolean
If the text should be locked
value
)

Sets the text locked field value.

public void
setTextOrientation(int
One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT
textOrientation
)

Set the text orientation field for the TextObjectBase record.

public void
setVerticalTextAlignment(int
The vertical alignment, use one of the VERTIUCAL_TEST_ALIGNMENT_... constants in this class
value
)

Sets the Vertical text alignment field value.

private static void
Inherited from org.apache.poi.hssf.record.cont.ContinuableRecord:
getRecordSizeserialize

Field Detail

_linkRefPtgback to summary
private OperandPtg _linkRefPtg

expect tRef, tRef3D, tArea, tArea3D or tName

_textback to summary
private HSSFRichTextString _text
_unknownPostFormulaByteback to summary
private Byte _unknownPostFormulaByte

Not clear if needed . Excel seems to be OK if this byte is not present. Value is often the same as the earlier firstColumn byte.

_unknownPreFormulaIntback to summary
private int _unknownPreFormulaInt
field_1_optionsback to summary
private int field_1_options
field_2_textOrientationback to summary
private int field_2_textOrientation
field_3_reserved4back to summary
private int field_3_reserved4
field_4_reserved5back to summary
private int field_4_reserved5
field_5_reserved6back to summary
private int field_5_reserved6
field_8_reserved7back to summary
private int field_8_reserved7
FORMAT_RUN_ENCODED_SIZEback to summary
private static final int FORMAT_RUN_ENCODED_SIZE
HORIZONTAL_TEXT_ALIGNMENT_CENTEREDback to summary
public static final short HORIZONTAL_TEXT_ALIGNMENT_CENTERED
HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIEDback to summary
public static final short HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED
HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNEDback to summary
public static final short HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED
HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNEDback to summary
public static final short HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED
HorizontalTextAlignmentback to summary
private static final BitField HorizontalTextAlignment
sidback to summary
public static final short sid
TEXT_ORIENTATION_NONEback to summary
public static final short TEXT_ORIENTATION_NONE
TEXT_ORIENTATION_ROT_LEFTback to summary
public static final short TEXT_ORIENTATION_ROT_LEFT
TEXT_ORIENTATION_ROT_RIGHTback to summary
public static final short TEXT_ORIENTATION_ROT_RIGHT
TEXT_ORIENTATION_TOP_TO_BOTTOMback to summary
public static final short TEXT_ORIENTATION_TOP_TO_BOTTOM
textLockedback to summary
private static final BitField textLocked
VERTICAL_TEXT_ALIGNMENT_BOTTOMback to summary
public static final short VERTICAL_TEXT_ALIGNMENT_BOTTOM
VERTICAL_TEXT_ALIGNMENT_CENTERback to summary
public static final short VERTICAL_TEXT_ALIGNMENT_CENTER
VERTICAL_TEXT_ALIGNMENT_JUSTIFYback to summary
public static final short VERTICAL_TEXT_ALIGNMENT_JUSTIFY
VERTICAL_TEXT_ALIGNMENT_TOPback to summary
public static final short VERTICAL_TEXT_ALIGNMENT_TOP
VerticalTextAlignmentback to summary
private static final BitField VerticalTextAlignment

Constructor Detail

TextObjectRecordback to summary
public TextObjectRecord()
TextObjectRecordback to summary
public TextObjectRecord(TextObjectRecord other)
TextObjectRecordback to summary
public TextObjectRecord(RecordInputStream in)

Method Detail

copyback to summary
public TextObjectRecord copy()

Implements abstract org.apache.poi.hssf.record.Record.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Returns:TextObjectRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getFormattingDataLengthback to summary
private int getFormattingDataLength()
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getHorizontalTextAlignmentback to summary
public int getHorizontalTextAlignment()
Returns:int

the Horizontal text alignment field value.

getLinkRefPtgback to summary
public Ptg getLinkRefPtg()
getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

getStrback to summary
public HSSFRichTextString getStr()
getTextOrientationback to summary
public int getTextOrientation()

Get the text orientation field for the TextObjectBase record.

Returns:int

One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT

getVerticalTextAlignmentback to summary
public int getVerticalTextAlignment()
Returns:int

the Vertical text alignment field value.

isTextLockedback to summary
public boolean isTextLocked()
Returns:boolean

the text locked field value.

processFontRunsback to summary
private static void processFontRuns(RecordInputStream in, HSSFRichTextString str, int formattingRunDataLength)
readRawStringback to summary
private static String readRawString(RecordInputStream in, int textLength)
serializeback to summary
protected void serialize(ContinuableRecordOutput out)

Implements abstract org.apache.poi.hssf.record.cont.ContinuableRecord.serialize.

Doc from org.apache.poi.hssf.record.cont.ContinuableRecord.serialize.

Serializes this record's content to the supplied data output.

The standard BIFF header (ushort sid, ushort size) has been handled by the superclass, so only BIFF data should be written by this method. Simple data types can be written with the standard LittleEndianOutput methods. Methods from ContinuableRecordOutput can be used to serialize strings (with ContinueRecords being written as required). If necessary, implementors can explicitly start ContinueRecords (regardless of the amount of remaining space).

Parameters
out:ContinuableRecordOutput

a data output stream

serializeTrailingRecordsback to summary
private void serializeTrailingRecords(ContinuableRecordOutput out)
serializeTXORecordback to summary
private void serializeTXORecord(ContinuableRecordOutput out)
setHorizontalTextAlignmentback to summary
public void setHorizontalTextAlignment(int value)

Sets the Horizontal text alignment field value.

Parameters
value:int

The horizontal alignment, use one of the HORIZONTAL_TEXT_ALIGNMENT_... constants in this class

setStrback to summary
public void setStr(HSSFRichTextString str)
setTextLockedback to summary
public void setTextLocked(boolean value)

Sets the text locked field value.

Parameters
value:boolean

If the text should be locked

setTextOrientationback to summary
public void setTextOrientation(int textOrientation)

Set the text orientation field for the TextObjectBase record.

Parameters
textOrientation:int

One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT

setVerticalTextAlignmentback to summary
public void setVerticalTextAlignment(int value)

Sets the Vertical text alignment field value.

Parameters
value:int

The vertical alignment, use one of the VERTIUCAL_TEST_ALIGNMENT_... constants in this class

writeFormatDataback to summary
private static void writeFormatData(ContinuableRecordOutput out, HSSFRichTextString str)