public XDDFTextParagraph initialize() { _body.addNewLstStyle(); _body.addNewBodyPr(); XDDFBodyProperties bp = getBodyProperties(); bp.setAnchoring(AnchorType.TOP); bp.setRightToLeft(false); XDDFTextParagraph p = addNewParagraph(); p.setTextAlignment(TextAlignment.LEFT); XDDFRunProperties end = p.addAfterLastRunProperties(); end.setLanguage(Locale.US); end.setFontSize(11.0); return p; }
public XDDFTextParagraph addNewParagraph() { return new XDDFTextParagraph(_body.addNewP(), this); }
public XDDFBodyProperties getBodyProperties() { return new XDDFBodyProperties(_body.getBodyPr()); }
public void setBodyProperties(XDDFBodyProperties properties) { if (properties == null) { _body.addNewBodyPr(); } else { _body.setBodyPr(properties.getXmlObject()); } }
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; }
public void setLevel2Properties(XDDFParagraphProperties properties) { if (properties == null) { if (_body.isSetLstStyle()) { CTTextListStyle style = _body.getLstStyle(); if (style.isSetLvl2PPr()) { style.unsetLvl2PPr(); } } } else { CTTextListStyle style = _body.isSetLstStyle() ? _body.getLstStyle() : _body.addNewLstStyle(); style.setLvl2PPr(properties.getXmlObject()); } }
thisTB.setBodyPr((CTTextBodyProperties) otherTB.getBodyPr().copy()); if (thisTB.isSetLstStyle()) { thisTB.unsetLstStyle(); if (otherTB.isSetLstStyle()) { thisTB.setLstStyle((CTTextListStyle) otherTB.getLstStyle().copy());
public static void setAxisTitle(XSSFChart chart, int axisIdx, String title) { CTValAx valAx = chart.getCTChart().getPlotArea().getValAxArray(axisIdx); CTTitle ctTitle = valAx.addNewTitle(); ctTitle.addNewLayout(); ctTitle.addNewOverlay().setVal(false); CTTextBody rich = ctTitle.addNewTx().addNewRich(); rich.addNewBodyPr(); rich.addNewLstStyle(); CTTextParagraph p = rich.addNewP(); p.addNewPPr().addNewDefRPr(); p.addNewR().setT(title); p.addNewEndParaRPr(); }
public XDDFParagraphProperties getLevel1Properties() { if (_body.isSetLstStyle() && _body.getLstStyle().isSetLvl1PPr()) { return new XDDFParagraphProperties(_body.getLstStyle().getLvl1PPr()); } else { return null; } }
/** * 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; }
/** * Clear all text from this shape */ public void clearText() { _paragraphs.clear(); CTTextBody txBody = ctShape.getTxBody(); txBody.setPArray(null); // remove any existing paragraphs }
public List<XDDFTextParagraph> getParagraphs() { return Collections.unmodifiableList( _body.getPList().stream().map(ds -> new XDDFTextParagraph(ds, this)).collect(Collectors.toList())); }
protected XSSFSimpleShape(XSSFDrawing drawing, CTShape ctShape) { this.drawing = drawing; this.ctShape = ctShape; _paragraphs = new ArrayList<>(); // initialize any existing paragraphs - this will be the default body // paragraph in a new shape, // or existing paragraphs that have been loaded from the file CTTextBody body = ctShape.getTxBody(); if (body == null) { _textBody = null; } else { _textBody = new XDDFTextBody(this, body); for (int i = 0; i < body.sizeOfPArray(); i++) { _paragraphs.add(new XSSFTextParagraph(body.getPArray(i), ctShape)); } } }
public XDDFTextParagraph getParagraph(int index) { return new XDDFTextParagraph(_body.getPArray(index), this); }
public XDDFTextParagraph insertNewParagraph(int index) { return new XDDFTextParagraph(_body.insertNewP(index), this); }
public void setLevel9Properties(XDDFParagraphProperties properties) { if (properties == null) { if (_body.isSetLstStyle()) { CTTextListStyle style = _body.getLstStyle(); if (style.isSetLvl9PPr()) { style.unsetLvl9PPr(); } } } else { CTTextListStyle style = _body.isSetLstStyle() ? _body.getLstStyle() : _body.addNewLstStyle(); style.setLvl9PPr(properties.getXmlObject()); } }
CTTextBodyProperties bodypr = body.addNewBodyPr(); bodypr.setAnchor(STTextAnchoringType.CTR); bodypr.setRtlCol(false); CTTextParagraph p = body.addNewP(); p.addNewPPr().setAlgn(STTextAlignType.CTR); CTTextCharacterProperties endPr = p.addNewEndParaRPr(); endPr.setSz(1100); body.addNewLstStyle();
public XDDFParagraphProperties getLevel3Properties() { if (_body.isSetLstStyle() && _body.getLstStyle().isSetLvl3PPr()) { return new XDDFParagraphProperties(_body.getLstStyle().getLvl3PPr()); } else { return null; } }
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; }