Search in sources :

Example 11 with CTPicture

use of org.openxmlformats.schemas.presentationml.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);
}
Also used : CTConnector(org.openxmlformats.schemas.presentationml.x2006.main.CTConnector) CTGraphicalObjectFrame(org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame) CTPicture(org.openxmlformats.schemas.presentationml.x2006.main.CTPicture) XmlObject(org.apache.xmlbeans.XmlObject) CTShape(org.openxmlformats.schemas.presentationml.x2006.main.CTShape) CTGroupShape(org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape)

Aggregations

CTPicture (org.openxmlformats.schemas.presentationml.x2006.main.CTPicture)10 XmlObject (org.apache.xmlbeans.XmlObject)7 CTConnector (org.openxmlformats.schemas.presentationml.x2006.main.CTConnector)4 CTGraphicalObjectFrame (org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame)4 CTGroupShape (org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape)4 CTShape (org.openxmlformats.schemas.presentationml.x2006.main.CTShape)4 QName (javax.xml.namespace.QName)2 CTBlip (org.openxmlformats.schemas.drawingml.x2006.main.CTBlip)2 CTBlipFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties)2 CTLock (com.microsoft.schemas.office.office.CTLock)1 CTFormulas (com.microsoft.schemas.vml.CTFormulas)1 CTGroup (com.microsoft.schemas.vml.CTGroup)1 CTH (com.microsoft.schemas.vml.CTH)1 CTHandles (com.microsoft.schemas.vml.CTHandles)1 CTPath (com.microsoft.schemas.vml.CTPath)1 CTShape (com.microsoft.schemas.vml.CTShape)1 CTShapetype (com.microsoft.schemas.vml.CTShapetype)1 CTTextPath (com.microsoft.schemas.vml.CTTextPath)1 Rectangle2D (java.awt.geom.Rectangle2D)1 ArrayList (java.util.ArrayList)1