use of org.apache.poi.ddf.EscherSplitMenuColorsRecord in project poi by apache.
the class InternalWorkbook method createDrawingGroup.
/**
* Creates a primary drawing group record. If it already
* exists then it's modified.
*/
public void createDrawingGroup() {
if (drawingManager == null) {
EscherContainerRecord dggContainer = new EscherContainerRecord();
EscherDggRecord dgg = new EscherDggRecord();
EscherOptRecord opt = new EscherOptRecord();
EscherSplitMenuColorsRecord splitMenuColors = new EscherSplitMenuColorsRecord();
dggContainer.setRecordId((short) 0xF000);
dggContainer.setOptions((short) 0x000F);
dgg.setRecordId(EscherDggRecord.RECORD_ID);
dgg.setOptions((short) 0x0000);
dgg.setShapeIdMax(1024);
dgg.setNumShapesSaved(0);
dgg.setDrawingsSaved(0);
dgg.setFileIdClusters(new EscherDggRecord.FileIdCluster[] {});
drawingManager = new DrawingManager2(dgg);
EscherContainerRecord bstoreContainer = null;
if (!escherBSERecords.isEmpty()) {
bstoreContainer = new EscherContainerRecord();
bstoreContainer.setRecordId(EscherContainerRecord.BSTORE_CONTAINER);
bstoreContainer.setOptions((short) ((escherBSERecords.size() << 4) | 0xF));
for (EscherRecord escherRecord : escherBSERecords) {
bstoreContainer.addChildRecord(escherRecord);
}
}
opt.setRecordId((short) 0xF00B);
opt.setOptions((short) 0x0033);
opt.addEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296));
opt.addEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, 0x08000041));
opt.addEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, 134217792));
splitMenuColors.setRecordId((short) 0xF11E);
splitMenuColors.setOptions((short) 0x0040);
splitMenuColors.setColor1(0x0800000D);
splitMenuColors.setColor2(0x0800000C);
splitMenuColors.setColor3(0x08000017);
splitMenuColors.setColor4(0x100000F7);
dggContainer.addChildRecord(dgg);
if (bstoreContainer != null) {
dggContainer.addChildRecord(bstoreContainer);
}
dggContainer.addChildRecord(opt);
dggContainer.addChildRecord(splitMenuColors);
int dgLoc = findFirstRecordLocBySid(DrawingGroupRecord.sid);
if (dgLoc == -1) {
DrawingGroupRecord drawingGroup = new DrawingGroupRecord();
drawingGroup.addEscherRecord(dggContainer);
int loc = findFirstRecordLocBySid(CountryRecord.sid);
getRecords().add(loc + 1, drawingGroup);
} else {
DrawingGroupRecord drawingGroup = new DrawingGroupRecord();
drawingGroup.addEscherRecord(dggContainer);
getRecords().set(dgLoc, drawingGroup);
}
}
}
Aggregations