Examples of CTTextBody


Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

       
        _paragraphs = new ArrayList<XSSFTextParagraph>();
       
        // 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();
        for(int i = 0; i < body.sizeOfPArray(); i++) {
            _paragraphs.add(new XSSFTextParagraph(body.getPArray(i), ctShape));         
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

            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;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

    /**
     * Clear all text from this shape
     */
    public void clearText(){
        _paragraphs.clear();
        CTTextBody txBody = ctShape.getTxBody();
        txBody.setPArray(null); // remove any existing paragraphs
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

     * Add a new paragraph run to this shape
     *
     * @return created paragraph run
     */
    public XSSFTextParagraph addNewTextParagraph() {
        CTTextBody txBody = ctShape.getTxBody();
        CTTextParagraph p = txBody.addNewP();
        XSSFTextParagraph paragraph = new XSSFTextParagraph(p, ctShape);
        _paragraphs.add(paragraph);
        return paragraph;
    }   
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

     * Add a new paragraph run to this shape, set to the provided rich text string
     *
     * @return created paragraph run
     */
    public XSSFTextParagraph addNewTextParagraph(XSSFRichTextString str) {
        CTTextBody txBody = ctShape.getTxBody();
        CTTextParagraph p = txBody.addNewP();
      
        if(str.numFormattingRuns() == 0){
            CTRegularTextRun r = p.addNewR();
            CTTextCharacterProperties rPr = r.addNewRPr();
            rPr.setLang("en-US");
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

        return ct;
    }

    protected CTTextBody getTextBody(boolean create){
        CTShape shape = (CTShape) getXmlObject();
        CTTextBody txBody = shape.getTxBody();
        if (txBody == null && create) {
            txBody = shape.addNewTxBody();
            txBody.addNewBodyPr();
            txBody.addNewLstStyle();
        }
        return txBody;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

    /*package*/ XSLFTextShape(XmlObject shape, XSLFSheet sheet) {
        super(shape, sheet);

        _paragraphs = new ArrayList<XSLFTextParagraph>();
        CTTextBody txBody = getTextBody(false);
        if (txBody != null) {
            for (CTTextParagraph p : txBody.getPList()) {
                _paragraphs.add(new XSLFTextParagraph(p, this));
            }
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

    /**
     * unset text from this shape
     */
    public void clearText(){
        _paragraphs.clear();
        CTTextBody txBody = getTextBody(true);
        txBody.setPArray(null); // remove any existing paragraphs
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

     * add a new paragraph run to this shape
     *
     * @return created paragraph run
     */
    public XSLFTextParagraph addNewTextParagraph() {
        CTTextBody txBody = getTextBody(true);
        CTTextParagraph p = txBody.addNewP();
        XSLFTextParagraph paragraph = new XSLFTextParagraph(p, this);
        _paragraphs.add(paragraph);
        return paragraph;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody

        }
        return TextAutofit.NORMAL;
    }

    protected CTTextBodyProperties getTextBodyPr(){
        CTTextBody textBody = getTextBody(false);
        return textBody == null ? null : textBody.getBodyPr();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.