use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape in project poi by apache.
the class XSLFAutoShape method prototype.
/**
* @param shapeId 1-based shapeId
*/
static CTShape prototype(int shapeId) {
CTShape ct = CTShape.Factory.newInstance();
CTShapeNonVisual nvSpPr = ct.addNewNvSpPr();
CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr();
cnv.setName("AutoShape " + shapeId);
cnv.setId(shapeId + 1);
nvSpPr.addNewCNvSpPr();
nvSpPr.addNewNvPr();
CTShapeProperties spPr = ct.addNewSpPr();
CTPresetGeometry2D prst = spPr.addNewPrstGeom();
prst.setPrst(STShapeType.RECT);
prst.addNewAvLst();
return ct;
}
use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape in project poi by apache.
the class XSLFCommonSlideData method processShape.
private void processShape(CTGroupShape gs, List<DrawingTextBody> out) {
for (CTShape shape : gs.getSpArray()) {
CTTextBody ctTextBody = shape.getTxBody();
if (ctTextBody == null) {
continue;
}
DrawingTextBody textBody;
CTApplicationNonVisualDrawingProps nvpr = shape.getNvSpPr().getNvPr();
if (nvpr.isSetPh()) {
textBody = new DrawingTextPlaceholder(ctTextBody, nvpr.getPh());
} else {
textBody = new DrawingTextBody(ctTextBody);
}
out.add(textBody);
}
}
use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape in project poi by apache.
the class XSSFShapeGroup method createPicture.
/**
* Creates a picture.
*
* @param anchor the client anchor describes how this picture is attached to the sheet.
* @param pictureIndex the index of the picture in the workbook collection of pictures,
* {@link XSSFWorkbook#getAllPictures()} .
* @return the newly created picture shape.
*/
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) {
PackageRelationship rel = getDrawing().addPictureReference(pictureIndex);
CTPicture ctShape = ctGroup.addNewPic();
ctShape.set(XSSFPicture.prototype());
XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape);
shape.parent = this;
shape.anchor = anchor;
shape.setPictureReference(rel);
return shape;
}
use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape in project poi by apache.
the class XSSFShapeGroup method createTextbox.
/**
* Constructs a textbox.
*
* @param anchor the child anchor describes how this shape is attached
* to the group.
* @return the newly created textbox.
*/
public XSSFTextBox createTextbox(XSSFChildAnchor anchor) {
CTShape ctShape = ctGroup.addNewSp();
ctShape.set(XSSFSimpleShape.prototype());
XSSFTextBox shape = new XSSFTextBox(getDrawing(), ctShape);
shape.parent = this;
shape.anchor = anchor;
shape.getCTShape().getSpPr().setXfrm(anchor.getCTTransform2D());
return shape;
}
use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape in project poi by apache.
the class XSSFShapeGroup method createSimpleShape.
/**
* Creates a simple shape. This includes such shapes as lines, rectangles,
* and ovals.
*
* @param anchor the child anchor describes how this shape is attached
* to the group.
* @return the newly created shape.
*/
public XSSFSimpleShape createSimpleShape(XSSFChildAnchor anchor) {
CTShape ctShape = ctGroup.addNewSp();
ctShape.set(XSSFSimpleShape.prototype());
XSSFSimpleShape shape = new XSSFSimpleShape(getDrawing(), ctShape);
shape.parent = this;
shape.anchor = anchor;
shape.getCTShape().getSpPr().setXfrm(anchor.getCTTransform2D());
return shape;
}
Aggregations