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

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

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

XSLFSlide.getSlideShow介绍

暂无

代码示例

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

  1. @Override
  2. public int getSlideNumber() {
  3. int idx = getSlideShow().getSlides().indexOf(this);
  4. return (idx == -1) ? idx : idx+1;
  5. }

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

  1. /**
  2. * @return the comment authors part or {@code null} if there weren't any comments
  3. * @since POI 4.0.0
  4. */
  5. @SuppressWarnings("WeakerAccess")
  6. public XSLFCommentAuthors getCommentAuthorsPart() {
  7. if(_commentAuthors == null) {
  8. // first scan the slide relations
  9. for (POIXMLDocumentPart p : getRelations()) {
  10. if (p instanceof XSLFCommentAuthors) {
  11. _commentAuthors = (XSLFCommentAuthors)p;
  12. return _commentAuthors;
  13. }
  14. }
  15. // then scan the presentation relations
  16. for (POIXMLDocumentPart p : getSlideShow().getRelations()) {
  17. if (p instanceof XSLFCommentAuthors) {
  18. _commentAuthors = (XSLFCommentAuthors)p;
  19. return _commentAuthors;
  20. }
  21. }
  22. }
  23. return null;
  24. }

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

  1. /**
  2. * Gets the requested text from the slide
  3. *
  4. * @param slide the slide to retrieve the text from
  5. * @param slideText Should we retrieve text from slides?
  6. * @param notesText Should we retrieve text from notes?
  7. * @param commentText Should we retrieve text from comments?
  8. * @param masterText Should we retrieve text from master slides?
  9. * @return the extracted text
  10. */
  11. public static String getText(XSLFSlide slide, boolean slideText, boolean notesText, boolean commentText, boolean masterText) {
  12. final SlideShowExtractor<XSLFShape, XSLFTextParagraph> ex = new SlideShowExtractor<>(slide.getSlideShow());
  13. ex.setSlidesByDefault(slideText);
  14. ex.setNotesByDefault(notesText);
  15. ex.setCommentsByDefault(commentText);
  16. ex.setMasterByDefault(masterText);
  17. return ex.getText(slide);
  18. }
  19. }

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

  1. private void copyChart(CTGraphicalObjectData objData, XSLFGraphicFrame srcShape) {
  2. XSLFSlide slide = (XSLFSlide) getSheet();
  3. XSLFSheet src = srcShape.getSheet();
  4. String xpath = "declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' c:chart";
  5. XmlObject[] obj = objData.selectPath(xpath);
  6. if (obj != null && obj.length == 1) {
  7. XmlCursor c = obj[0].newCursor();
  8. try {
  9. // duplicate chart with embedded workbook
  10. QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
  11. String id = c.getAttributeText(idQualifiedName);
  12. XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
  13. XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
  14. chartCopy.importContent(srcChart);
  15. chartCopy.setWorkbook(srcChart.getWorkbook());
  16. c.setAttributeText(idQualifiedName, slide.getRelationId(chartCopy));
  17. } catch (InvalidFormatException e) {
  18. throw new POIXMLException(e);
  19. } catch (IOException e) {
  20. throw new POIXMLException(e);
  21. }
  22. c.dispose();
  23. }
  24. }

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

  1. @Override
  2. public int getSlideNumber() {
  3. int idx = getSlideShow().getSlides().indexOf(this);
  4. return (idx == -1) ? idx : idx+1;
  5. }

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

  1. /**
  2. * @return the comment authors part or {@code null} if there weren't any comments
  3. * @since POI 4.0.0
  4. */
  5. @SuppressWarnings("WeakerAccess")
  6. public XSLFCommentAuthors getCommentAuthorsPart() {
  7. if(_commentAuthors == null) {
  8. // first scan the slide relations
  9. for (POIXMLDocumentPart p : getRelations()) {
  10. if (p instanceof XSLFCommentAuthors) {
  11. _commentAuthors = (XSLFCommentAuthors)p;
  12. return _commentAuthors;
  13. }
  14. }
  15. // then scan the presentation relations
  16. for (POIXMLDocumentPart p : getSlideShow().getRelations()) {
  17. if (p instanceof XSLFCommentAuthors) {
  18. _commentAuthors = (XSLFCommentAuthors)p;
  19. return _commentAuthors;
  20. }
  21. }
  22. }
  23. return null;
  24. }

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

  1. /**
  2. * Gets the requested text from the slide
  3. *
  4. * @param slide the slide to retrieve the text from
  5. * @param slideText Should we retrieve text from slides?
  6. * @param notesText Should we retrieve text from notes?
  7. * @param commentText Should we retrieve text from comments?
  8. * @param masterText Should we retrieve text from master slides?
  9. * @return the extracted text
  10. */
  11. public static String getText(XSLFSlide slide, boolean slideText, boolean notesText, boolean commentText, boolean masterText) {
  12. final SlideShowExtractor<XSLFShape, XSLFTextParagraph> ex = new SlideShowExtractor<>(slide.getSlideShow());
  13. ex.setSlidesByDefault(slideText);
  14. ex.setNotesByDefault(notesText);
  15. ex.setCommentsByDefault(commentText);
  16. ex.setMasterByDefault(masterText);
  17. return ex.getText(slide);
  18. }
  19. }

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

  1. private void copyChart(CTGraphicalObjectData objData, XSLFGraphicFrame srcShape) {
  2. XSLFSlide slide = (XSLFSlide) getSheet();
  3. XSLFSheet src = srcShape.getSheet();
  4. String xpath = "declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' c:chart";
  5. XmlObject[] obj = objData.selectPath(xpath);
  6. if (obj != null && obj.length == 1) {
  7. XmlCursor c = obj[0].newCursor();
  8. try {
  9. // duplicate chart with embedded workbook
  10. QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
  11. String id = c.getAttributeText(idQualifiedName);
  12. XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
  13. XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
  14. chartCopy.importContent(srcChart);
  15. chartCopy.setWorkbook(srcChart.getWorkbook());
  16. c.setAttributeText(idQualifiedName, slide.getRelationId(chartCopy));
  17. } catch (InvalidFormatException e) {
  18. throw new POIXMLException(e);
  19. } catch (IOException e) {
  20. throw new POIXMLException(e);
  21. }
  22. c.dispose();
  23. }
  24. }

相关文章