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

Java CTBorder类代码示例

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

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



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

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * @Description: 设置段落边框样式
 */
public void setParagraghBorders(P p, CTBorder topBorder,
        CTBorder bottomBorder, CTBorder leftBorder, CTBorder rightBorder) {
    PPr ppr = getPPr(p);
    PBdr pBdr = new PBdr();
    if (topBorder != null) {
        pBdr.setTop(topBorder);
    }
    if (bottomBorder != null) {
        pBdr.setBottom(bottomBorder);
    }
    if (leftBorder != null) {
        pBdr.setLeft(leftBorder);
    }
    if (rightBorder != null) {
        pBdr.setRight(rightBorder);
    }
    ppr.setPBdr(pBdr);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:22,代码来源:Docx4j_工具类_S3_Test.java


示例3: 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


示例4: setDocumentBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * @Description: 设置页面边框
 */
public void setDocumentBorders(WordprocessingMLPackage wordPackage,
        ObjectFactory factory, CTBorder top, CTBorder right,
        CTBorder bottom, CTBorder left) {
    SectPr sectPr = getDocSectPr(wordPackage);
    PgBorders pgBorders = sectPr.getPgBorders();
    if (pgBorders == null) {
        pgBorders = factory.createSectPrPgBorders();
        sectPr.setPgBorders(pgBorders);
    }
    if (top != null) {
        pgBorders.setTop(top);
    }
    if (right != null) {
        pgBorders.setRight(right);
    }
    if (bottom != null) {
        pgBorders.setBottom(bottom);
    }
    if (left != null) {
        pgBorders.setLeft(left);
    }
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:26,代码来源:Docx4j_工具类_S3_Test.java


示例5: 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


示例6: 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


示例7: 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


示例8: 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


示例9: 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


示例10: 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


示例11: 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


示例12: 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


示例13: 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


示例14: tblBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public static TblBorders tblBorders(CTBorder border) {
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    return borders;
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:11,代码来源:BorderUtils.java


示例15: 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


示例16: createParagraghLine

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public void createParagraghLine(WordprocessingMLPackage wordMLPackage,
		MainDocumentPart t, ObjectFactory factory,P p,CTBorder topBorder,CTBorder bottomBorder,CTBorder leftBorder,CTBorder rightBorder){
	PPr ppr=new PPr();
	PBdr pBdr=new PBdr();
	pBdr.setTop(topBorder);
	pBdr.setBottom(bottomBorder);
	pBdr.setLeft(leftBorder);
	pBdr.setRight(rightBorder);
	ppr.setPBdr(pBdr);
	p.setPPr(ppr);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:12,代码来源:Docx4J_例子2.java


示例17: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * 给表格添加简单的黑色边框.
 * @param table
 */
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = BorderUtils.ctBorder();
    TblBorders borders = BorderUtils.tblBorders(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:11,代码来源:AddingAnInlineImageToTable.java


示例18: 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


示例19: 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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DebuggerUtils类代码示例发布时间:2022-05-22
下一篇:
Java SQLInsertClause类代码示例发布时间: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