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

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

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

XSLFSlide.getRelations介绍

暂无

代码示例

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

  1. @Override
  2. public XSLFNotes getNotes() {
  3. if(_notes == null) {
  4. for (POIXMLDocumentPart p : getRelations()) {
  5. if (p instanceof XSLFNotes){
  6. _notes = (XSLFNotes)p;
  7. }
  8. }
  9. }
  10. if(_notes == null) {
  11. // This slide lacks notes
  12. // Not all have them, sorry...
  13. return null;
  14. }
  15. return _notes;
  16. }

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

  1. /**
  2. * @return the comments part or {@code null} if there weren't any comments
  3. * @since POI 4.0.0
  4. */
  5. @SuppressWarnings("WeakerAccess")
  6. public XSLFComments getCommentsPart() {
  7. if(_comments == null) {
  8. for (POIXMLDocumentPart p : getRelations()) {
  9. if (p instanceof XSLFComments) {
  10. _comments = (XSLFComments)p;
  11. break;
  12. }
  13. }
  14. }
  15. return _comments;
  16. }

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

  1. @Override
  2. public XSLFSlideLayout getSlideLayout(){
  3. if(_layout == null){
  4. for (POIXMLDocumentPart p : getRelations()) {
  5. if (p instanceof XSLFSlideLayout){
  6. _layout = (XSLFSlideLayout)p;
  7. }
  8. }
  9. }
  10. if(_layout == null) {
  11. throw new IllegalArgumentException("SlideLayout was not found for " + this);
  12. }
  13. return _layout;
  14. }

代码示例来源: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. public XSLFSlide removeSlide(int index) {
  2. XSLFSlide slide = _slides.remove(index);
  3. removeRelation(slide);
  4. _presentation.getSldIdLst().removeSldId(index);
  5. for (POIXMLDocumentPart p : slide.getRelations()) {
  6. if (p instanceof XSLFChart) {
  7. XSLFChart chart = (XSLFChart) p;
  8. slide.removeChartRelation(chart);
  9. _charts.remove(chart);
  10. } else if (p instanceof XSLFSlideLayout) {
  11. XSLFSlideLayout layout = (XSLFSlideLayout) p;
  12. slide.removeLayoutRelation(layout);
  13. }
  14. }
  15. return slide;
  16. }

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

  1. public XSLFComments getComments() {
  2. if(_comments == null) {
  3. for (POIXMLDocumentPart p : getRelations()) {
  4. if (p instanceof XSLFComments) {
  5. _comments = (XSLFComments)p;
  6. }
  7. }
  8. }
  9. if(_comments == null) {
  10. // This slide lacks comments
  11. // Not all have them, sorry...
  12. return null;
  13. }
  14. return _comments;
  15. }

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

  1. public XSLFNotes getNotes() {
  2. if(_notes == null) {
  3. for (POIXMLDocumentPart p : getRelations()) {
  4. if (p instanceof XSLFNotes){
  5. _notes = (XSLFNotes)p;
  6. }
  7. }
  8. }
  9. if(_notes == null) {
  10. // This slide lacks notes
  11. // Not all have them, sorry...
  12. return null;
  13. }
  14. return _notes;
  15. }

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

  1. /**
  2. * @return the comments part or {@code null} if there weren't any comments
  3. * @since POI 4.0.0
  4. */
  5. @SuppressWarnings("WeakerAccess")
  6. public XSLFComments getCommentsPart() {
  7. if(_comments == null) {
  8. for (POIXMLDocumentPart p : getRelations()) {
  9. if (p instanceof XSLFComments) {
  10. _comments = (XSLFComments)p;
  11. break;
  12. }
  13. }
  14. }
  15. return _comments;
  16. }

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

  1. @Override
  2. public XSLFNotes getNotes() {
  3. if(_notes == null) {
  4. for (POIXMLDocumentPart p : getRelations()) {
  5. if (p instanceof XSLFNotes){
  6. _notes = (XSLFNotes)p;
  7. }
  8. }
  9. }
  10. if(_notes == null) {
  11. // This slide lacks notes
  12. // Not all have them, sorry...
  13. return null;
  14. }
  15. return _notes;
  16. }

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

  1. @Override
  2. public XSLFSlideLayout getSlideLayout(){
  3. if(_layout == null){
  4. for (POIXMLDocumentPart p : getRelations()) {
  5. if (p instanceof XSLFSlideLayout){
  6. _layout = (XSLFSlideLayout)p;
  7. }
  8. }
  9. }
  10. if(_layout == null) {
  11. throw new IllegalArgumentException("SlideLayout was not found for " + this);
  12. }
  13. return _layout;
  14. }

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

  1. private static XSLFChart findChart(XSLFSlide slide) {
  2. // find chart in the slide
  3. XSLFChart chart = null;
  4. for(POIXMLDocumentPart part : slide.getRelations()){
  5. if(part instanceof XSLFChart){
  6. chart = (XSLFChart) part;
  7. break;
  8. }
  9. }
  10. if(chart == null) {
  11. throw new IllegalStateException("chart not found in the template");
  12. }
  13. return chart;
  14. }
  15. }

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

  1. public XSLFSlideLayout getSlideLayout(){
  2. if(_layout == null){
  3. for (POIXMLDocumentPart p : getRelations()) {
  4. if (p instanceof XSLFSlideLayout){
  5. _layout = (XSLFSlideLayout)p;
  6. }
  7. }
  8. }
  9. if(_layout == null) {
  10. throw new IllegalArgumentException("SlideLayout was not found for " + this.toString());
  11. }
  12. return _layout;
  13. }

代码示例来源: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: stackoverflow.com

  1. private XSLFChart getChartObject(XSLFSlide mainSlide,String chartName) throws IOException
  2. {
  3. XSLFChart chart = null;
  4. for(POIXMLDocumentPart part : mainSlide.getRelations()){
  5. if(part instanceof XSLFChart){
  6. chart = (XSLFChart) part;
  7. if(chart.getCTChart().getTitle()!=null && chart.getCTChart().getTitle().getTx()!=null){
  8. if(chart.getCTChart().getTitle().getTx().getRich().getPList().get(0).getRList().get(0).getT().equals(chartName))
  9. break;
  10. }
  11. }
  12. }
  13. return chart;
  14. }

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

  1. public XSLFSlide removeSlide(int index) {
  2. XSLFSlide slide = _slides.remove(index);
  3. removeRelation(slide);
  4. _presentation.getSldIdLst().removeSldId(index);
  5. for (POIXMLDocumentPart p : slide.getRelations()) {
  6. if (p instanceof XSLFChart) {
  7. XSLFChart chart = (XSLFChart) p;
  8. slide.removeChartRelation(chart);
  9. _charts.remove(chart);
  10. } else if (p instanceof XSLFSlideLayout) {
  11. XSLFSlideLayout layout = (XSLFSlideLayout) p;
  12. slide.removeLayoutRelation(layout);
  13. }
  14. }
  15. return slide;
  16. }

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

  1. for (POIXMLDocumentPart part : slide.getRelations()) {
  2. if (part instanceof XSLFChart) {
  3. chart = (XSLFChart) part;

相关文章