Examples of CTTextBodyProperties


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

     *  the text.
     *
     * @return the left inset in points
     */
    public double getLeftInset(){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
          if(bodyPr.isSetLIns()){
            return Units.toPoints(bodyPr.getLIns());
          }
        }
        // If this attribute is omitted, then a value of 0.05 inches is implied
        return 3.6;
    }
View Full Code Here

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

     *  that contains the text.
     *
     * @return the right inset in points
     */
    public double getRightInset(){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
          if(bodyPr.isSetRIns()){
            return Units.toPoints(bodyPr.getRIns());
          }
        }
        // If this attribute is omitted, then a value of 0.05 inches is implied
        return 3.6;
    }
View Full Code Here

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

     *  and the top of the inscribed rectangle of the shape that contains the text.
     *
     * @return the top inset in points
     */
    public double getTopInset(){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
          if(bodyPr.isSetTIns()){
            return Units.toPoints(bodyPr.getTIns());
          }
        }
        // If this attribute is omitted, then a value of 0.05 inches is implied
        return 3.6;     
    }
View Full Code Here

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

     * @see #getBottomInset()
     *
     * @param margin    the bottom margin
     */
    public void setBottomInset(double margin){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
            if(margin == -1) bodyPr.unsetBIns();
            else bodyPr.setBIns(Units.toEMU(margin));
        }
    }
View Full Code Here

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

     * @see #getLeftInset()
     *
     * @param margin    the left margin
     */
    public void setLeftInset(double margin){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
            if(margin == -1) bodyPr.unsetLIns();
            else bodyPr.setLIns(Units.toEMU(margin));
        }
    }
View Full Code Here

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

     * @see #getRightInset()
     *
     * @param margin    the right margin
     */
    public void setRightInset(double margin){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
            if(margin == -1) bodyPr.unsetRIns();
            else bodyPr.setRIns(Units.toEMU(margin));
        }
    }
View Full Code Here

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

     * @see #getTopInset()
     *
     * @param margin    the top margin
     */
    public void setTopInset(double margin){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
            if(margin == -1) bodyPr.unsetTIns();
            else bodyPr.setTIns(Units.toEMU(margin));
        }
    }
View Full Code Here

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

    /**
     * @return whether to wrap words within the bounding rectangle
     */
    public boolean getWordWrap(){
      CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
          if(bodyPr.isSetWrap()){
            return bodyPr.getWrap() == STTextWrappingType.SQUARE;
          }
        }
        return true;
    }
View Full Code Here

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

    /**
     *
     * @param wrap  whether to wrap words within the bounding rectangle
     */
    public void setWordWrap(boolean wrap){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
            bodyPr.setWrap(wrap ? STTextWrappingType.SQUARE : STTextWrappingType.NONE);
        }
    }
View Full Code Here

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

     * Auto-fitting is when text within a shape is scaled in order to contain all the text inside
     *
     * @param value type of autofit
     */
    public void setTextAutofit(TextAutofit value){
        CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr();
        if (bodyPr != null) {
            if(bodyPr.isSetSpAutoFit()) bodyPr.unsetSpAutoFit();
            if(bodyPr.isSetNoAutofit()) bodyPr.unsetNoAutofit();
            if(bodyPr.isSetNormAutofit()) bodyPr.unsetNormAutofit();

            switch(value){
                case NONE: bodyPr.addNewNoAutofit(); break;
                case NORMAL: bodyPr.addNewNormAutofit(); break;
                case SHAPE: bodyPr.addNewSpAutoFit(); break;
            }
        }
    }
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.