EscherDgRecordpublic class EscherDgRecord extends EscherRecord This record simply holds the number of shapes in the drawing group and the
last shape id used for this drawing group. |
Fields Summary |
---|
public static final short | RECORD_ID | public static final String | RECORD_DESCRIPTION | private int | field_1_numShapes | private int | field_2_lastMSOSPID |
Methods Summary |
---|
public int | fillFields(byte[] data, int offset, org.apache.poi.ddf.EscherRecordFactory recordFactory)This method deserializes the record from a byte array.
int bytesRemaining = readHeader( data, offset );
int pos = offset + 8;
int size = 0;
field_1_numShapes = LittleEndian.getInt( data, pos + size ); size += 4;
field_2_lastMSOSPID = LittleEndian.getInt( data, pos + size ); size += 4;
// bytesRemaining -= size;
// remainingData = new byte[bytesRemaining];
// System.arraycopy( data, pos + size, remainingData, 0, bytesRemaining );
return getRecordSize();
| public short | getDrawingGroupId()Gets the drawing group id for this record. This is encoded in the
instance part of the option record.
return (short) ( getOptions() >> 4 );
| public int | getLastMSOSPID()The last shape id used in this drawing group.
return field_2_lastMSOSPID;
| public int | getNumShapes()The number of shapes in this drawing group.
return field_1_numShapes;
| public short | getRecordId()
return RECORD_ID;
| public java.lang.String | getRecordName()The short name for this record
return "Dg";
| public int | getRecordSize()Returns the number of bytes that are required to serialize this record.
return 8 + 8;
| public void | incrementShapeCount()
this.field_1_numShapes++;
| public int | serialize(int offset, byte[] data, org.apache.poi.ddf.EscherSerializationListener listener)This method serializes this escher record into a byte array.
listener.beforeRecordSerialize( offset, getRecordId(), this );
LittleEndian.putShort( data, offset, getOptions() );
LittleEndian.putShort( data, offset + 2, getRecordId() );
LittleEndian.putInt( data, offset + 4, 8 );
LittleEndian.putInt( data, offset + 8, field_1_numShapes );
LittleEndian.putInt( data, offset + 12, field_2_lastMSOSPID );
// System.arraycopy( remainingData, 0, data, offset + 26, remainingData.length );
// int pos = offset + 8 + 18 + remainingData.length;
listener.afterRecordSerialize( offset + 16, getRecordId(), getRecordSize(), this );
return getRecordSize();
| public void | setLastMSOSPID(int field_2_lastMSOSPID)The last shape id used in this drawing group.
this.field_2_lastMSOSPID = field_2_lastMSOSPID;
| public void | setNumShapes(int field_1_numShapes)The number of shapes in this drawing group.
this.field_1_numShapes = field_1_numShapes;
| public java.lang.String | toString()Returns the string representation of this record.
String nl = System.getProperty("line.separator");
// String extraData;
// ByteArrayOutputStream b = new ByteArrayOutputStream();
// try
// {
// HexDump.dump(this.remainingData, 0, b, 0);
// extraData = b.toString();
// }
// catch ( Exception e )
// {
// extraData = "error";
// }
return getClass().getName() + ":" + nl +
" RecordId: 0x" + HexDump.toHex(RECORD_ID) + nl +
" Options: 0x" + HexDump.toHex(getOptions()) + nl +
" NumShapes: " + field_1_numShapes + nl +
" LastMSOSPID: " + field_2_lastMSOSPID + nl;
|
|