本文整理汇总了Java中org.docx4j.wml.PPrBase.Spacing.setLineRule方法的典型用法代码示例。如果您正苦于以下问题:Java Spacing.setLineRule方法的具体用法?Java Spacing.setLineRule怎么用?Java Spacing.setLineRule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.docx4j.wml.PPrBase.Spacing
的用法示例。
在下文中一共展示了Spacing.setLineRule方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: 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);
}
示例3: 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;
}
示例4: 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;
}
示例5: 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);
}