• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Spacing类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.docx4j.wml.PPrBase.Spacing的典型用法代码示例。如果您正苦于以下问题:Java Spacing类的具体用法?Java Spacing怎么用?Java Spacing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Spacing类属于org.docx4j.wml.PPrBase包,在下文中一共展示了Spacing类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setStyleMLA

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
void setStyleMLA(Style style, boolean justify) {
    ObjectFactory factory = Context.getWmlObjectFactory();
    PPr paragraphProperties = factory.createPPr();
    Jc justification = factory.createJc();
    
    if (justify)
        justification.setVal(JcEnumeration.BOTH);
    else
        justification.setVal(JcEnumeration.CENTER);
    
    paragraphProperties.setJc(justification);
    
    Spacing sp = factory.createPPrBaseSpacing();
    sp.setAfter(BigInteger.ZERO);
    sp.setBefore(BigInteger.ZERO);
    sp.setLine(BigInteger.valueOf(482));
    sp.setLineRule(STLineSpacingRule.AUTO);
    paragraphProperties.setSpacing(sp);
    
    style.setPPr(paragraphProperties);
    
    RPr rpr = new RPr();
    changeFont(rpr, "Times New Roman");
    
    style.setRPr(rpr);
}
 
开发者ID:anubiann00b,项目名称:TextToDocx,代码行数:27,代码来源:Generator.java


示例2: createPageNumParagraph

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
private P createPageNumParagraph() {
	 CTSimpleField pgnum = factory.createCTSimpleField();
        pgnum.setInstr(" PAGE \\* MERGEFORMAT ");
        RPr RPr = factory.createRPr();
        RPr.setNoProof(new BooleanDefaultTrue());
        PPr ppr = factory.createPPr();
        Jc jc = factory.createJc();
        jc.setVal(JcEnumeration.CENTER);
        ppr.setJc(jc);
        PPrBase.Spacing pprbase = factory.createPPrBaseSpacing();
        pprbase.setBefore(BigInteger.valueOf(240));
        pprbase.setAfter(BigInteger.valueOf(0));
        ppr.setSpacing(pprbase);
      
        R run = factory.createR();
        run.getContent().add(RPr);
        pgnum.getContent().add(run);

        JAXBElement<CTSimpleField> fldSimple = factory.createPFldSimple(pgnum);
        P para = createParagraph();
        para.getContent().add(fldSimple);
        para.setPPr(ppr);  
        return para;
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:25,代码来源:DocxExporter.java


示例3: setParagraphSpacing

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
public void setParagraphSpacing(ObjectFactory factory, P p,  
        boolean isSpace, String before, String after, boolean isLines,  
        String beforeLines, String afterLines, boolean isLineRule,  
        String lineValue, STLineSpacingRule sTLineSpacingRule) {  
    PPr pPr = p.getPPr();  
    if (pPr == null) {  
        pPr = factory.createPPr();  
    }  
    Spacing spacing = new Spacing();  
    if (isSpace) {  
        if (before != null) {  
            // 段前磅数  
            spacing.setBefore(new BigInteger(before));  
        }  
        if (after != null) {  
            // 段后磅数  
            spacing.setAfter(new BigInteger(after));  
        }  
    }  
    if (isLines) {  
        if (beforeLines != null) {  
            // 段前行数  
            spacing.setBeforeLines(new BigInteger(beforeLines));  
        }  
        if (afterLines != null) {  
            // 段后行数  
            spacing.setAfterLines(new BigInteger(afterLines));  
        }  
    }  
    if (isLineRule) {  
        if (lineValue != null) {  
            spacing.setLine(new BigInteger(lineValue));  
        }  
        spacing.setLineRule(sTLineSpacingRule);  
    }  
    pPr.setSpacing(spacing);  
    p.setPPr(pPr);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:39,代码来源:Docx4j_创建批注_S3_Test.java


示例4: paragraphProperties

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
private PPr paragraphProperties(final Spacing spacing, final PBdr border, final Jc alignment, final boolean keepNext) {
	final PPr ppr = this.wmlObjectFactory.createPPr();

	ppr.setPBdr(border);
	ppr.setSpacing(spacing);
	ppr.setJc(alignment);

	final BooleanDefaultTrue trueElement = this.wmlObjectFactory.createBooleanDefaultTrue();
	trueElement.setVal(keepNext);
	ppr.setKeepNext(trueElement);
	ppr.setContextualSpacing(trueElement);

	return ppr;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:15,代码来源:DocXReportSummaryWriter.java


示例5: headingSpacing

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
private Spacing headingSpacing() {
	final Spacing spacing = this.wmlObjectFactory.createPPrBaseSpacing();
	spacing.setBefore(BigInteger.valueOf(240));
	spacing.setAfter(BigInteger.valueOf(240));
	spacing.setLine(BigInteger.valueOf(240));
	spacing.setLineRule(STLineSpacingRule.AUTO);
	return spacing;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:9,代码来源:DocXReportSummaryWriter.java


示例6: bodySpacing

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
private Spacing bodySpacing() {
	final Spacing spacing = this.wmlObjectFactory.createPPrBaseSpacing();
	spacing.setBefore(BigInteger.valueOf(0));
	spacing.setAfter(BigInteger.valueOf(144));
	spacing.setLine(BigInteger.valueOf(240));
	spacing.setLineRule(STLineSpacingRule.AUTO);
	return spacing;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:9,代码来源:DocXReportSummaryWriter.java


示例7: setDoubleSpacing

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
@SuppressWarnings("unused")
private static PPr setDoubleSpacing()
{
	// not exactly, changes to fixed 1.0cm
	// leaving out for now
	Spacing s = new Spacing();
	s.setLine(cmToDxa(1));
	PPr ppr = new PPr();
	ppr.setSpacing(s);
	//System.out.println(String.format("Spacing %s", ppr.getSpacing().g));

	return ppr;
}
 
开发者ID:PeerJ,项目名称:PeerJDocxFormatter,代码行数:14,代码来源:PeerJDocxFormatter.java


示例8: createParagraph

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
private P createParagraph(BandElement be) {
	P paragraph = factory.createP();
	PPr pPr = factory.createPPr();
	Spacing spacing = new Spacing();
	if ((be!= null) && be.isWrapText() && (be.getPercentLineSpacing() > 100)) {			
		spacing.setLine( BigInteger.valueOf( (be.getFont().getSize() * be.getPercentLineSpacing())/2) );
	} 
	spacing.setAfter(BigInteger.ZERO);		
	pPr.setSpacing(spacing);
	paragraph.setPPr(pPr);
	return paragraph;
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:13,代码来源:DocxExporter.java


示例9: addTableCell

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
public void addTableCell(ObjectFactory factory,  
        WordprocessingMLPackage wordMLPackage, Tr tableRow, String content,  
        RPr rpr, JcEnumeration jcEnumeration, boolean hasBgColor,  
        String backgroudColor) {  
    Tc tableCell = factory.createTc();  
    P p = factory.createP();  
    setParagraphAlign(factory, p, jcEnumeration);  
    Text t = factory.createText();  
    t.setValue(content);  
    R run = factory.createR();  
    // 设置表格内容字体样式  
    run.setRPr(rpr);  
      
    TcPr tcPr = tableCell.getTcPr();  
    if (tcPr == null) {  
        tcPr = factory.createTcPr();  
    }  
      
    CTVerticalJc valign = factory.createCTVerticalJc();  
    valign.setVal(STVerticalJc.CENTER);  
    tcPr.setVAlign(valign);  
      
    run.getContent().add(t);  
    p.getContent().add(run);  
      
    PPr ppr=p.getPPr();  
    if(ppr==null){  
        ppr=factory.createPPr();  
    }  
    //设置段后距离  
    Spacing spacing=new Spacing();  
    spacing.setAfter(new BigInteger("0"));  
    spacing.setLineRule(STLineSpacingRule.AUTO);  
    ppr.setSpacing(spacing);  
    p.setPPr(ppr);  
      
    tableCell.getContent().add(p);  
    if (hasBgColor) {  
        CTShd shd = tcPr.getShd();  
        if (shd == null) {  
            shd = factory.createCTShd();  
        }  
        shd.setColor("auto");  
        shd.setFill(backgroudColor);  
        tcPr.setShd(shd);  
        tableCell.setTcPr(tcPr);  
    }  
    tableRow.getContent().add(tableCell);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:50,代码来源:Docx4J_简单例子2.java


示例10: noSpacing

import org.docx4j.wml.PPrBase.Spacing; //导入依赖的package包/类
private Spacing noSpacing() {
	return null;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:4,代码来源:DocXReportSummaryWriter.java



注:本文中的org.docx4j.wml.PPrBase.Spacing类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TaggedToken类代码示例发布时间:2022-05-22
下一篇:
Java CharFilter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap