当前位置: 首页>>代码示例>>Java>>正文


Java XSLFSlide.getNotes方法代码示例

本文整理汇总了Java中org.apache.poi.xslf.usermodel.XSLFSlide.getNotes方法的典型用法代码示例。如果您正苦于以下问题:Java XSLFSlide.getNotes方法的具体用法?Java XSLFSlide.getNotes怎么用?Java XSLFSlide.getNotes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.poi.xslf.usermodel.XSLFSlide的用法示例。


在下文中一共展示了XSLFSlide.getNotes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initComponents

import org.apache.poi.xslf.usermodel.XSLFSlide; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());
    slidesEditor = OfficeTopComponent.getSelectedComponent(SlidesTopComponent.class);
    if (slidesEditor == null) {
        return;
    }
    XSLFSlide selectedSlide = slidesEditor.getPresentation().getSlides()[slidesEditor.getSelectedSlide()];
    XSLFNotes notes = selectedSlide.getNotes();
    SlideComponent notesComponent = new SlideComponent(notes, slidesEditor, new Dimension(300, 200));
    add(notesComponent);
    slidesEditor.addPropertyChangeListener("slideChanged", this);
    putClientProperty("print.printable", Boolean.TRUE);
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:14,代码来源:SlideNotesTopComponent.java

示例2: propertyChange

import org.apache.poi.xslf.usermodel.XSLFSlide; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
    int newSlideIndex = (Integer) evt.getNewValue();
    remove(0);
    XSLFSlide selectedSlide = slidesEditor.getPresentation().getSlides()[newSlideIndex];
    XSLFNotes notes = selectedSlide.getNotes();
    SlideComponent notesComponent = new SlideComponent(notes, slidesEditor, new Dimension(300, 200));
    add(notesComponent);
    revalidate();
}
 
开发者ID:foxerfly,项目名称:Joeffice,代码行数:11,代码来源:SlideNotesTopComponent.java

示例3: buildXHTML

import org.apache.poi.xslf.usermodel.XSLFSlide; //导入方法依赖的package包/类
/**
 * @see org.apache.poi.xslf.extractor.XSLFPowerPointExtractor#getText()
 */
protected void buildXHTML(XHTMLContentHandler xhtml) throws SAXException,
    IOException {
  XMLSlideShow slideShow = (XMLSlideShow) extractor.getDocument();

  XSLFSlide[] slides = slideShow.getSlides();
  for (XSLFSlide slide : slides) {
    String slideDesc;

    if (slide.getPackagePart() != null
        && slide.getPackagePart().getPartName() != null) {
      slideDesc = getJustFileName(slide.getPackagePart().getPartName()
          .toString());
      slideDesc += "_";
    } else {
      slideDesc = null;
    }

    // slide
    extractContent(slide.getShapes(), false, xhtml, slideDesc);

    // slide layout which is the master sheet for this slide
    XSLFSheet slideLayout = slide.getMasterSheet();
    extractContent(slideLayout.getShapes(), true, xhtml, null);

    // slide master which is the master sheet for all text layouts
    XSLFSheet slideMaster = slideLayout.getMasterSheet();
    extractContent(slideMaster.getShapes(), true, xhtml, null);

    // notes (if present)
    XSLFSheet slideNotes = slide.getNotes();
    if (slideNotes != null) {
      extractContent(slideNotes.getShapes(), false, xhtml, slideDesc);
      // master sheet for this notes
      XSLFSheet notesMaster = slideNotes.getMasterSheet();
      extractContent(notesMaster.getShapes(), true, xhtml, null);
    }

    // comments (if present)
    XSLFComments comments = slide.getComments();
    if (comments != null) {
      for (CTComment comment : comments.getCTCommentsList().getCmList()) {
        xhtml.element("p", comment.getText());
      }
    }
  }

  if (Config.inst().getProp(ConfigBool.ENABLE_IMAGE_OCR)) {
    TikaImageHelper helper = new TikaImageHelper(metadata);
    try {
      List<XSLFPictureData> pictures = slideShow.getAllPictures();
      for (XSLFPictureData picture : pictures) {
        ByteArrayInputStream imageData = new ByteArrayInputStream(
            picture.getData());
        BufferedImage image = ImageIO.read(imageData);
        helper.addImage(image);
        helper.addTextToHandler(xhtml);
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (extractor != null) {
        extractor.close();
      }
      if (helper != null) {
        helper.close();
      }
    }
  }
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:73,代码来源:XSLFPowerPointExtractorDecorator.java


注:本文中的org.apache.poi.xslf.usermodel.XSLFSlide.getNotes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。