Examples of CTTextSpacing


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

     *
     * @param linespacing the vertical line spacing
     */
    public void setLineSpacing(double linespacing){
        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
        CTTextSpacing spc = CTTextSpacing.Factory.newInstance();
        if(linespacing >= 0) spc.addNewSpcPct().setVal((int)(linespacing*1000));
        else spc.addNewSpcPts().setVal((int)(-linespacing*100));
        pr.setLnSpc(spc);
    }
View Full Code Here

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

     */
    public double getLineSpacing(){
        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
            public boolean fetch(CTTextParagraphProperties props){
                if(props.isSetLnSpc()){
                    CTTextSpacing spc = props.getLnSpc();

                    if(spc.isSetSpcPct()) setValue( spc.getSpcPct().getVal()*0.001 );
                    else if (spc.isSetSpcPts()) setValue( -spc.getSpcPts().getVal()*0.01 );
                    return true;
                }
                return false;
            }
        };
View Full Code Here

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

     *
     * @param spaceBefore the vertical white space before the paragraph.
     */
    public void setSpaceBefore(double spaceBefore){
        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
        CTTextSpacing spc = CTTextSpacing.Factory.newInstance();
        if(spaceBefore >= 0) spc.addNewSpcPct().setVal((int)(spaceBefore*1000));
        else spc.addNewSpcPts().setVal((int)(-spaceBefore*100));
        pr.setSpcBef(spc);
    }
View Full Code Here

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

     */
    public double getSpaceBefore(){
        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
            public boolean fetch(CTTextParagraphProperties props){
                if(props.isSetSpcBef()){
                    CTTextSpacing spc = props.getSpcBef();

                    if(spc.isSetSpcPct()) setValue( spc.getSpcPct().getVal()*0.001 );
                    else if (spc.isSetSpcPts()) setValue( -spc.getSpcPts().getVal()*0.01 );
                    return true;
                }
                return false;
            }
        };
View Full Code Here

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

     *
     * @param spaceAfter the vertical white space after the paragraph.
     */
    public void setSpaceAfter(double spaceAfter){
        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
        CTTextSpacing spc = CTTextSpacing.Factory.newInstance();
        if(spaceAfter >= 0) spc.addNewSpcPct().setVal((int)(spaceAfter*1000));
        else spc.addNewSpcPts().setVal((int)(-spaceAfter*100));
        pr.setSpcAft(spc);
    }
View Full Code Here

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

     */
    public double getSpaceAfter(){
        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
            public boolean fetch(CTTextParagraphProperties props){
                if(props.isSetSpcAft()){
                    CTTextSpacing spc = props.getSpcAft();

                    if(spc.isSetSpcPct()) setValue( spc.getSpcPct().getVal()*0.001 );
                    else if (spc.isSetSpcPts()) setValue( -spc.getSpcPts().getVal()*0.01 );
                    return true;
                }
                return false;
            }
        };
View Full Code Here

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

     *
     * @param linespacing the vertical line spacing
     */
    public void setLineSpacing(double linespacing){
        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
        CTTextSpacing spc = CTTextSpacing.Factory.newInstance();
        if(linespacing >= 0) spc.addNewSpcPct().setVal((int)(linespacing*1000));
        else spc.addNewSpcPts().setVal((int)(-linespacing*100));
        pr.setLnSpc(spc);
    }
View Full Code Here

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

     */
    public double getLineSpacing(){
        CTTextParagraphProperties pr = _p.getPPr();
        if(pr == null || !pr.isSetLnSpc()) return 100; // TODO fetch from master

        CTTextSpacing spc = pr.getLnSpc();
        if(spc.isSetSpcPct()) return spc.getSpcPct().getVal()*0.001;
        else if (spc.isSetSpcPts()) return -spc.getSpcPts().getVal()*0.01;
        else return 100;
    }
View Full Code Here

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

     *
     * @param spaceBefore the vertical white space before the paragraph.
     */
    public void setSpaceBefore(double spaceBefore){
        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
        CTTextSpacing spc = CTTextSpacing.Factory.newInstance();
        if(spaceBefore >= 0) spc.addNewSpcPct().setVal((int)(spaceBefore*1000));
        else spc.addNewSpcPts().setVal((int)(-spaceBefore*100));
        pr.setSpcBef(spc);
    }
View Full Code Here

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

     */
    public double getSpaceBefore(){
        CTTextParagraphProperties pr = _p.getPPr();
        if(pr == null || !pr.isSetSpcBef()) return 0// TODO fetch from master

        CTTextSpacing spc = pr.getSpcBef();
        if(spc.isSetSpcPct()) return spc.getSpcPct().getVal()*0.001;
        else if (spc.isSetSpcPts()) return -spc.getSpcPts().getVal()*0.01;
        else return 0;
    }
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.