Package org.apache.poi.ddf
Class EscherClientAnchorRecord
- java.lang.Object
-
- org.apache.poi.ddf.EscherRecord
-
- org.apache.poi.ddf.EscherClientAnchorRecord
-
- All Implemented Interfaces:
Duplicatable,GenericRecord
public class EscherClientAnchorRecord extends EscherRecord
The escher client anchor specifies which rows and cells the shape is bound to as well as the offsets within those cells. Each cell is 1024 units wide by 256 units long regardless of the actual size of the cell. The EscherClientAnchorRecord only applies to the top-most shapes. Shapes contained in groups are bound using the EscherChildAnchorRecords. Referred to as anOfficeArtClientAnchorby[MS-PPT] - v20210216.- See Also:
EscherChildAnchorRecord
-
-
Field Summary
Fields Modifier and Type Field Description static shortRECORD_ID
-
Constructor Summary
Constructors Constructor Description EscherClientAnchorRecord()EscherClientAnchorRecord(EscherClientAnchorRecord other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EscherClientAnchorRecordcopy()intfillFields(byte[] data, int offset, EscherRecordFactory recordFactory)The contract of this method is to deserialize an escher record including its children.shortgetCol1()The column number for the top-left position.shortgetCol2()The column of the bottom right corner of this shape.shortgetDx1()The x offset within the top-left cell.shortgetDx2()The x offset withing the cell for the bottom-right corner of this shape.shortgetDy1()The y offset within the top-left corner of the current shape.shortgetDy2()The y offset withing the cell for the bottom-right corner of this shape.shortgetFlag()0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.Map<String,Supplier<?>>getGenericProperties()EnumgetGenericRecordType()static intgetMaxRecordLength()shortgetRecordId()Return the current record id.StringgetRecordName()Subclasses should return the short name for this escher record.intgetRecordSize()Subclasses should effeciently return the number of bytes required to serialize the record.byte[]getRemainingData()Any remaining data in the recordshortgetRow1()The row number for the top-left corner of the shape.shortgetRow2()The row number for the bottom-right corner of the current shape.intserialize(int offset, byte[] data, EscherSerializationListener listener)Serializes the record to an existing byte array.voidsetCol1(short field_2_col1)The column number for the top-left position.voidsetCol2(short field_6_col2)The column of the bottom right corner of this shape.voidsetDx1(short field_3_dx1)The x offset within the top-left cell.voidsetDx2(short field_7_dx2)The x offset withing the cell for the bottom-right corner of this shape.voidsetDy1(short field_5_dy1)The y offset within the top-left corner of the current shape.voidsetDy2(short field_9_dy2)The y offset withing the cell for the bottom-right corner of this shape.voidsetFlag(short field_1_flag)0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.static voidsetMaxRecordLength(int length)voidsetRemainingData(byte[] remainingData)Any remaining data in the recordvoidsetRow1(short field_4_row1)The row number of the top-left corner of the shape.voidsetRow2(short field_8_row2)The row number for the bottom-right corner of the current shape.-
Methods inherited from class org.apache.poi.ddf.EscherRecord
display, fillFields, getChild, getChildRecords, getGenericChildren, getInstance, getOptions, getVersion, isContainerRecord, readHeader, readInstance, serialize, serialize, setChildRecords, setInstance, setOptions, setRecordId, setVersion, toString, toXml, toXml
-
-
-
-
Constructor Detail
-
EscherClientAnchorRecord
public EscherClientAnchorRecord()
-
EscherClientAnchorRecord
public EscherClientAnchorRecord(EscherClientAnchorRecord other)
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length- the max record length allowed for EscherClientAnchorRecord
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for EscherClientAnchorRecord
-
fillFields
public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)Description copied from class:EscherRecordThe contract of this method is to deserialize an escher record including its children.- Specified by:
fillFieldsin classEscherRecord- Parameters:
data- The byte array containing the serialized escher records.offset- The offset into the byte array.recordFactory- A factory for creating new escher records.- Returns:
- The number of bytes written.
-
serialize
public int serialize(int offset, byte[] data, EscherSerializationListener listener)Description copied from class:EscherRecordSerializes the record to an existing byte array.- Specified by:
serializein classEscherRecord- Parameters:
offset- the offset within the byte arraydata- the data array to serialize tolistener- a listener for begin and end serialization events. This is useful because the serialization is hierarchical/recursive and sometimes you need to be able break into that.- Returns:
- the number of bytes written.
-
getRecordSize
public int getRecordSize()
Description copied from class:EscherRecordSubclasses should effeciently return the number of bytes required to serialize the record.- Specified by:
getRecordSizein classEscherRecord- Returns:
- number of bytes
-
getRecordId
public short getRecordId()
Description copied from class:EscherRecordReturn the current record id.- Overrides:
getRecordIdin classEscherRecord- Returns:
- The 16 bit record id.
-
getRecordName
public String getRecordName()
Description copied from class:EscherRecordSubclasses should return the short name for this escher record.- Specified by:
getRecordNamein classEscherRecord- Returns:
- the short name for this escher record
-
getFlag
public short getFlag()
0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.- Returns:
- the move/size flag
-
setFlag
public void setFlag(short field_1_flag)
0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.- Parameters:
field_1_flag- the move/size flag
-
getCol1
public short getCol1()
The column number for the top-left position. 0 based.- Returns:
- the column number of the top-left corner
-
setCol1
public void setCol1(short field_2_col1)
The column number for the top-left position. 0 based.- Parameters:
field_2_col1- the column number of the top-left corner
-
getDx1
public short getDx1()
The x offset within the top-left cell. Range is from 0 to 1023.- Returns:
- the x offset of the top-left corner
-
setDx1
public void setDx1(short field_3_dx1)
The x offset within the top-left cell. Range is from 0 to 1023.- Parameters:
field_3_dx1- the x offset of the top-left corner
-
getRow1
public short getRow1()
The row number for the top-left corner of the shape.- Returns:
- the row number of the top-left corner
-
setRow1
public void setRow1(short field_4_row1)
The row number of the top-left corner of the shape.- Parameters:
field_4_row1- the row number of the top-left corner
-
getDy1
public short getDy1()
The y offset within the top-left corner of the current shape.- Returns:
- the y offset of the top-left corner
-
setDy1
public void setDy1(short field_5_dy1)
The y offset within the top-left corner of the current shape.- Parameters:
field_5_dy1- the y offset of the top-left corner
-
getCol2
public short getCol2()
The column of the bottom right corner of this shape.- Returns:
- the column of the bottom right corner
-
setCol2
public void setCol2(short field_6_col2)
The column of the bottom right corner of this shape.- Parameters:
field_6_col2- the column of the bottom right corner
-
getDx2
public short getDx2()
The x offset withing the cell for the bottom-right corner of this shape.- Returns:
- the x offset of the bottom-right corner
-
setDx2
public void setDx2(short field_7_dx2)
The x offset withing the cell for the bottom-right corner of this shape.- Parameters:
field_7_dx2- the x offset of the bottom-right corner
-
getRow2
public short getRow2()
The row number for the bottom-right corner of the current shape.- Returns:
- the row number for the bottom-right corner
-
setRow2
public void setRow2(short field_8_row2)
The row number for the bottom-right corner of the current shape.- Parameters:
field_8_row2- the row number for the bottom-right corner
-
getDy2
public short getDy2()
The y offset withing the cell for the bottom-right corner of this shape.- Returns:
- the y offset of the bottom-right corner
-
setDy2
public void setDy2(short field_9_dy2)
The y offset withing the cell for the bottom-right corner of this shape.- Parameters:
field_9_dy2- the y offset of the bottom-right corner
-
getRemainingData
public byte[] getRemainingData()
Any remaining data in the record- Returns:
- the remaining bytes
-
setRemainingData
public void setRemainingData(byte[] remainingData)
Any remaining data in the record- Parameters:
remainingData- the remaining bytes
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericPropertiesin interfaceGenericRecord- Overrides:
getGenericPropertiesin classEscherRecord
-
getGenericRecordType
public Enum getGenericRecordType()
-
copy
public EscherClientAnchorRecord copy()
- Specified by:
copyin interfaceDuplicatable- Specified by:
copyin classEscherRecord- Returns:
- a deep copy of the implementing class / instance
-
-