XSLFSimpleShape placeholderShape = slideLayout.getPlaceholder(ph); if (placeholderShape != null && visitor.fetch(placeholderShape)) { return true; sm = slideLayout.getMasterSheet();
@Override public XSLFSlideMaster getMasterSheet() { return getSlideMaster(); }
/** * Get the slide layout by type. * * @param type The layout type. Cannot be null. * * @return the layout found or null on failure */ public XSLFSlideLayout getLayout(SlideLayout type){ for(XSLFSlideLayout layout : getLayouts().values()){ if(layout.getType() == type) { return layout; } } return null; }
extractContent(slideLayout.getShapes(), true, xhtml, null); xhtml.endElement("div"); XSLFSheet slideMaster = slideLayout.getMasterSheet(); extractContent(slideMaster.getShapes(), true, xhtml, null);
@Override public XSLFBackground getBackground() { CTBackground bg = _layout.getCSld().getBg(); if(bg != null) { return new XSLFBackground(bg, this); } else { return getMasterSheet().getBackground(); } }
/** * Copy placeholders from this layout to the destination slide * * @param slide destination slide */ @SuppressWarnings("WeakerAccess") public void copyLayout(XSLFSlide slide) { for (XSLFShape sh : getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape tsh = (XSLFTextShape) sh; Placeholder ph = tsh.getTextType(); if (ph == null) continue; switch (ph) { // these are special and not copied by default case DATETIME: case SLIDE_NUMBER: case FOOTER: break; default: slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy()); } } } }
XSLFComments comments = slide.getComments(); XSLFSlideLayout layout = slide.getSlideLayout(); XSLFSlideMaster master = layout.getSlideMaster(); extractText(layout.getCommonSlideData(), true, text);
/** * Create a slide and initialize it from the specified layout. * * @param layout * @return created slide */ public XSLFSlide createSlide(XSLFSlideLayout layout) { int slideNumber = 256, cnt = 1; CTSlideIdList slideList; if (!_presentation.isSetSldIdLst()) slideList = _presentation.addNewSldIdLst(); else { slideList = _presentation.getSldIdLst(); for(CTSlideIdListEntry slideId : slideList.getSldIdList()){ slideNumber = (int)Math.max(slideId.getId() + 1, slideNumber); cnt++; } } XSLFSlide slide = (XSLFSlide)createRelationship( XSLFRelation.SLIDE, XSLFFactory.getInstance(), cnt); CTSlideIdListEntry slideId = slideList.addNewSldId(); slideId.setId(slideNumber); slideId.setId2(slide.getPackageRelationship().getId()); layout.copyLayout(slide); slide.addRelation(layout.getPackageRelationship().getId(), layout); PackagePartName ppName = layout.getPackagePart().getPartName(); slide.getPackagePart().addRelationship(ppName, TargetMode.INTERNAL, layout.getPackageRelationship().getRelationshipType()); _slides.add(slide); return slide; }
/** * Slide master object associated with this layout. * * @return slide master. Never null. * @throws IllegalStateException if slide master was not found */ public XSLFSlideMaster getSlideMaster() { if (_master == null) { for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFSlideMaster) { _master = (XSLFSlideMaster) p; } } } if (_master == null) { throw new IllegalStateException("SlideMaster was not found for " + this.toString()); } return _master; }
private Map<String, XSLFSlideLayout> getLayouts(){ if(_layouts == null){ _layouts = new HashMap<>(); for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFSlideLayout){ XSLFSlideLayout layout = (XSLFSlideLayout)p; _layouts.put(layout.getName().toLowerCase(Locale.ROOT), layout); } } } return _layouts; }
/** * * @return the information about background appearance of this slide */ @Override public XSLFBackground getBackground() { CTBackground bg = _slide.getCSld().getBg(); if(bg != null) { return new XSLFBackground(bg, this); } else { return getMasterSheet().getBackground(); } }
public XSLFSlideLayout(PackagePart part, PackageRelationship rel) throws IOException, XmlException { super(part, rel); SldLayoutDocument doc = SldLayoutDocument.Factory.parse(getPackagePart().getInputStream()); _layout = doc.getSldLayout(); setCommonSlideData(_layout.getCSld()); }
/** * @since POI 3.14-Beta1 */ public XSLFSlideLayout(PackagePart part) throws IOException, XmlException { super(part); SldLayoutDocument doc = SldLayoutDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _layout = doc.getSldLayout(); }
/** * Slide master object associated with this layout. * * @return slide master. Never null. * @throws IllegalStateException if slide master was not found */ @SuppressWarnings("WeakerAccess") public XSLFSlideMaster getSlideMaster() { if (_master == null) { for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFSlideMaster) { _master = (XSLFSlideMaster) p; } } } if (_master == null) { throw new IllegalStateException("SlideMaster was not found for " + this); } return _master; }
slideId.setId2(rp.getRelationship().getId()); layout.copyLayout(slide); slide.getPackagePart().clearRelationships(); slide.addRelation(null, XSLFRelation.SLIDE_LAYOUT, layout);
extractContent(slideLayout.getShapes(), true, xhtml, null); xhtml.endElement("div"); XSLFSheet slideMaster = slideLayout.getMasterSheet(); extractContent(slideMaster.getShapes(), true, xhtml, null);
@Override public XSLFBackground getBackground() { CTBackground bg = _layout.getCSld().getBg(); if(bg != null) { return new XSLFBackground(bg, this); } else { return getMasterSheet().getBackground(); } }
/** * Copy placeholders from this layout to the destination slide * * @param slide destination slide */ public void copyLayout(XSLFSlide slide) { for (XSLFShape sh : getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape tsh = (XSLFTextShape) sh; Placeholder ph = tsh.getTextType(); if (ph == null) continue; switch (ph) { // these are special and not copied by default case DATETIME: case SLIDE_NUMBER: case FOOTER: break; default: slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy()); } } } }
final XSLFComments comments = slide.getComments(); final XSLFSlideLayout layout = slide.getSlideLayout(); final XSLFSlideMaster master = layout.getSlideMaster(); final String text = extractText(layout.getCommonSlideData(), true); result.add(MASTER, text); result.add(CONTENT, text);
private Map<String, XSLFSlideLayout> getLayouts(){ if(_layouts == null){ _layouts = new HashMap<String, XSLFSlideLayout>(); for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFSlideLayout){ XSLFSlideLayout layout = (XSLFSlideLayout)p; _layouts.put(layout.getName().toLowerCase(), layout); } } } return _layouts; }