use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody 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.main.CTTextBody in project poi by apache.
the class XSLFTextShape method addNewTextParagraph.
/**
* add a new paragraph run to this shape
*
* @return created paragraph run
*/
public XSLFTextParagraph addNewTextParagraph() {
CTTextBody txBody = getTextBody(false);
CTTextParagraph p;
if (txBody == null) {
txBody = getTextBody(true);
p = txBody.getPArray(0);
p.removeR(0);
} else {
p = txBody.addNewP();
}
XSLFTextParagraph paragraph = newTextParagraph(p);
_paragraphs.add(paragraph);
return paragraph;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody in project poi by apache.
the class XSLFTextShape method getTextBodyPr.
protected CTTextBodyProperties getTextBodyPr(boolean create) {
CTTextBody textBody = getTextBody(create);
if (textBody == null) {
return null;
}
CTTextBodyProperties textBodyPr = textBody.getBodyPr();
if (textBodyPr == null && create) {
textBodyPr = textBody.addNewBodyPr();
}
return textBodyPr;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody in project poi by apache.
the class XSLFAutoShape method initTextBody.
protected static void initTextBody(CTTextBody txBody) {
CTTextBodyProperties bodypr = txBody.addNewBodyPr();
bodypr.setAnchor(STTextAnchoringType.T);
bodypr.setRtlCol(false);
CTTextParagraph p = txBody.addNewP();
p.addNewPPr().setAlgn(STTextAlignType.L);
CTTextCharacterProperties endPr = p.addNewEndParaRPr();
endPr.setLang("en-US");
endPr.setSz(1100);
p.addNewR().setT("");
txBody.addNewLstStyle();
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody in project poi by apache.
the class XSSFSimpleShape method prototype.
/**
* Prototype with the default structure of a new auto-shape.
*/
protected static CTShape prototype() {
if (prototype == null) {
CTShape shape = CTShape.Factory.newInstance();
CTShapeNonVisual nv = shape.addNewNvSpPr();
CTNonVisualDrawingProps nvp = nv.addNewCNvPr();
nvp.setId(1);
nvp.setName("Shape 1");
nv.addNewCNvSpPr();
CTShapeProperties sp = shape.addNewSpPr();
CTTransform2D t2d = sp.addNewXfrm();
CTPositiveSize2D p1 = t2d.addNewExt();
p1.setCx(0);
p1.setCy(0);
CTPoint2D p2 = t2d.addNewOff();
p2.setX(0);
p2.setY(0);
CTPresetGeometry2D geom = sp.addNewPrstGeom();
geom.setPrst(STShapeType.RECT);
geom.addNewAvLst();
CTTextBody body = shape.addNewTxBody();
CTTextBodyProperties bodypr = body.addNewBodyPr();
bodypr.setAnchor(STTextAnchoringType.T);
bodypr.setRtlCol(false);
CTTextParagraph p = body.addNewP();
p.addNewPPr().setAlgn(STTextAlignType.L);
CTTextCharacterProperties endPr = p.addNewEndParaRPr();
endPr.setLang("en-US");
endPr.setSz(1100);
CTSolidColorFillProperties scfpr = endPr.addNewSolidFill();
scfpr.addNewSrgbClr().setVal(new byte[] { 0, 0, 0 });
body.addNewLstStyle();
prototype = shape;
}
return prototype;
}
Aggregations