use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPicture in project poi by apache.
the class XSLFDrawing method createPicture.
public XSLFPictureShape createPicture(String rel) {
CTPicture obj = _spTree.addNewPic();
obj.set(XSLFPictureShape.prototype(_shapeId++, rel));
XSLFPictureShape shape = new XSLFPictureShape(obj, _sheet);
shape.setAnchor(new Rectangle2D.Double());
return shape;
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPicture in project poi by apache.
the class XSLFGroupShape method removeShape.
/**
* Remove the specified shape from this group
*/
@Override
public boolean removeShape(XSLFShape xShape) {
XmlObject obj = xShape.getXmlObject();
CTGroupShape grpSp = (CTGroupShape) getXmlObject();
if (obj instanceof CTShape) {
grpSp.getSpList().remove(obj);
} else if (obj instanceof CTGroupShape) {
grpSp.getGrpSpList().remove(obj);
} else if (obj instanceof CTConnector) {
grpSp.getCxnSpList().remove(obj);
} else if (obj instanceof CTGraphicalObjectFrame) {
grpSp.getGraphicFrameList().remove(obj);
} else if (obj instanceof CTPicture) {
XSLFPictureShape ps = (XSLFPictureShape) xShape;
XSLFSheet sh = getSheet();
if (sh != null) {
sh.removePictureRelation(ps);
}
grpSp.getPicList().remove(obj);
} else {
throw new IllegalArgumentException("Unsupported shape: " + xShape);
}
return _shapes.remove(xShape);
}
Aggregations