org.apache.poi.xssf.usermodel.XSSFPicture.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(189)

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

XSSFPicture.<init>介绍

[英]Construct a new XSSFPicture object. This constructor is called from XSSFDrawing#createPicture(XSSFClientAnchor,int)
[中]构造一个新的XSSFPicture对象。这个构造函数是从XSSFDrawing#createPicture(XSSFClientAnchor,int)调用的

代码示例

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

/**
 * Creates a picture.
 *
 * @param anchor       the client anchor describes how this picture is attached to the sheet.
 * @param pictureIndex the index of the picture in the workbook collection of pictures,
 *                     {@link XSSFWorkbook#getAllPictures()} .
 * @return the newly created picture shape.
 */
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) {
  PackageRelationship rel = getDrawing().addPictureReference(pictureIndex);
  CTPicture ctShape = ctGroup.addNewPic();
  ctShape.set(XSSFPicture.prototype());
  XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape);
  shape.parent = this;
  shape.anchor = anchor;
  shape.setPictureReference(rel);
  return shape;
}

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

/**
 * Creates a picture.
 *
 * @param anchor
 *            the client anchor describes how this picture is attached to
 *            the sheet.
 * @param pictureIndex
 *            the index of the picture in the workbook collection of
 *            pictures,
 *            {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()}
 *            .
 *
 * @return the newly created picture shape.
 */
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) {
  PackageRelationship rel = addPictureReference(pictureIndex);
  long shapeId = newShapeId();
  CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
  CTPicture ctShape = ctAnchor.addNewPic();
  ctShape.set(XSSFPicture.prototype());
  ctShape.getNvPicPr().getCNvPr().setId(shapeId);
  XSSFPicture shape = new XSSFPicture(this, ctShape);
  shape.anchor = anchor;
  shape.setPictureReference(rel);
  ctShape.getSpPr().setXfrm(createXfrm(anchor));
  return shape;
}

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

shape = new XSSFPicture(this, (CTPicture) obj);
} else if (obj instanceof CTConnector) {
  shape = new XSSFConnector(this, (CTConnector) obj);

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

/**
   *
   * @return list of shapes in this drawing
   */
  public List<XSSFShape>  getShapes(){
    List<XSSFShape> lst = new ArrayList<XSSFShape>();
    for(XmlObject obj : drawing.selectPath("./*/*")) {
      if(obj instanceof CTPicture) lst.add(new XSSFPicture(this, (CTPicture)obj)) ;
      else if(obj instanceof CTConnector) lst.add(new XSSFConnector(this, (CTConnector)obj)) ;
      else if(obj instanceof CTShape) lst.add(new XSSFSimpleShape(this, (CTShape)obj)) ;
      else if(obj instanceof CTGraphicalObjectFrame) lst.add(new XSSFGraphicFrame(this, (CTGraphicalObjectFrame)obj)) ;
      else if(obj instanceof CTGroupShape) lst.add(new XSSFShapeGroup(this, (CTGroupShape)obj)) ;
    }
    return lst;
  }
}

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

/**
 * Creates a picture.
 *
 * @param anchor       the client anchor describes how this picture is attached to the sheet.
 * @param pictureIndex the index of the picture in the workbook collection of pictures,
 *                     {@link XSSFWorkbook#getAllPictures()} .
 * @return the newly created picture shape.
 */
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) {
  PackageRelationship rel = getDrawing().addPictureReference(pictureIndex);
  CTPicture ctShape = ctGroup.addNewPic();
  ctShape.set(XSSFPicture.prototype());
  XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape);
  shape.parent = this;
  shape.anchor = anchor;
  shape.setPictureReference(rel);
  return shape;
}

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

/**
 * Creates a picture.
 *
 * @param anchor       the client anchor describes how this picture is attached to the sheet.
 * @param pictureIndex the index of the picture in the workbook collection of pictures,
 *                     {@link XSSFWorkbook#getAllPictures()} .
 * @return the newly created picture shape.
 */
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) {
  PackageRelationship rel = getDrawing().addPictureReference(pictureIndex);
  CTPicture ctShape = ctGroup.addNewPic();
  ctShape.set(XSSFPicture.prototype());
  XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape);
  shape.parent = this;
  shape.anchor = anchor;
  shape.setPictureReference(rel);
  return shape;
}

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

/**
 * Creates a picture.
 *
 * @param anchor    the client anchor describes how this picture is attached to the sheet.
 * @param pictureIndex the index of the picture in the workbook collection of pictures,
 *   {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} .
 *
 * @return  the newly created picture shape.
 */
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
{
  PackageRelationship rel = addPictureReference(pictureIndex);
  long shapeId = newShapeId();
  CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
  CTPicture ctShape = ctAnchor.addNewPic();
  ctShape.set(XSSFPicture.prototype());
  ctShape.getNvPicPr().getCNvPr().setId(shapeId);
  XSSFPicture shape = new XSSFPicture(this, ctShape);
  shape.anchor = anchor;
  shape.setPictureReference(rel);
  return shape;
}

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

/**
 * Creates a picture.
 *
 * @param anchor
 *            the client anchor describes how this picture is attached to
 *            the sheet.
 * @param pictureIndex
 *            the index of the picture in the workbook collection of
 *            pictures,
 *            {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()}
 *            .
 *
 * @return the newly created picture shape.
 */
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) {
  PackageRelationship rel = addPictureReference(pictureIndex);
  long shapeId = newShapeId();
  CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
  CTPicture ctShape = ctAnchor.addNewPic();
  ctShape.set(XSSFPicture.prototype());
  ctShape.getNvPicPr().getCNvPr().setId(shapeId);
  XSSFPicture shape = new XSSFPicture(this, ctShape);
  shape.anchor = anchor;
  shape.setPictureReference(rel);
  ctShape.getSpPr().setXfrm(createXfrm(anchor));
  return shape;
}

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

shape = new XSSFPicture(this, (CTPicture) obj);
} else if (obj instanceof CTConnector) {
  shape = new XSSFConnector(this, (CTConnector) obj);

相关文章