org.apache.poi.ddf
Class EscherClientAnchorRecord

java.lang.Object
  extended by org.apache.poi.ddf.EscherRecord
      extended by org.apache.poi.ddf.EscherClientAnchorRecord

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.

Author:
Glen Stampoultzis
See Also:
EscherChildAnchorRecord

Field Summary
static java.lang.String RECORD_DESCRIPTION
           
static short RECORD_ID
           
 
Constructor Summary
EscherClientAnchorRecord()
           
 
Method Summary
 int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)
          The contract of this method is to deserialize an escher record including it's children.
 short getCol1()
          The column number for the top-left position.
 short getCol2()
          The column of the bottom right corner of this shape.
 short getDx1()
          The x offset within the top-left cell.
 short getDx2()
          The x offset withing the cell for the bottom-right corner of this shape.
 short getDy1()
          The y offset within the top-left corner of the current shape.
 short getDy2()
          The y offset withing the cell for the bottom-right corner of this shape.
 short getFlag()
          0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
 short getRecordId()
          Return the current record id.
 java.lang.String getRecordName()
          Subclasses should return the short name for this escher record.
 int getRecordSize()
          Subclasses should effeciently return the number of bytes required to serialize the record.
 byte[] getRemainingData()
          Any remaining data in the record
 short getRow1()
          The row number for the top-left corner of the shape.
 short getRow2()
          The row number for the bottom-right corner of the current shape.
 int serialize(int offset, byte[] data, EscherSerializationListener listener)
          Serializes the record to an existing byte array.
 void setCol1(short field_2_col1)
          The column number for the top-left position.
 void setCol2(short field_6_col2)
          The column of the bottom right corner of this shape.
 void setDx1(short field_3_dx1)
          The x offset within the top-left cell.
 void setDx2(short field_7_dx2)
          The x offset withing the cell for the bottom-right corner of this shape.
 void setDy1(short field_5_dy1)
          The y offset within the top-left corner of the current shape.
 void setDy2(short field_9_dy2)
          The y offset withing the cell for the bottom-right corner of this shape.
 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.
 void setRemainingData(byte[] remainingData)
          Any remaining data in the record
 void setRow1(short field_4_row1)
          The row number for the top-left corner of the shape.
 void setRow2(short field_8_row2)
          The row number for the bottom-right corner of the current shape.
 java.lang.String toString()
          Returns the string representation for this record.
 
Methods inherited from class org.apache.poi.ddf.EscherRecord
clone, display, fillFields, getChild, getChildRecords, getInstance, getOptions, getVersion, isContainerRecord, readHeader, readInstance, serialize, serialize, setChildRecords, setInstance, setOptions, setRecordId, setVersion
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RECORD_ID

public static final short RECORD_ID
See Also:
Constant Field Values

RECORD_DESCRIPTION

public static final java.lang.String RECORD_DESCRIPTION
See Also:
Constant Field Values
Constructor Detail

EscherClientAnchorRecord

public EscherClientAnchorRecord()
Method Detail

fillFields

public int fillFields(byte[] data,
                      int offset,
                      EscherRecordFactory recordFactory)
Description copied from class: EscherRecord
The contract of this method is to deserialize an escher record including it's children.

Specified by:
fillFields in class EscherRecord
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: EscherRecord
Serializes the record to an existing byte array.

Specified by:
serialize in class EscherRecord
Parameters:
offset - the offset within the byte array
data - the data array to serialize to
listener - 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: EscherRecord
Subclasses should effeciently return the number of bytes required to serialize the record.

Specified by:
getRecordSize in class EscherRecord
Returns:
number of bytes

getRecordId

public short getRecordId()
Description copied from class: EscherRecord
Return the current record id.

Overrides:
getRecordId in class EscherRecord
Returns:
The 16 bit record id.

getRecordName

public java.lang.String getRecordName()
Description copied from class: EscherRecord
Subclasses should return the short name for this escher record.

Specified by:
getRecordName in class EscherRecord

toString

public java.lang.String toString()
Returns the string representation for this record.

Overrides:
toString in class java.lang.Object
Returns:
A string

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.


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.


getCol1

public short getCol1()
The column number for the top-left position. 0 based.


setCol1

public void setCol1(short field_2_col1)
The column number for the top-left position. 0 based.


getDx1

public short getDx1()
The x offset within the top-left cell. Range is from 0 to 1023.


setDx1

public void setDx1(short field_3_dx1)
The x offset within the top-left cell. Range is from 0 to 1023.


getRow1

public short getRow1()
The row number for the top-left corner of the shape.


setRow1

public void setRow1(short field_4_row1)
The row number for the top-left corner of the shape.


getDy1

public short getDy1()
The y offset within the top-left corner of the current shape.


setDy1

public void setDy1(short field_5_dy1)
The y offset within the top-left corner of the current shape.


getCol2

public short getCol2()
The column of the bottom right corner of this shape.


setCol2

public void setCol2(short field_6_col2)
The column of the bottom right corner of this shape.


getDx2

public short getDx2()
The x offset withing the cell for the bottom-right corner of this shape.


setDx2

public void setDx2(short field_7_dx2)
The x offset withing the cell for the bottom-right corner of this shape.


getRow2

public short getRow2()
The row number for the bottom-right corner of the current shape.


setRow2

public void setRow2(short field_8_row2)
The row number for the bottom-right corner of the current shape.


getDy2

public short getDy2()
The y offset withing the cell for the bottom-right corner of this shape.


setDy2

public void setDy2(short field_9_dy2)
The y offset withing the cell for the bottom-right corner of this shape.


getRemainingData

public byte[] getRemainingData()
Any remaining data in the record


setRemainingData

public void setRemainingData(byte[] remainingData)
Any remaining data in the record



Copyright 2012 The Apache Software Foundation or its licensors, as applicable.