/** * Add a shape to this group. * * @param shape - the Shape to add */ public void addShape(Shape shape){ _escherContainer.addChildRecord(shape.getSpContainer()); Sheet sheet = getSheet(); shape.setSheet(sheet); shape.setShapeId(sheet.allocateShapeId()); shape.afterInsert(sheet); }
/** * Add a new Shape to this Slide * * @param shape - the Shape to add */ public void addShape(Shape shape) { PPDrawing ppdrawing = getPPDrawing(); EscherContainerRecord dgContainer = (EscherContainerRecord) ppdrawing.getEscherRecords()[0]; EscherContainerRecord spgr = (EscherContainerRecord) Shape.getEscherChild(dgContainer, EscherContainerRecord.SPGR_CONTAINER); spgr.addChildRecord(shape.getSpContainer()); shape.setSheet(this); shape.setShapeId(allocateShapeId()); shape.afterInsert(this); }