gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFSheet.getRelationById()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 20:08:40 26 4
gpt4 key购买 nike

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

XSLFSheet.getRelationById介绍

暂无

代码示例

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

/**
 * Return the data on the (internal) picture.
 * For an external linked picture, will return null
 */
public XSLFPictureData getPictureData() {
  if(_data == null){
    String blipId = getBlipId();
    if (blipId == null) {
      return null;
    }
    _data = (XSLFPictureData)getSheet().getRelationById(blipId);
  }
  return _data;
}

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

private void copyChart(CTGraphicalObjectData objData, XSLFGraphicFrame srcShape) {
  XSLFSlide slide = (XSLFSlide) getSheet();
  XSLFSheet src = srcShape.getSheet();
  String xpath = "declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' c:chart";
  XmlObject[] obj = objData.selectPath(xpath);
  if (obj != null && obj.length == 1) {
    XmlCursor c = obj[0].newCursor();
    try {
      // duplicate chart with embedded workbook
      QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
      String id = c.getAttributeText(idQualifiedName);
      XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
      XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
      chartCopy.importContent(srcChart);
      chartCopy.setWorkbook(srcChart.getWorkbook());
      c.setAttributeText(idQualifiedName, slide.getRelationId(chartCopy));
    } catch (InvalidFormatException e) {
      throw new POIXMLException(e);
    } catch (IOException e) {
      throw new POIXMLException(e);
    }
    c.dispose();
  }
}

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

POIXMLDocumentPart pp = src._sheet.getRelationById(idSrc);
if (pp != null) {
  RelationPart rp = _sheet.addRelation(null, XSLFRelation.SLIDE, pp);

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

/**
 * Return the data on the (internal) picture.
 * For an external linked picture, will return null
 */
public XSLFPictureData getPictureData() {
  if(_data == null){
    String blipId = getBlipId();
    if (blipId == null) {
      return null;
    }
    _data = (XSLFPictureData)getSheet().getRelationById(blipId);
  }
  return _data;
}

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

private void copyChart(CTGraphicalObjectData objData, XSLFGraphicFrame srcShape) {
  XSLFSlide slide = (XSLFSlide) getSheet();
  XSLFSheet src = srcShape.getSheet();
  String xpath = "declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' c:chart";
  XmlObject[] obj = objData.selectPath(xpath);
  if (obj != null && obj.length == 1) {
    XmlCursor c = obj[0].newCursor();
    try {
      // duplicate chart with embedded workbook
      QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
      String id = c.getAttributeText(idQualifiedName);
      XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
      XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
      chartCopy.importContent(srcChart);
      chartCopy.setWorkbook(srcChart.getWorkbook());
      c.setAttributeText(idQualifiedName, slide.getRelationId(chartCopy));
    } catch (InvalidFormatException e) {
      throw new POIXMLException(e);
    } catch (IOException e) {
      throw new POIXMLException(e);
    }
    c.dispose();
  }
}

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

POIXMLDocumentPart pp = src._sheet.getRelationById(idSrc);
if (pp != null) {
  RelationPart rp = _sheet.addRelation(null, XSLFRelation.SLIDE, pp);

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