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


Java CTBorder.setVal方法代码示例

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


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

示例1: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
/** 
 *  本方法给表格添加边框 
 */  
public void addBorders(Tbl table) {  
    table.setTblPr(new TblPr());  
    CTBorder border = new CTBorder();  
    border.setColor("auto");  
    border.setSz(new BigInteger("4"));  
    border.setSpace(new BigInteger("0"));  
    border.setVal(STBorder.SINGLE);  
   
    TblBorders borders = new TblBorders();  
    borders.setBottom(border);  
    borders.setLeft(border);  
    borders.setRight(border);  
    borders.setTop(border);  
    borders.setInsideH(border);  
    borders.setInsideV(border);  
    table.getTblPr().setTblBorders(borders);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:WordprocessingMLPackageRender.java

示例2: addRPrBorderStyle

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
/**
 * @Description: 设置字符边框
 */
public void addRPrBorderStyle(RPr runProperties, String size,
        STBorder bordType, String space, String color) {
    CTBorder value = new CTBorder();
    if (StringUtils.isNotBlank(color)) {
        value.setColor(color);
    }
    if (StringUtils.isNotBlank(size)) {
        value.setSz(new BigInteger(size));
    }
    if (StringUtils.isNotBlank(space)) {
        value.setSpace(new BigInteger(space));
    }
    if (bordType != null) {
        value.setVal(bordType);
    }
    runProperties.setBdr(value);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:Docx4j_工具类_S3_Test.java

示例3: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
/**
 *  本方法为表格添加边框
 */
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
 
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:TableWithMergedCells.java

示例4: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
public void addBorders(Tbl table, String borderSize) {
	table.setTblPr(new TblPr());
	CTBorder border = new CTBorder();
	border.setColor("auto");
	border.setSz(new BigInteger(borderSize));
	border.setSpace(new BigInteger("0"));
	border.setVal(STBorder.SINGLE);
	TblBorders borders = new TblBorders();
	borders.setBottom(border);
	borders.setLeft(border);
	borders.setRight(border);
	borders.setTop(border);
	borders.setInsideH(border);
	borders.setInsideV(border);
	table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:17,代码来源:Docx4J_例子2.java

示例5: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
public void addBorders(Tbl table, String borderSize) {  
    table.setTblPr(new TblPr());  
    CTBorder border = new CTBorder();  
    border.setColor("auto");  
    border.setSz(new BigInteger(borderSize));  
    border.setSpace(new BigInteger("0"));  
    border.setVal(STBorder.SINGLE);  
    TblBorders borders = new TblBorders();  
    borders.setBottom(border);  
    borders.setLeft(border);  
    borders.setRight(border);  
    borders.setTop(border);  
    borders.setInsideH(border);  
    borders.setInsideV(border);  
    table.getTblPr().setTblBorders(borders);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:17,代码来源:Docx4J_简单例子2.java

示例6: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
/**
 *  本方法给表格添加边框
 */
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
 
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:TableWithStyledContent.java

示例7: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
 
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:18,代码来源:TableWithBorders.java

示例8: createHorizontalLine

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

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

		// Create object for p
		P p = wmlObjectFactory.createP();
		// Create object for pPr
		PPr ppr = wmlObjectFactory.createPPr();
		p.setPPr(ppr);
		// Create object for pBdr
		PPrBase.PBdr pprbasepbdr = wmlObjectFactory.createPPrBasePBdr();
		ppr.setPBdr(pprbasepbdr);
		// Create object for bottom
		CTBorder border = wmlObjectFactory.createCTBorder();
		pprbasepbdr.setBottom(border);
		border.setVal(org.docx4j.wml.STBorder.SINGLE);
		border.setSz(BigInteger.valueOf(6));
		border.setColor("auto");
		border.setSpace(BigInteger.valueOf(1));

		return p;
	}
 
开发者ID:ShapeChange,项目名称:ShapeChange,代码行数:23,代码来源:DocxUtil.java

示例9: appendNoneBordersAndShading

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
protected void appendNoneBordersAndShading(List<Property> tableProperties) {
CTBorder ctBrdr = null;
CTShd shd = Context.getWmlObjectFactory().createCTShd();
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderLeft(ctBrdr));
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderRight(ctBrdr));
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderTop(ctBrdr));
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderBottom(ctBrdr));
	shd.setColor("auto");
	shd.setFill("auto");
	shd.setVal(STShd.CLEAR);
	tableProperties.add(new Shading(shd));
}
 
开发者ID:plutext,项目名称:docx-html-editor,代码行数:21,代码来源:SessionAwareAbstractTableWriter.java

示例10: addBorders

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
/**
 * Add border to table
 * @param table
 */
private static void addBorders(Tbl table) {
	table.setTblPr(new TblPr());
	CTBorder border = new CTBorder();
	border.setColor("auto");
	border.setSz(new BigInteger("4"));
	border.setSpace(new BigInteger("0"));
	border.setVal(STBorder.SINGLE);
	TblBorders borders = new TblBorders();
	borders.setBottom(border);
	borders.setLeft(border);
	borders.setRight(border);
	borders.setTop(border);
	borders.setInsideH(border);
	borders.setInsideV(border);
	table.getTblPr().setTblBorders(borders);
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:21,代码来源:TableWithBorders.java

示例11: main

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	Docx4J_例子2 t = new Docx4J_例子2();
	WordprocessingMLPackage wordMLPackage = t
			.createWordprocessingMLPackage();
	MainDocumentPart mp = wordMLPackage.getMainDocumentPart();
	ObjectFactory factory = Context.getWmlObjectFactory();

	Relationship relationship = t.createHeaderPart(wordMLPackage, mp,
			factory, false, "3");
	relationship = t.createTextHeaderPart(wordMLPackage, mp, factory,
			"我是页眉,独乐乐不如众乐乐", true, "3", JcEnumeration.CENTER);
	t.addParagraphTest(wordMLPackage, mp, factory);
	t.addPageBreak(wordMLPackage, factory, STBrType.PAGE);
	t.createHeaderReference(wordMLPackage, mp, factory, relationship);
	t.createNormalTableTest(wordMLPackage, mp, factory);
	t.addPageBreak(wordMLPackage, factory, STBrType.TEXT_WRAPPING);
	t.createTableTest(wordMLPackage, mp, factory);
	t.addPageBreak(wordMLPackage, factory, STBrType.TEXT_WRAPPING);
	P paragraph=factory.createP();
	CTBorder topBorder=new CTBorder() ;
	topBorder.setSpace(new BigInteger("1"));
	topBorder.setSz(new BigInteger("2"));
	topBorder.setVal(STBorder.WAVE);
	t.createParagraghLine(wordMLPackage, mp, factory, paragraph, topBorder, topBorder, topBorder, topBorder);
	mp.addObject(paragraph);
	t.createHyperlink(wordMLPackage, mp, factory,paragraph,
			"mailto:[email protected]?subject=docx4j测试", "联系我","微软雅黑","24",JcEnumeration.CENTER);
	
	// 页脚
	// relationship = t.createFooterPart(wordMLPackage, mp, factory,
	// false,"3");
	// relationship = t.createTextFooterPart(wordMLPackage, mp,
	// factory,"我是页脚", true, "3", JcEnumeration.CENTER);
	relationship = t.createFooterPageNumPart(wordMLPackage, mp, factory,
			false, "3", JcEnumeration.CENTER);
	t.createFooterReference(wordMLPackage, mp, factory, relationship);
	t.saveWordPackage(wordMLPackage, new File(
			"f:/saveFile/temp/s7_simple.docx"));
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:40,代码来源:Docx4J_例子2.java

示例12: ctBorder

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
public static CTBorder ctBorder(String color,BigInteger border_width,BigInteger border_space) {
    CTBorder border = new CTBorder();
    border.setColor(color);
    border.setSz(border_width);
    border.setSpace(border_space);
    border.setVal(STBorder.SINGLE);
    return border;
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:BorderUtils.java

示例13: lowerBorder

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
private PBdr lowerBorder() {
	final PBdr pbdr = this.wmlObjectFactory.createPPrBasePBdr();

	final CTBorder border = this.wmlObjectFactory.createCTBorder();
	border.setColor("000000");
	border.setSz(BigInteger.valueOf(2));
	border.setSpace(BigInteger.valueOf(6));
	border.setVal(STBorder.SINGLE);

	pbdr.setBottom(border);
	return pbdr;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:13,代码来源:DocXReportSummaryWriter.java

示例14: createNormalTableTest

import org.docx4j.wml.CTBorder; //导入方法依赖的package包/类
public void createNormalTableTest(WordprocessingMLPackage wordMLPackage,
		MainDocumentPart t, ObjectFactory factory) throws Exception {
	RPr titleRpr = getRPr(factory, "宋体", "000000", "22", STHint.EAST_ASIA,
			true, false, false, false);
	RPr contentRpr = getRPr(factory, "宋体", "000000", "22",
			STHint.EAST_ASIA, false, false, false, false);
	Tbl table = factory.createTbl();
	CTBorder topBorder = new CTBorder();
	topBorder.setColor("80C687");
	topBorder.setVal(STBorder.DOUBLE);
	topBorder.setSz(new BigInteger("2"));
	CTBorder leftBorder = new CTBorder();
	leftBorder.setVal(STBorder.NONE);
	leftBorder.setSz(new BigInteger("0"));

	CTBorder hBorder = new CTBorder();
	hBorder.setVal(STBorder.SINGLE);
	hBorder.setSz(new BigInteger("1"));

	addBorders(table, topBorder, topBorder, leftBorder, leftBorder,
			hBorder, null);

	double[] colWidthPercent = new double[] { 15, 20, 20, 20, 25 };// 百分比
	setTableGridCol(wordMLPackage, factory, table, 80, colWidthPercent);

	Tr titleRow = factory.createTr();
	setTableTrHeight(factory, titleRow, "500");
	addTableCell(factory, wordMLPackage, titleRow, "序号", titleRpr,
			JcEnumeration.CENTER, true, "C6D9F1");
	addTableCell(factory, wordMLPackage, titleRow, "姓甚", titleRpr,
			JcEnumeration.CENTER, true, "C6D9F1");
	addTableCell(factory, wordMLPackage, titleRow, "名谁", titleRpr,
			JcEnumeration.CENTER, true, "C6D9F1");
	addTableCell(factory, wordMLPackage, titleRow, "籍贯", titleRpr,
			JcEnumeration.CENTER, true, "C6D9F1");
	addTableCell(factory, wordMLPackage, titleRow, "营生", titleRpr,
			JcEnumeration.CENTER, true, "C6D9F1");
	table.getContent().add(titleRow);

	for (int i = 0; i < 10; i++) {
		Tr contentRow = factory.createTr();
		addTableCell(factory, wordMLPackage, contentRow, i + "",
				contentRpr, JcEnumeration.CENTER, false, null);
		addTableCell(factory, wordMLPackage, contentRow, "无名氏", contentRpr,
				JcEnumeration.CENTER, false, null);
		addTableCell(factory, wordMLPackage, contentRow, "佚名", contentRpr,
				JcEnumeration.CENTER, false, null);
		addTableCell(factory, wordMLPackage, contentRow, "武林", contentRpr,
				JcEnumeration.CENTER, false, null);
		addTableCell(factory, wordMLPackage, contentRow, "吟诗赋曲",
				contentRpr, JcEnumeration.CENTER, false, null);
		table.getContent().add(contentRow);
	}
	setTableAlign(factory, table, JcEnumeration.CENTER);
	t.addObject(table);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:57,代码来源:Docx4J_例子2.java


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