Methods Summary |
---|
private java.lang.String | decodeFlags(int flags)Converts the shape flags into a more descriptive name.
StringBuffer result = new StringBuffer();
result.append( ( flags & FLAG_GROUP ) != 0 ? "|GROUP" : "" );
result.append( ( flags & FLAG_CHILD ) != 0 ? "|CHILD" : "" );
result.append( ( flags & FLAG_PATRIARCH ) != 0 ? "|PATRIARCH" : "" );
result.append( ( flags & FLAG_DELETED ) != 0 ? "|DELETED" : "" );
result.append( ( flags & FLAG_OLESHAPE ) != 0 ? "|OLESHAPE" : "" );
result.append( ( flags & FLAG_HAVEMASTER ) != 0 ? "|HAVEMASTER" : "" );
result.append( ( flags & FLAG_FLIPHORIZ ) != 0 ? "|FLIPHORIZ" : "" );
result.append( ( flags & FLAG_FLIPVERT ) != 0 ? "|FLIPVERT" : "" );
result.append( ( flags & FLAG_CONNECTOR ) != 0 ? "|CONNECTOR" : "" );
result.append( ( flags & FLAG_HAVEANCHOR ) != 0 ? "|HAVEANCHOR" : "" );
result.append( ( flags & FLAG_BACKGROUND ) != 0 ? "|BACKGROUND" : "" );
result.append( ( flags & FLAG_HASSHAPETYPE ) != 0 ? "|HASSHAPETYPE" : "" );
//need to check, else blows up on some records - bug 34435
if(result.length() > 0) {
result.deleteCharAt(0);
}
return result.toString();
|
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_shapeId = LittleEndian.getInt( data, pos + size ); size += 4;
field_2_flags = LittleEndian.getInt( data, pos + size ); size += 4;
// bytesRemaining -= size;
// remainingData = new byte[bytesRemaining];
// System.arraycopy( data, pos + size, remainingData, 0, bytesRemaining );
return getRecordSize();
|
public int | getFlags()The flags that apply to this shape.
return field_2_flags;
|
public short | getRecordId()
return RECORD_ID;
|
public java.lang.String | getRecordName()The short name for this record
return "Sp";
|
public int | getRecordSize()Returns the number of bytes that are required to serialize this record.
return 8 + 8;
|
public int | getShapeId()
return field_1_shapeId;
|
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() );
int remainingBytes = 8;
LittleEndian.putInt( data, offset + 4, remainingBytes );
LittleEndian.putInt( data, offset + 8, field_1_shapeId );
LittleEndian.putInt( data, offset + 12, field_2_flags );
// System.arraycopy( remainingData, 0, data, offset + 26, remainingData.length );
// int pos = offset + 8 + 18 + remainingData.length;
listener.afterRecordSerialize( offset + getRecordSize(), getRecordId(), getRecordSize(), this );
return 8 + 8;
|
public void | setFlags(int field_2_flags)The flags that apply to this shape.
this.field_2_flags = field_2_flags;
|
public void | setShapeId(int field_1_shapeId)Sets a number that identifies this shape.
this.field_1_shapeId = field_1_shapeId;
|
public java.lang.String | toString()
String nl = System.getProperty("line.separator");
return getClass().getName() + ":" + nl +
" RecordId: 0x" + HexDump.toHex(RECORD_ID) + nl +
" Options: 0x" + HexDump.toHex(getOptions()) + nl +
" ShapeId: " + field_1_shapeId + nl +
" Flags: " + decodeFlags(field_2_flags) + " (0x" + HexDump.toHex(field_2_flags) + ")" + nl;
|