Top Description Fields Constructors Methods
org.apache.poi.ddf

public Class EscherClientAnchorRecord

extends EscherRecord
Class Inheritance
Imports
java.util.Collections, .LinkedHashMap, .Map, java.util.function.Supplier, org.apache.poi.util.IOUtils, .LittleEndian

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 an OfficeArtClientAnchor by [MS-PPT] - v20210216.
See Also
EscherChildAnchorRecord

Field Summary

Modifier and TypeField and Description
private static final int
private short
field_1_flag

bit[0] - fMove (1 bit): A bit that specifies whether the shape will be kept intact when the cells are moved.

private short
private short
private short
private short
private short
private short
private short
private short
private static int
public static final short
private byte[]
private boolean

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public EscherClientAnchorRecord
public int
fillFields(byte[]
The byte array containing the serialized escher records.
data
,
int
The offset into the byte array.
offset
,
EscherRecordFactory
A factory for creating new escher records.
recordFactory
)

Implements abstract org.apache.poi.ddf.EscherRecord.fillFields.

The contract of this method is to deserialize an escher record including its children.

public short

Returns:

the column number of the top-left corner
getCol1
()

The column number for the top-left position.

public short

Returns:

the column of the bottom right corner
getCol2
()

The column of the bottom right corner of this shape.

public short

Returns:

the x offset of the top-left corner
getDx1
()

The x offset within the top-left cell.

public short

Returns:

the x offset of the bottom-right corner
getDx2
()

The x offset withing the cell for the bottom-right corner of this shape.

public short

Returns:

the y offset of the top-left corner
getDy1
()

The y offset within the top-left corner of the current shape.

public short

Returns:

the y offset of the bottom-right corner
getDy2
()

The y offset withing the cell for the bottom-right corner of this shape.

public short

Returns:

the move/size flag
getFlag
()

0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.

public Map<String, Supplier<?>>
public Enum<E extends Enum<E>>
public static int

Returns:

the max record length allowed for EscherClientAnchorRecord
getMaxRecordLength
()

public short
getRecordId()

Overrides org.apache.poi.ddf.EscherRecord.getRecordId.

Return the current record id.

public String
getRecordName()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordName.

Subclasses should return the short name for this escher record.

public int
getRecordSize()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordSize.

Subclasses should effeciently return the number of bytes required to serialize the record.

public byte[]

Returns:

the remaining bytes
getRemainingData
()

Any remaining data in the record

public short

Returns:

the row number of the top-left corner
getRow1
()

The row number for the top-left corner of the shape.

public short

Returns:

the row number for the bottom-right corner
getRow2
()

The row number for the bottom-right corner of the current shape.

public int
serialize(int
the offset within the byte array
offset
,
byte[]
the data array to serialize to
data
,
EscherSerializationListener
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.
listener
)

Implements abstract org.apache.poi.ddf.EscherRecord.serialize.

Serializes the record to an existing byte array.

public void
setCol1(short
the column number of the top-left corner
field_2_col1
)

The column number for the top-left position.

public void
setCol2(short
the column of the bottom right corner
field_6_col2
)

The column of the bottom right corner of this shape.

public void
setDx1(short
the x offset of the top-left corner
field_3_dx1
)

The x offset within the top-left cell.

public void
setDx2(short
the x offset of the bottom-right corner
field_7_dx2
)

The x offset withing the cell for the bottom-right corner of this shape.

public void
setDy1(short
the y offset of the top-left corner
field_5_dy1
)

The y offset within the top-left corner of the current shape.

public void
setDy2(short
the y offset of the bottom-right corner
field_9_dy2
)

The y offset withing the cell for the bottom-right corner of this shape.

public void
setFlag(short
the move/size flag
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.

public static void
setMaxRecordLength(int
the max record length allowed for EscherClientAnchorRecord
length
)

public void
setRemainingData(byte[]
the remaining bytes
remainingData
)

Any remaining data in the record

public void
setRow1(short
the row number of the top-left corner
field_4_row1
)

The row number of the top-left corner of the shape.

public void
setRow2(short
the row number for the bottom-right corner
field_8_row2
)

The row number for the bottom-right corner of the current shape.

Inherited from org.apache.poi.ddf.EscherRecord:
displayfillFieldsgetChildgetChildRecordsgetGenericChildrengetInstancegetOptionsgetVersionisContainerRecordreadHeaderreadInstanceserializeserializesetChildRecordssetInstancesetOptionssetRecordIdsetVersiontoStringtoXmltoXml

Field Detail

DEFAULT_MAX_RECORD_LENGTHback to summary
private static final int DEFAULT_MAX_RECORD_LENGTH
field_1_flagback to summary
private short field_1_flag

bit[0] - fMove (1 bit): A bit that specifies whether the shape will be kept intact when the cells are moved. bit[1] - fSize (1 bit): A bit that specifies whether the shape will be kept intact when the cells are resized. If fMove is 1, the value MUST be 1. bit[2-4] - reserved, MUST be 0 and MUST be ignored bit[5-15]- Undefined and MUST be ignored. it can take values: 0, 2, 3

field_2_col1back to summary
private short field_2_col1
field_3_dx1back to summary
private short field_3_dx1
field_4_row1back to summary
private short field_4_row1
field_5_dy1back to summary
private short field_5_dy1
field_6_col2back to summary
private short field_6_col2
field_7_dx2back to summary
private short field_7_dx2
field_8_row2back to summary
private short field_8_row2
field_9_dy2back to summary
private short field_9_dy2
MAX_RECORD_LENGTHback to summary
private static int MAX_RECORD_LENGTH
RECORD_IDback to summary
public static final short RECORD_ID
remainingDataback to summary
private byte[] remainingData
shortRecordback to summary
private boolean shortRecord

Constructor Detail

EscherClientAnchorRecordback to summary
public EscherClientAnchorRecord()
EscherClientAnchorRecordback to summary
public EscherClientAnchorRecord(EscherClientAnchorRecord other)

Method Detail

copyback to summary
public EscherClientAnchorRecord copy()

Implements abstract org.apache.poi.ddf.EscherRecord.copy.

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

Returns:EscherClientAnchorRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
fillFieldsback to summary
public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)

Implements abstract org.apache.poi.ddf.EscherRecord.fillFields.

Doc from org.apache.poi.ddf.EscherRecord.fillFields.

The contract of this method is to deserialize an escher record including its children.

Parameters
data:byte[]

The byte array containing the serialized escher records.

offset:int

The offset into the byte array.

recordFactory:EscherRecordFactory

A factory for creating new escher records.

Returns:int

The number of bytes written.

Annotations
@Override
getCol1back to summary
public short getCol1()

The column number for the top-left position. 0 based.

Returns:short

the column number of the top-left corner

getCol2back to summary
public short getCol2()

The column of the bottom right corner of this shape.

Returns:short

the column of the bottom right corner

getDx1back to summary
public short getDx1()

The x offset within the top-left cell. Range is from 0 to 1023.

Returns:short

the x offset of the top-left corner

getDx2back to summary
public short getDx2()

The x offset withing the cell for the bottom-right corner of this shape.

Returns:short

the x offset of the bottom-right corner

getDy1back to summary
public short getDy1()

The y offset within the top-left corner of the current shape.

Returns:short

the y offset of the top-left corner

getDy2back to summary
public short getDy2()

The y offset withing the cell for the bottom-right corner of this shape.

Returns:short

the y offset of the bottom-right corner

getFlagback to summary
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:short

the move/size flag

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Overrides org.apache.poi.ddf.EscherRecord.getGenericProperties.

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

Annotations
@Override
getGenericRecordTypeback to summary
public Enum<E extends Enum<E>> getGenericRecordType()

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

Annotations
@Override
getMaxRecordLengthback to summary
public static int getMaxRecordLength()
Returns:int

the max record length allowed for EscherClientAnchorRecord

getRecordIdback to summary
public short getRecordId()

Overrides org.apache.poi.ddf.EscherRecord.getRecordId.

Doc from org.apache.poi.ddf.EscherRecord.getRecordId.

Return the current record id.

Returns:short

The 16 bit record id.

Annotations
@Override
getRecordNameback to summary
public String getRecordName()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordName.

Doc from org.apache.poi.ddf.EscherRecord.getRecordName.

Subclasses should return the short name for this escher record.

Returns:String

the short name for this escher record

Annotations
@Override
getRecordSizeback to summary
public int getRecordSize()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordSize.

Doc from org.apache.poi.ddf.EscherRecord.getRecordSize.

Subclasses should effeciently return the number of bytes required to serialize the record.

Returns:int

number of bytes

Annotations
@Override
getRemainingDataback to summary
public byte[] getRemainingData()

Any remaining data in the record

Returns:byte[]

the remaining bytes

getRow1back to summary
public short getRow1()

The row number for the top-left corner of the shape.

Returns:short

the row number of the top-left corner

getRow2back to summary
public short getRow2()

The row number for the bottom-right corner of the current shape.

Returns:short

the row number for the bottom-right corner

serializeback to summary
public int serialize(int offset, byte[] data, EscherSerializationListener listener)

Implements abstract org.apache.poi.ddf.EscherRecord.serialize.

Doc from org.apache.poi.ddf.EscherRecord.serialize.

Serializes the record to an existing byte array.

Parameters
offset:int

the offset within the byte array

data:byte[]

the data array to serialize to

listener:EscherSerializationListener

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:int

the number of bytes written.

Annotations
@Override
setCol1back to summary
public void setCol1(short field_2_col1)

The column number for the top-left position. 0 based.

Parameters
field_2_col1:short

the column number of the top-left corner

setCol2back to summary
public void setCol2(short field_6_col2)

The column of the bottom right corner of this shape.

Parameters
field_6_col2:short

the column of the bottom right corner

setDx1back to summary
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:short

the x offset of the top-left corner

setDx2back to summary
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:short

the x offset of the bottom-right corner

setDy1back to summary
public void setDy1(short field_5_dy1)

The y offset within the top-left corner of the current shape.

Parameters
field_5_dy1:short

the y offset of the top-left corner

setDy2back to summary
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:short

the y offset of the bottom-right corner

setFlagback to summary
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:short

the move/size flag

setMaxRecordLengthback to summary
public static void setMaxRecordLength(int length)
Parameters
length:int

the max record length allowed for EscherClientAnchorRecord

setRemainingDataback to summary
public void setRemainingData(byte[] remainingData)

Any remaining data in the record

Parameters
remainingData:byte[]

the remaining bytes

setRow1back to summary
public void setRow1(short field_4_row1)

The row number of the top-left corner of the shape.

Parameters
field_4_row1:short

the row number of the top-left corner

setRow2back to summary
public void setRow2(short field_8_row2)

The row number for the bottom-right corner of the current shape.

Parameters
field_8_row2:short

the row number for the bottom-right corner