- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextRun
类的一些代码示例,展示了XSLFTextRun
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFTextRun
类的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFTextRun
类名称:XSLFTextRun
[英]Represents a run of text within the containing text body. The run element is the lowest level text separation mechanism within a text body.
[中]表示包含文本正文中的一段文本。run元素是文本体中最低级别的文本分离机制。
代码示例来源:origin: org.apache.poi/poi-ooxml
void copy(XSLFTextRun r){
String srcFontFamily = r.getFontFamily();
if(srcFontFamily != null && !srcFontFamily.equals(getFontFamily())){
setFontFamily(srcFontFamily);
PaintStyle srcFontColor = r.getFontColor();
if(srcFontColor != null && !srcFontColor.equals(getFontColor())){
setFontColor(srcFontColor);
Double srcFontSize = r.getFontSize();
if (srcFontSize == null) {
if (getFontSize() != null) setFontSize(null);
} else if(!srcFontSize.equals(getFontSize())) {
setFontSize(srcFontSize);
boolean bold = r.isBold();
if(bold != isBold()) {
setBold(bold);
boolean italic = r.isItalic();
if(italic != isItalic()) {
setItalic(italic);
boolean underline = r.isUnderlined();
if(underline != isUnderlined()) {
setUnderlined(underline);
boolean strike = r.isStrikethrough();
if(strike != isStrikethrough()) {
setStrikethrough(strike);
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public String toString(){
return "[" + getClass() + "]" + getRawText();
}
代码示例来源:origin: org.apache.poi/poi-ooxml
firstPara = !newParagraph;
para = _paragraphs.get(_paragraphs.size() - 1);
CTTextParagraph ctp = para.getXmlObject();
otherPPr = ctp.getPPr();
List<XSLFTextRun> runs = para.getTextRuns();
if (!runs.isEmpty()) {
XSLFTextRun r0 = runs.get(runs.size() - 1);
otherRPr = r0.getRPr(false);
if (otherRPr == null) {
otherRPr = ctp.getEndParaRPr();
if (!firstPara) {
if (para != null) {
CTTextParagraph ctp = para.getXmlObject();
CTTextCharacterProperties unexpectedRPr = ctp.getEndParaRPr();
if (unexpectedRPr != null && unexpectedRPr != otherRPr) {
run = para.addNewTextRun();
run.setText(runText);
if (otherRPr != null) {
run.getRPr(true).set(otherRPr);
代码示例来源:origin: stackoverflow.com
Color fontColor = null;
String fontFamily = null;
double fontSize = 0.0;
boolean italic = false;
boolean bold = false;
boolean underline = false;
for (XSLFTextParagraph paragraph : autoShape.getTextParagraphs()) {
for (XSLFTextRun text : paragraph.getTextRuns()) {
fontColor = text.getFontColor();
fontFamily = text.getFontFamily();
fontSize = text.getFontSize();
italic = text.isItalic();
bold = text.isBold();
underline = text.isUnderline();
}
}
autoShape.clearText();
XSLFTextParagraph addNewTextParagraph = autoShape.addNewTextParagraph();
XSLFTextRun addNewTextRun = addNewTextParagraph.addNewTextRun();
addNewTextRun.setText(values.get(0)[1]);
addNewTextRun.setFontColor(fontColor);
addNewTextRun.setFontFamily(fontFamily);
addNewTextRun.setFontSize(fontSize);
addNewTextRun.setItalic(italic);
addNewTextRun.setBold(bold);
addNewTextRun.setUnderline(underline);
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
void copy(XSLFTextRun r){
String srcFontFamily = r.getFontFamily();
if(srcFontFamily != null && !srcFontFamily.equals(getFontFamily())){
setFontFamily(srcFontFamily);
}
Color srcFontColor = r.getFontColor();
if(srcFontColor != null && !srcFontColor.equals(getFontColor())){
setFontColor(srcFontColor);
}
double srcFontSize = r.getFontSize();
if(srcFontSize != getFontSize()){
setFontSize(srcFontSize);
}
boolean bold = r.isBold();
if(bold != isBold()) setBold(bold);
boolean italic = r.isItalic();
if(italic != isItalic()) setItalic(italic);
boolean underline = r.isUnderline();
if(underline != isUnderline()) setUnderline(underline);
boolean strike = r.isStrikethrough();
if(strike != isStrikethrough()) setStrikethrough(strike);
}
}
代码示例来源:origin: org.apache.poi/poi-examples
XSLFTextShape tsh = (XSLFTextShape) shape;
for (XSLFTextParagraph p : tsh) {
System.out.println("Paragraph level: " + p.getIndentLevel());
for (XSLFTextRun r : p) {
System.out.println(r.getRawText());
System.out.println(" bold: " + r.isBold());
System.out.println(" italic: " + r.isItalic());
System.out.println(" underline: " + r.isUnderlined());
System.out.println(" font.family: " + r.getFontFamily());
System.out.println(" font.size: " + r.getFontSize());
System.out.println(" font.color: " + r.getFontColor());
代码示例来源:origin: stackoverflow.com
XSLFTableRow titleRow = tbl.addRow();
titleRow.setHeight(50);
XSLFTableCell titleCell1 = titleRow.addCell();
XSLFTextParagraph p1 = titleCell1.addNewTextParagraph();
p1.setTextAlign(TextAlign.CENTER);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Column title");
r1.setBold(true);
r1.setFontColor(new Color(0, 104, 145));
titleCell1.setFillColor(new Color(190, 230, 245));
r1.setFontSize(25.0);
titleCell1.setVerticalAlignment(VerticalAlignment.MIDDLE);
代码示例来源:origin: org.apache.poi/poi-examples
p1.setIndentLevel(0);
p1.setBullet(true);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Bullet1");
p2.setIndentLevel(1);
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Bullet2");
p3.setIndentLevel(2);
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Numbered List Item - 1");
p4.setIndentLevel(2);
XSLFTextRun r4 = p4.addNewTextRun();
r4.setText("Numbered List Item - 2");
p5.setIndentLevel(2);
XSLFTextRun r5 = p5.addNewTextRun();
r5.setText("Numbered List Item - 3");
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
int length = run.getRenderableText().length();
if(length == 0) {
string.addAttribute(TextAttribute.FOREGROUND, run.getFontColor(), startIndex, endIndex);
String fontFamily = run.getFontFamily();
if(fontHandler != null) {
fontFamily = fontHandler.getRendererableFont(fontFamily, run.getPitchAndFamily());
float fontSz = (float)run.getFontSize();
string.addAttribute(TextAttribute.SIZE, fontSz , startIndex, endIndex);
if(run.isBold()) {
string.addAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD, startIndex, endIndex);
if(run.isItalic()) {
string.addAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, startIndex, endIndex);
if(run.isUnderline()) {
string.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON, startIndex, endIndex);
string.addAttribute(TextAttribute.INPUT_METHOD_UNDERLINE, TextAttribute.UNDERLINE_LOW_TWO_PIXEL, startIndex, endIndex);
if(run.isStrikethrough()) {
string.addAttribute(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON, startIndex, endIndex);
if(run.isSubscript()) {
string.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB, startIndex, endIndex);
if(run.isSuperscript()) {
代码示例来源:origin: stackoverflow.com
XSLFTextParagraph par = tb.addNewTextParagraph();
tb.setVerticalAlignment(VerticalAlignment.DISTRIBUTED);
par.setTextAlign(TextAlign.CENTER);
XSLFTextRun run = par.addNewTextRun();
run.setText("unicode ->\u30B4\u30DF\u7BB1<-");
run.setFontFamily("GE Inspira");
run.setFontSize(12.0);
return ss;
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
if(_runs.size() == 0) ensureNotEmpty();
String text = getRenderableText();
if(text.length() == 0) return _lines;
AttributedString at = getAttributedString(graphics);
AttributedCharacterIterator it = at.getIterator();
LineBreakMeasurer measurer = new LineBreakMeasurer(it, graphics.getFontRenderContext()) ;
String buCharacter = getBulletCharacter();
String buFont = getBulletFont();
if(buFont == null) buFont = getTextRuns().get(0).getFontFamily();
if(buCharacter != null && buFont != null && _lines.size() > 0) {
AttributedString str = new AttributedString(buCharacter);
代码示例来源:origin: org.apache.poi/poi-examples
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Paragraph Formatting");
r1.setFontSize(24d);
r1.setFontColor(new Color(85, 142, 213));
p2.setSpaceBefore(-20d); // 20 pt from the previous paragraph
p2.setSpaceAfter(300d); // 3 lines after the paragraph
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Paragraph properties apply to all text residing within the corresponding paragraph.");
r2.setFontSize(16d);
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Run Formatting");
r3.setFontSize(24d);
r3.setFontColor(new Color(85, 142, 213));
p4.setSpaceAfter(300d); // 3 lines after the paragraph
XSLFTextRun r4 = p4.addNewTextRun();
r4.setFontSize(16d);
r4.setText(
"Run level formatting is the most granular property level and allows " +
"for the specifying of all low level text properties. The text run is " +
代码示例来源:origin: stackoverflow.com
XSLFTextRun run1 = p.addNewTextRun();
run1.setText("This is test");
run1.setFontFamily(HSSFFont.FONT_ARIAL);
run1.setFontColor(Color.red);
run1.setFontSize(24);
代码示例来源:origin: apache/tika
for (XSLFTextParagraph p : txt.getTextParagraphs()) {
xhtml.startElement("p");
if (! config.getIncludeHeadersAndFooters() && p.isHeaderOrFooter()) {
continue;
for (XSLFTextRun run : p.getTextRuns()) {
Hyperlink hyperlink = run.getHyperlink();
inHyperlink = true;
xhtml.characters(run.getRawText());
if (inHyperlink == true) {
xhtml.endElement("a");
代码示例来源:origin: stackoverflow.com
textShape.clearText();
XSLFTextParagraph p = textShape.addNewTextParagraph();
XSLFTextRun r1 = p.addNewTextRun();
r1.setText("The");
r1.setFontColor(Color.blue);
r1.setFontSize(24.);
代码示例来源:origin: stackoverflow.com
XSLFTextShape[] phs = slide[i].getPlaceholders();
for (XSLFTextShape ts : phs) {
java.util.List<XSLFTextParagraph> tpl = ts.getTextParagraphs();
for(XSLFTextParagraph tp: tpl) {
java.util.List<XSLFTextRun> trs = tp.getTextRuns();
for(XSLFTextRun tr: trs) {
logger.info(tr.getFontFamily());
tr.setFontFamily("SimSun");
}
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* ensure that the paragraph contains at least one character.
* We need this trick to correctly measure text
*/
private void ensureNotEmpty(){
XSLFTextRun r = addNewTextRun();
r.setText(" ");
CTTextCharacterProperties endPr = _p.getEndParaRPr();
if(endPr != null) {
if(endPr.isSetSz()) r.setFontSize(endPr.getSz() / 100);
}
}
代码示例来源:origin: stackoverflow.com
XSLFTableRow headerRow = table.addRow();
for(int i = 0; i < 3; i++) {
XSLFTableCell th = headerRow.addCell();
XSLFTextParagraph p = th.addNewTextParagraph();
XSLFTextRun r = p.addNewTextRun();
r.setText("Text");
}
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers
xhtml.startElement("p");
for (XSLFTextRun run : p.getTextRuns()) {
Hyperlink hyperlink = run.getHyperlink();
inHyperlink = true;
xhtml.characters(run.getRawText());
if (inHyperlink == true) {
xhtml.endElement("a");
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* Replace a tab with the effective number of white spaces.
*
* @return
*/
private String tab2space(){
AttributedString string = new AttributedString(" ");
// user can pass an object to convert fonts via a rendering hint
string.addAttribute(TextAttribute.FAMILY, getFontFamily());
string.addAttribute(TextAttribute.SIZE, (float)getFontSize());
TextLayout l = new TextLayout(string.getIterator(), new FontRenderContext(null, true, true));
double wspace = l.getAdvance();
double tabSz = _p.getDefaultTabSize();
int numSpaces = (int)Math.ceil(tabSz / wspace);
StringBuffer buf = new StringBuffer();
for(int i = 0; i < numSpaces; i++) {
buf.append(' ');
}
return buf.toString();
}
我正在编写 java 代码来读取列名为“键”和“值”的 excel 文件。但是由于无法在这行代码中进行转换而出错, Row firstRow =(Row)sheet.getRow(0); 如何解决这个
在我使用 jasperreports-3.7.4 jar 以 Excel 格式下载 Jasper Reports 之前。现在我正在尝试升级到 jasperreports-6.3.1 jar。但它在调用
我在将报告导出为 XLS 时遇到了一些问题。导出为 PDF 效果很好。 所以我尝试更新到最新的 JasperReports 和 Apache POI 版本: JasperReports:5.5.0 兴
同一模型的其他函数工作正常,我只有其中两个有问题,它们都与数据库交互。在本地工作。 来自错误日志。 PHP fatal error :调用未定义的方法 UserModel::getScreens()
是否有可能在 django UserModel 的管理页面中创建自定义操作?我想自动将用户添加到组中(比如将他添加到员工中,设置一些额外的值等),当然还要创建操作来收回这些更改。 感谢您的帮助。 最佳
我想在包中输入提示用户模型。默认情况下,它是 App\User .在 channel 类(class)中,这没问题: class ChannelExample { public functio
这是我的代码: var user = UserModel.findOne({ _id: decodedToken.id, }, function (err, user) {
当我尝试在 Users 上使用 MongooseModel 时,出现以下错误 Nest can't resolve dependencies of the UserModel (?). Please
我对 Nodejs 和 mongoDB 还很陌生。我已经创建了注册和用户架构,但它无法识别this并发送以下错误: ReferenceError: userModel is not defined 当
我想使用 npoi 在 VS2012/2010 中操作 .xlsx 文件。为此,我应该导入 NPOI.XSSF.UserModel,但是当我添加 npoi.dll 并尝试导入它时,没有 XSSF 使用
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter类的一些代码示例,展示了XWPFHeaderFooter类的具体用法。这些代码示例主要来
本文整理了Java中org.apache.poi.xssf.usermodel.XSSFHyperlink类的一些代码示例,展示了XSSFHyperlink类的具体用法。这些代码示例主要来源于Gith
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSlideLayout类的一些代码示例,展示了XSLFSlideLayout类的具体用法。这些代码示例主要来源于
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFStyle类的一些代码示例,展示了XWPFStyle类的具体用法。这些代码示例主要来源于Github/Stack
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFRelation类的一些代码示例,展示了XWPFRelation类的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextParagraph类的一些代码示例,展示了XSLFTextParagraph类的具体用法。这些代码示例主
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextRun类的一些代码示例,展示了XSLFTextRun类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSlideMaster类的一些代码示例,展示了XSLFSlideMaster类的具体用法。这些代码示例主要来源于
本文整理了Java中org.apache.poi.xssf.usermodel.XSSFComment类的一些代码示例,展示了XSSFComment类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTableCell类的一些代码示例,展示了XSLFTableCell类的具体用法。这些代码示例主要来源于Gith
我是一名优秀的程序员,十分优秀!