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

public final Class EscherDggRecord

extends EscherRecord
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, .Map, java.util.function.Supplier, com.zaxxer.sparsebits.SparseBitSet, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.util.GenericRecordUtil, .LittleEndian, .RecordFormatException

This record defines the drawing groups used for a particular sheet.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private final List<EscherDggRecord.FileIdCluster>
private int
public static final short

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public EscherDggRecord.FileIdCluster

Returns:

the new FileIdCluster
addCluster
(int
id of the drawing group (stored in the record options)
dgId
,
int
initial value of the numShapedUsed field
numShapedUsed
)

Add a new cluster

public EscherDggRecord.FileIdCluster

Returns:

the new FileIdCluster
addCluster
(int
id of the drawing group (stored in the record options)
dgId
,
int
initial value of the numShapedUsed field
numShapedUsed
,
boolean
if true then sort clusters by drawing group id.( In Excel the clusters are sorted but in PPT they are not)
sort
)

Add a new cluster

public int

Returns:

a new shape id.
allocateShapeId
(EscherDgRecord
the EscherDgRecord which receives the new shape
dg
,
boolean
if true then sort clusters by drawing group id.( In Excel the clusters are sorted but in PPT they are not)
sort
)

Allocates new shape id for the drawing group

public EscherDggRecord
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 next available drawing group id
findNewDrawingGroupId
()

Finds the next available (1 based) drawing group id

public int

Returns:

the number of drawings saved
getDrawingsSaved
()

Gets the number of drawings saved

public EscherDggRecord.FileIdCluster[]

Returns:

the file id clusters
getFileIdClusters
()

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

Returns:

The maximum drawing group ID
getMaxDrawingGroupId
()

Gets the maximum drawing group ID

public int

Returns:

the number of id clusters + 1
getNumIdClusters
()

Number of id clusters + 1

public int

Returns:

the number of shapes saved
getNumShapesSaved
()

Gets the number of shapes saved

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 int

Returns:

the next available shape id
getShapeIdMax
()

Gets the next available shape id

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
setDrawingsSaved(int
the number of drawings saved
drawingsSaved
)

Sets the number of drawings saved

public void
setFileIdClusters(EscherDggRecord.FileIdCluster[]
the file id clusters
fileIdClusters
)

Sets the file id clusters

public void
setNumShapesSaved(int
the number of shapes saved
numShapesSaved
)

Sets the number of shapes saved

public void
setShapeIdMax(int
the next available shape id
shapeIdMax
)

The maximum is actually the next available shape id.

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

Field Detail

field_1_shapeIdMaxback to summary
private int field_1_shapeIdMax
field_3_numShapesSavedback to summary
private int field_3_numShapesSaved
field_4_drawingsSavedback to summary
private int field_4_drawingsSaved
field_5_fileIdClustersback to summary
private final List<EscherDggRecord.FileIdCluster> field_5_fileIdClusters
maxDgIdback to summary
private int maxDgId
RECORD_IDback to summary
public static final short RECORD_ID

Constructor Detail

EscherDggRecordback to summary
public EscherDggRecord()
EscherDggRecordback to summary
public EscherDggRecord(EscherDggRecord other)

Method Detail

addClusterback to summary
public EscherDggRecord.FileIdCluster addCluster(int dgId, int numShapedUsed)

Add a new cluster

Parameters
dgId:int

id of the drawing group (stored in the record options)

numShapedUsed:int

initial value of the numShapedUsed field

Returns:EscherDggRecord.FileIdCluster

the new FileIdCluster

addClusterback to summary
public EscherDggRecord.FileIdCluster addCluster(int dgId, int numShapedUsed, boolean sort)

Add a new cluster

Parameters
dgId:int

id of the drawing group (stored in the record options)

numShapedUsed:int

initial value of the numShapedUsed field

sort:boolean

if true then sort clusters by drawing group id.( In Excel the clusters are sorted but in PPT they are not)

Returns:EscherDggRecord.FileIdCluster

the new FileIdCluster

allocateShapeIdback to summary
public int allocateShapeId(EscherDgRecord dg, boolean sort)

Allocates new shape id for the drawing group

Parameters
dg:EscherDgRecord

the EscherDgRecord which receives the new shape

sort:boolean

if true then sort clusters by drawing group id.( In Excel the clusters are sorted but in PPT they are not)

Returns:int

a new shape id.

copyback to summary
public EscherDggRecord copy()

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

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

Returns:EscherDggRecord

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
findNewDrawingGroupIdback to summary
public short findNewDrawingGroupId()

Finds the next available (1 based) drawing group id

Returns:short

the next available drawing group id

getDrawingsSavedback to summary
public int getDrawingsSaved()

Gets the number of drawings saved

Returns:int

the number of drawings saved

getFileIdClustersback to summary
public EscherDggRecord.FileIdCluster[] getFileIdClusters()
Returns:EscherDggRecord.FileIdCluster[]

the file id clusters

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
getMaxDrawingGroupIdback to summary
public int getMaxDrawingGroupId()

Gets the maximum drawing group ID

Returns:int

The maximum drawing group ID

getNumIdClustersback to summary
public int getNumIdClusters()

Number of id clusters + 1

Returns:int

the number of id clusters + 1

getNumShapesSavedback to summary
public int getNumShapesSaved()

Gets the number of shapes saved

Returns:int

the number of shapes saved

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
getShapeIdMaxback to summary
public int getShapeIdMax()

Gets the next available shape id

Returns:int

the next available shape id

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
setDrawingsSavedback to summary
public void setDrawingsSaved(int drawingsSaved)

Sets the number of drawings saved

Parameters
drawingsSaved:int

the number of drawings saved

setFileIdClustersback to summary
public void setFileIdClusters(EscherDggRecord.FileIdCluster[] fileIdClusters)

Sets the file id clusters

Parameters
fileIdClusters:EscherDggRecord.FileIdCluster[]

the file id clusters

setNumShapesSavedback to summary
public void setNumShapesSaved(int numShapesSaved)

Sets the number of shapes saved

Parameters
numShapesSaved:int

the number of shapes saved

setShapeIdMaxback to summary
public void setShapeIdMax(int shapeIdMax)

The maximum is actually the next available shape id.

Parameters
shapeIdMax:int

the next available shape id

sortClusterback to summary
private void sortCluster()
org.apache.poi.ddf back to summary

public Class EscherDggRecord.FileIdCluster

extends Object
implements GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord

Field Summary

Modifier and TypeField and Description
private int
private int

Constructor Summary

AccessConstructor and Description
public
public
FileIdCluster(int drawingGroupId, int numShapeIdsUsed)

Method Summary

Modifier and TypeMethod and Description
private static int
public int
public Map<String, Supplier<?>>
public int
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

field_1_drawingGroupIdback to summary
private int field_1_drawingGroupId
field_2_numShapeIdsUsedback to summary
private int field_2_numShapeIdsUsed

Constructor Detail

FileIdClusterback to summary
public FileIdCluster(EscherDggRecord.FileIdCluster other)
FileIdClusterback to summary
public FileIdCluster(int drawingGroupId, int numShapeIdsUsed)

Method Detail

compareFileIdClusterback to summary
private static int compareFileIdCluster(EscherDggRecord.FileIdCluster f1, EscherDggRecord.FileIdCluster f2)
getDrawingGroupIdback to summary
public int getDrawingGroupId()
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

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

Annotations
@Override
getNumShapeIdsUsedback to summary
public int getNumShapeIdsUsed()
incrementUsedShapeIdback to summary
private void incrementUsedShapeId()