// Need to find a DrawingGroupRecord that
// contains a EscherDggRecord
for(Record r : records) {
if(r instanceof DrawingGroupRecord) {
DrawingGroupRecord dg = (DrawingGroupRecord)r;
dg.processChildRecords();
EscherContainerRecord cr =
dg.getEscherContainer();
if(cr == null) {
continue;
}
EscherDggRecord dgg = null;
EscherContainerRecord bStore = null;
for(Iterator<EscherRecord> it = cr.getChildIterator(); it.hasNext();) {
EscherRecord er = it.next();
if(er instanceof EscherDggRecord) {
dgg = (EscherDggRecord)er;
} else if (er.getRecordId() == EscherContainerRecord.BSTORE_CONTAINER) {
bStore = (EscherContainerRecord) er;
}
}
if(dgg != null) {
drawingManager = new DrawingManager2(dgg);
if(bStore != null){
for(EscherRecord bs : bStore.getChildRecords()){
if(bs instanceof EscherBSERecord) escherBSERecords.add((EscherBSERecord)bs);
}
}
return drawingManager;
}
}
}
// Look for the DrawingGroup record
int dgLoc = findFirstRecordLocBySid(DrawingGroupRecord.sid);
// If there is one, does it have a EscherDggRecord?
if(dgLoc != -1) {
DrawingGroupRecord dg = (DrawingGroupRecord)records.get(dgLoc);
EscherDggRecord dgg = null;
EscherContainerRecord bStore = null;
for(EscherRecord er : dg.getEscherRecords()) {
if (er instanceof EscherDggRecord) {
dgg = (EscherDggRecord) er;
} else if (er.getRecordId() == EscherContainerRecord.BSTORE_CONTAINER) {
bStore = (EscherContainerRecord) er;
}