Package org.apache.poi.hssf.record
Class TextObjectRecord
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.Record
-
- org.apache.poi.hssf.record.cont.ContinuableRecord
-
- org.apache.poi.hssf.record.TextObjectRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public final class TextObjectRecord extends ContinuableRecord
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
Fields Modifier and Type Field Description static short
HORIZONTAL_TEXT_ALIGNMENT_CENTERED
static short
HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED
static short
HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED
static short
HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED
static short
sid
static short
TEXT_ORIENTATION_NONE
static short
TEXT_ORIENTATION_ROT_LEFT
static short
TEXT_ORIENTATION_ROT_RIGHT
static short
TEXT_ORIENTATION_TOP_TO_BOTTOM
static short
VERTICAL_TEXT_ALIGNMENT_BOTTOM
static short
VERTICAL_TEXT_ALIGNMENT_CENTER
static short
VERTICAL_TEXT_ALIGNMENT_JUSTIFY
static short
VERTICAL_TEXT_ALIGNMENT_TOP
-
Constructor Summary
Constructors Constructor Description TextObjectRecord()
TextObjectRecord(RecordInputStream in)
TextObjectRecord(TextObjectRecord other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextObjectRecord
copy()
Map<String,Supplier<?>>
getGenericProperties()
HSSFRecordTypes
getGenericRecordType()
int
getHorizontalTextAlignment()
Ptg
getLinkRefPtg()
short
getSid()
return the non static version of the id for this record.HSSFRichTextString
getStr()
int
getTextOrientation()
Get the text orientation field for the TextObjectBase record.int
getVerticalTextAlignment()
boolean
isTextLocked()
protected void
serialize(ContinuableRecordOutput out)
Serializes this record's content to the supplied data output.void
setHorizontalTextAlignment(int value)
Sets the Horizontal text alignment field value.void
setStr(HSSFRichTextString str)
void
setTextLocked(boolean value)
Sets the text locked field value.void
setTextOrientation(int textOrientation)
Set the text orientation field for the TextObjectBase record.void
setVerticalTextAlignment(int value)
Sets the Vertical text alignment field value.-
Methods inherited from class org.apache.poi.hssf.record.cont.ContinuableRecord
getRecordSize, serialize
-
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED
public static final short HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED
- See Also:
- Constant Field Values
-
HORIZONTAL_TEXT_ALIGNMENT_CENTERED
public static final short HORIZONTAL_TEXT_ALIGNMENT_CENTERED
- See Also:
- Constant Field Values
-
HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED
public static final short HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED
- See Also:
- Constant Field Values
-
HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED
public static final short HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED
- See Also:
- Constant Field Values
-
VERTICAL_TEXT_ALIGNMENT_TOP
public static final short VERTICAL_TEXT_ALIGNMENT_TOP
- See Also:
- Constant Field Values
-
VERTICAL_TEXT_ALIGNMENT_CENTER
public static final short VERTICAL_TEXT_ALIGNMENT_CENTER
- See Also:
- Constant Field Values
-
VERTICAL_TEXT_ALIGNMENT_BOTTOM
public static final short VERTICAL_TEXT_ALIGNMENT_BOTTOM
- See Also:
- Constant Field Values
-
VERTICAL_TEXT_ALIGNMENT_JUSTIFY
public static final short VERTICAL_TEXT_ALIGNMENT_JUSTIFY
- See Also:
- Constant Field Values
-
TEXT_ORIENTATION_NONE
public static final short TEXT_ORIENTATION_NONE
- See Also:
- Constant Field Values
-
TEXT_ORIENTATION_TOP_TO_BOTTOM
public static final short TEXT_ORIENTATION_TOP_TO_BOTTOM
- See Also:
- Constant Field Values
-
TEXT_ORIENTATION_ROT_RIGHT
public static final short TEXT_ORIENTATION_ROT_RIGHT
- See Also:
- Constant Field Values
-
TEXT_ORIENTATION_ROT_LEFT
public static final short TEXT_ORIENTATION_ROT_LEFT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TextObjectRecord
public TextObjectRecord()
-
TextObjectRecord
public TextObjectRecord(TextObjectRecord other)
-
TextObjectRecord
public TextObjectRecord(RecordInputStream in)
-
-
Method Detail
-
getSid
public short getSid()
Description copied from class:Record
return the non static version of the id for this record.
-
serialize
protected void serialize(ContinuableRecordOutput out)
Description copied from class:ContinuableRecord
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 fromContinuableRecordOutput
can be used to serialize strings (withContinueRecord
s being written as required). If necessary, implementors can explicitly startContinueRecord
s (regardless of the amount of remaining space).- Specified by:
serialize
in classContinuableRecord
- Parameters:
out
- a data output stream
-
setHorizontalTextAlignment
public void setHorizontalTextAlignment(int value)
Sets the Horizontal text alignment field value.- Parameters:
value
- The horizontal alignment, use one of the HORIZONTAL_TEXT_ALIGNMENT_... constants in this class
-
getHorizontalTextAlignment
public int getHorizontalTextAlignment()
- Returns:
- the Horizontal text alignment field value.
-
setVerticalTextAlignment
public void setVerticalTextAlignment(int value)
Sets the Vertical text alignment field value.- Parameters:
value
- The vertical alignment, use one of the VERTIUCAL_TEST_ALIGNMENT_... constants in this class
-
getVerticalTextAlignment
public int getVerticalTextAlignment()
- Returns:
- the Vertical text alignment field value.
-
setTextLocked
public void setTextLocked(boolean value)
Sets the text locked field value.- Parameters:
value
- If the text should be locked
-
isTextLocked
public boolean isTextLocked()
- Returns:
- the text locked field value.
-
getTextOrientation
public int getTextOrientation()
Get the text orientation field for the TextObjectBase record.- Returns:
- One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT
-
setTextOrientation
public void setTextOrientation(int textOrientation)
Set the text orientation field for the TextObjectBase record.- Parameters:
textOrientation
- One of TEXT_ORIENTATION_NONE TEXT_ORIENTATION_TOP_TO_BOTTOM TEXT_ORIENTATION_ROT_RIGHT TEXT_ORIENTATION_ROT_LEFT
-
getStr
public HSSFRichTextString getStr()
-
setStr
public void setStr(HSSFRichTextString str)
-
getLinkRefPtg
public Ptg getLinkRefPtg()
-
copy
public TextObjectRecord copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classRecord
- Returns:
- a deep copy of the implementing class / instance
-
getGenericRecordType
public HSSFRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
- Specified by:
getGenericRecordType
in classRecord
-
-