本文整理汇总了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);
}
示例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();
}
示例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();
}
}
}
}