当前位置: 首页>>代码示例>>Java>>正文


Java PPr.setJc方法代码示例

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


在下文中一共展示了PPr.setJc方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setAlignment

import org.docx4j.wml.PPr; //导入方法依赖的package包/类
/**
 * Gets a center aligned PPr for P
 * @return
 */
protected PPr setAlignment(ALIGN align) {
	ObjectFactory wmlObjectFactory = new ObjectFactory();
	PPr ppr = wmlObjectFactory.createPPr();
    Jc jc = wmlObjectFactory.createJc();
    JcEnumeration jcEnumeration = JcEnumeration.CENTER;
    if (align!=null) {
    	switch (align) {
		case LEFT:
			jcEnumeration = JcEnumeration.LEFT;
			break;
		case RIGHT:
			jcEnumeration = JcEnumeration.RIGHT;
			break;
		}
    }
    ppr.setJc(jc); 
    jc.setVal(jcEnumeration);
	return ppr;
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:24,代码来源:PostprocessBase.java

示例2: setStyleMLA

import org.docx4j.wml.PPr; //导入方法依赖的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

示例3: createPageNumParagraph

import org.docx4j.wml.PPr; //导入方法依赖的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

示例4: createParagraphWithHAlign

import org.docx4j.wml.PPr; //导入方法依赖的package包/类
/** 
 * 创建段落设置水平对齐方式 
 * @return 
 */  
private P createParagraphWithHAlign() {  
    P p;  
    PPr pPr;  
    p = Docx4j_Helper.factory.createP();  
    pPr=Docx4j_Helper.factory.createPPr();  
    Jc jc =Docx4j_Helper.factory.createJc();  
    jc.setVal(JcEnumeration.CENTER);  
    pPr.setJc(jc);  
    p.setPPr(pPr);  
    return p;  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:16,代码来源:Docx4j_Helper.java

示例5: setHorizontalAlignment

import org.docx4j.wml.PPr; //导入方法依赖的package包/类
public void setHorizontalAlignment(P paragraph, JcEnumeration hAlign) {  
    if (hAlign != null) {  
        PPr pprop = new PPr();  
        Jc align = new Jc();  
        align.setVal(hAlign);  
        pprop.setJc(align);  
        paragraph.setPPr(pprop);  
    }  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:10,代码来源:Docx4j_创建表格_S5_Test.java

示例6: paragraphProperties

import org.docx4j.wml.PPr; //导入方法依赖的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

示例7: createIt

import org.docx4j.wml.PPr; //导入方法依赖的package包/类
public static P createIt() {

		org.docx4j.wml.ObjectFactory wmlObjectFactory = new org.docx4j.wml.ObjectFactory();

		P p = wmlObjectFactory.createP();
		    // Create object for pPr
		    PPr ppr = wmlObjectFactory.createPPr();
		    p.setPPr(ppr);
		        // Create object for rPr
		        ParaRPr pararpr = wmlObjectFactory.createParaRPr();
		        ppr.setRPr(pararpr);
		            // Create object for u
		            U u = wmlObjectFactory.createU();
		            pararpr.setU(u);
		                u.setVal(org.docx4j.wml.UnderlineEnumeration.SINGLE);
		            // Create object for lang
		            CTLanguage language = wmlObjectFactory.createCTLanguage();
		            pararpr.setLang(language);
		                language.setVal( "en-AU");
		        // Create object for jc
		        Jc jc = wmlObjectFactory.createJc();
		        ppr.setJc(jc);
		            jc.setVal(org.docx4j.wml.JcEnumeration.CENTER);
		    // Create object for r
		    R r = wmlObjectFactory.createR();
		    p.getContent().add( r);
		        // Create object for rPr
		        RPr rpr = wmlObjectFactory.createRPr();
		        r.setRPr(rpr);
		            // Create object for u
		            U u2 = wmlObjectFactory.createU();
		            rpr.setU(u2);
		                u2.setVal(org.docx4j.wml.UnderlineEnumeration.SINGLE);
		            // Create object for lang
		            CTLanguage language2 = wmlObjectFactory.createCTLanguage();
		            rpr.setLang(language2);
		                language2.setVal( "en-AU");
		        // Create object for t (wrapped in JAXBElement)
		        Text text = wmlObjectFactory.createText();
		        JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
		        r.getContent().add( textWrapped);
		            text.setValue( "Underlined and centred");
		            
		            

		return p;
		}
 
开发者ID:Transkribus,项目名称:TranskribusCore,代码行数:48,代码来源:DocxBuilder.java


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