Search in sources :

Example 11 with CTPresetGeometry2D

use of org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D in project poi by apache.

the class XSLFPictureShape method prototype.

/**
     * @param shapeId 1-based shapeId
     * @param rel     relationship to the picture data in the ooxml package
     */
static CTPicture prototype(int shapeId, String rel) {
    CTPicture ct = CTPicture.Factory.newInstance();
    CTPictureNonVisual nvSpPr = ct.addNewNvPicPr();
    CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr();
    cnv.setName("Picture " + shapeId);
    cnv.setId(shapeId + 1);
    nvSpPr.addNewCNvPicPr().addNewPicLocks().setNoChangeAspect(true);
    nvSpPr.addNewNvPr();
    CTBlipFillProperties blipFill = ct.addNewBlipFill();
    CTBlip blip = blipFill.addNewBlip();
    blip.setEmbed(rel);
    blipFill.addNewStretch().addNewFillRect();
    CTShapeProperties spPr = ct.addNewSpPr();
    CTPresetGeometry2D prst = spPr.addNewPrstGeom();
    prst.setPrst(STShapeType.RECT);
    prst.addNewAvLst();
    return ct;
}
Also used : CTBlipFillProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties) CTShapeProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties) CTBlip(org.openxmlformats.schemas.drawingml.x2006.main.CTBlip) CTPresetGeometry2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D) CTNonVisualDrawingProps(org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps) CTPicture(org.openxmlformats.schemas.presentationml.x2006.main.CTPicture) CTPictureNonVisual(org.openxmlformats.schemas.presentationml.x2006.main.CTPictureNonVisual)

Aggregations

CTPresetGeometry2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D)10 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)9 CTNonVisualDrawingProps (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps)7 CTPoint2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D)4 CTPositiveSize2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)4 CTTransform2D (org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D)4 CTBlipFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties)3 Test (org.junit.Test)2 CTBlip (org.openxmlformats.schemas.drawingml.x2006.main.CTBlip)2 CTNonVisualPictureProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualPictureProperties)2 CTShape (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape)2 CTShapeNonVisual (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShapeNonVisual)2 StringReader (java.io.StringReader)1 QName (javax.xml.namespace.QName)1 XSLFGeometryProperties (org.apache.poi.xslf.usermodel.XSLFPropertiesDelegate.XSLFGeometryProperties)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1 XmlException (org.apache.xmlbeans.XmlException)1 XmlString (org.apache.xmlbeans.XmlString)1 CTFontReference (org.openxmlformats.schemas.drawingml.x2006.main.CTFontReference)1 CTGraphicalObject (org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject)1