gpt4 book ai didi

org.apache.poi.xssf.usermodel.XSSFSimpleShape类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 14:06:40 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.poi.xssf.usermodel.XSSFSimpleShape类的一些代码示例,展示了XSSFSimpleShape类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSSFSimpleShape类的具体详情如下:
包路径:org.apache.poi.xssf.usermodel.XSSFSimpleShape
类名称:XSSFSimpleShape

XSSFSimpleShape介绍

[英]Represents a shape with a predefined geometry in a SpreadsheetML drawing. Possible shape types are defined in org.apache.poi.ss.usermodel.ShapeTypes
[中]表示电子表格图形中具有预定义几何图形的形状。可能的形状类型在组织中定义。阿帕奇。波伊。党卫军。用户模型。形状

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

void processShapes(List<XSSFShape> shapes, StringBuilder text) {
  if (shapes == null) {
    return;
  }
  for (XSSFShape shape : shapes) {
    if (shape instanceof XSSFSimpleShape) {
      String sText = ((XSSFSimpleShape) shape).getText();
      if (sText != null && sText.length() > 0) {
        text.append(sText).append('\n');
      }
    }
  }
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Creates a simple shape.  This includes such shapes as lines, rectangles,
 * and ovals.
 *
 * @param anchor the child anchor describes how this shape is attached
 *               to the group.
 * @return the newly created shape.
 */
public XSSFSimpleShape createSimpleShape(XSSFChildAnchor anchor) {
  CTShape ctShape = ctGroup.addNewSp();
  ctShape.set(XSSFSimpleShape.prototype());
  XSSFSimpleShape shape = new XSSFSimpleShape(getDrawing(), ctShape);
  shape.parent = this;
  shape.anchor = anchor;
  shape.setXfrm(anchor.getCTTransform2D());
  return shape;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Set a single paragraph of text on the shape. Note this will replace all
 * existing paragraphs created on the shape.
 *
 * @param text
 *            string representing the paragraph text
 */
public void setText(String text) {
  clearText();
  addNewTextParagraph().addNewTextRun().setText(text);
}

代码示例来源:origin: org.apache.poi/poi-ooxml

out.append(getBulletPrefix(scheme, levelCount.get(level)));
out.append(p.getText());
    out.append('\n');
  index = processAutoNumGroup(index + 1, nextp.getLevel(), levelCount, out);
  continue; // restart the loop given the new index
} else if (nextp.getLevel() < level) {
    out.append(getBulletPrefix(nextScheme, levelCount.get(level)));
    out.append(nextp.getText());

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Creates a simple shape.  This includes such shapes as lines, rectangles,
 * and ovals.
 *
 * @param anchor the child anchor describes how this shape is attached
 *               to the group.
 * @return the newly created shape.
 */
public XSSFSimpleShape createSimpleShape(XSSFChildAnchor anchor) {
  CTShape ctShape = ctGroup.addNewSp();
  ctShape.set(XSSFSimpleShape.prototype());
  XSSFSimpleShape shape = new XSSFSimpleShape(getDrawing(), ctShape);
  shape.parent = this;
  shape.anchor = anchor;
  shape.getCTShape().getSpPr().setXfrm(anchor.getCTTransform2D());
  return shape;
}

代码示例来源:origin: apache/tika

for (XSSFShape shape : shapes) {
  if (shape instanceof XSSFSimpleShape) {
    String sText = ((XSSFSimpleShape) shape).getText();
    if (sText != null && sText.length() > 0) {
      xhtml.element("p", sText);
    extractHyperLinksFromShape(((XSSFSimpleShape)shape).getCTShape(), xhtml);

代码示例来源:origin: org.apache.poi/poi-ooxml

XSSFWorkbook wb = (XSSFWorkbook) getDrawing().getParent().getParent();
str.setStylesTableReference(wb.getStylesSource());
    rPr.setLang("en-US");
    applyAttributes(ltPr, rPr);
clearText();
ctShape.getTxBody().setPArray(new CTTextParagraph[] { p });
_paragraphs.add(new XSSFTextParagraph(ctShape.getTxBody().getPArray(0), ctShape));

代码示例来源:origin: stackoverflow.com

shape.setShapeType(ShapeTypes.LINE);
  shape.setLineWidth(1.5);
  shape.setLineStyle(3);
  shape.setLineStyleColor(0,0,255);
shape.getCTShape().getNvSpPr().getCNvPr().setId(shape.getCTShape().getNvSpPr().getCNvPr().getId()-1);
  CTShapeProperties shapeProperties = shape.getCTShape().getSpPr();
  CTLineProperties lineProperties = shapeProperties.getLn();

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Creates a simple shape. This includes such shapes as lines, rectangles,
 * and ovals.
 *
 * @param anchor
 *            the client anchor describes how this group is attached to the
 *            sheet.
 * @return the newly created shape.
 */
public XSSFSimpleShape createSimpleShape(XSSFClientAnchor anchor) {
  long shapeId = newShapeId();
  CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
  CTShape ctShape = ctAnchor.addNewSp();
  ctShape.set(XSSFSimpleShape.prototype());
  ctShape.getNvSpPr().getCNvPr().setId(shapeId);
  ctShape.getSpPr().setXfrm(createXfrm(anchor));
  XSSFSimpleShape shape = new XSSFSimpleShape(this, ctShape);
  shape.anchor = anchor;
  return shape;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Constructs a textbox.
 *
 * @param anchor the child anchor describes how this shape is attached
 *               to the group.
 * @return      the newly created textbox.
 */
public XSSFTextBox createTextbox(XSSFChildAnchor anchor){
  CTShape ctShape = ctGroup.addNewSp();
  ctShape.set(XSSFSimpleShape.prototype());
  XSSFTextBox shape = new XSSFTextBox(getDrawing(), ctShape);
  shape.parent = this;
  shape.anchor = anchor;
  shape.setXfrm(anchor.getCTTransform2D());
  return shape;
}
/**

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public void setText(XSSFRichTextString str){
  XSSFWorkbook wb = (XSSFWorkbook)getDrawing().getParent().getParent();
  str.setStylesTableReference(wb.getStylesSource());
  CTTextParagraph p = CTTextParagraph.Factory.newInstance();
  if(str.numFormattingRuns() == 0){
    CTRegularTextRun r = p.addNewR();
    CTTextCharacterProperties rPr = r.addNewRPr();
    rPr.setLang("en-US");
    rPr.setSz(1100);
    r.setT(str.getString());
  } else {
    for (int i = 0; i < str.getCTRst().sizeOfRArray(); i++) {
      CTRElt lt = str.getCTRst().getRArray(i);
      CTRPrElt ltPr = lt.getRPr();
      if(ltPr == null) ltPr = lt.addNewRPr();
      CTRegularTextRun r = p.addNewR();
      CTTextCharacterProperties rPr = r.addNewRPr();
      rPr.setLang("en-US");
      applyAttributes(ltPr, rPr);
      r.setT(lt.getT());
    }
  }
  ctShape.getTxBody().setPArray(new CTTextParagraph[]{p});
}

代码示例来源:origin: org.apache.poi/poi-ooxml

} else if (obj instanceof CTShape) {
  shape = hasOleLink(obj) ? new XSSFObjectData(this, (CTShape) obj)
    : new XSSFSimpleShape(this, (CTShape) obj);
} else if (obj instanceof CTGraphicalObjectFrame) {
  shape = new XSSFGraphicFrame(this, (CTGraphicalObjectFrame) obj);

代码示例来源:origin: org.apache.poi/poi-ooxml

rPr.setLang("en-US");
applyAttributes(ltPr, rPr);

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Add a new paragraph run to this shape, set to the provided string
 *
 * @return created paragraph run
 */
public XSSFTextParagraph addNewTextParagraph(String text) {
  XSSFTextParagraph paragraph = addNewTextParagraph();
  paragraph.addNewTextRun().setText(text);
  return paragraph;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

i = processAutoNumGroup(i, level, levelCount, out);
} else {

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers

private void processShapes(List<XSSFShape> shapes, XHTMLContentHandler xhtml) throws SAXException {
  if (shapes == null) {
    return;
  }
  for (XSSFShape shape : shapes) {
    if (shape instanceof XSSFSimpleShape) {
      String sText = ((XSSFSimpleShape) shape).getText();
      if (sText != null && sText.length() > 0) {
        xhtml.element("p", sText);
      }
      extractHyperLinksFromShape(((XSSFSimpleShape)shape).getCTShape(), xhtml);
    }
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

XSSFWorkbook wb = (XSSFWorkbook) getDrawing().getParent().getParent();
str.setStylesTableReference(wb.getStylesSource());
    rPr.setLang("en-US");
    applyAttributes(ltPr, rPr);
clearText();
ctShape.getTxBody().setPArray(new CTTextParagraph[] { p });
_paragraphs.add(new XSSFTextParagraph(ctShape.getTxBody().getPArray(0), ctShape));

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Creates a simple shape.  This includes such shapes as lines, rectangles,
 * and ovals.
 *
 * @param anchor    the client anchor describes how this group is attached
 *                  to the sheet.
 * @return  the newly created shape.
 */
public XSSFSimpleShape createSimpleShape(XSSFClientAnchor anchor)
{
  long shapeId = newShapeId();
  CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
  CTShape ctShape = ctAnchor.addNewSp();
  ctShape.set(XSSFSimpleShape.prototype());
  ctShape.getNvSpPr().getCNvPr().setId(shapeId);
  XSSFSimpleShape shape = new XSSFSimpleShape(this, ctShape);
  shape.anchor = anchor;
  return shape;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Constructs a textbox under the drawing.
 *
 * @param anchor
 *            the client anchor describes how this group is attached to the
 *            sheet.
 * @return the newly created textbox.
 */
public XSSFTextBox createTextbox(XSSFClientAnchor anchor) {
  long shapeId = newShapeId();
  CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
  CTShape ctShape = ctAnchor.addNewSp();
  ctShape.set(XSSFSimpleShape.prototype());
  ctShape.getNvSpPr().getCNvPr().setId(shapeId);
  XSSFTextBox shape = new XSSFTextBox(this, ctShape);
  shape.anchor = anchor;
  return shape;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

out.append(getBulletPrefix(scheme, levelCount.get(level)));
out.append(p.getText());
    out.append('\n');
  index = processAutoNumGroup(index + 1, nextp.getLevel(), levelCount, out);
  continue; // restart the loop given the new index
} else if (nextp.getLevel() < level) {
    out.append(getBulletPrefix(nextScheme, levelCount.get(level)));
    out.append(nextp.getText());

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com