gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFSlideLayout类的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 09:37:05 37 4
gpt4 key购买 nike

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

XSLFSlideLayout介绍

暂无

代码示例

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

XSLFSimpleShape placeholderShape = slideLayout.getPlaceholder(ph);
if (placeholderShape != null && visitor.fetch(placeholderShape)) {
  return true;
sm = slideLayout.getMasterSheet();

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

@Override
public XSLFSlideMaster getMasterSheet() {
  return getSlideMaster();
}

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

/**
 * 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;
}

代码示例来源:origin: apache/tika

extractContent(slideLayout.getShapes(), true, xhtml, null);
xhtml.endElement("div");
XSLFSheet slideMaster = slideLayout.getMasterSheet();
extractContent(slideMaster.getShapes(), true, xhtml, null);

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

@Override
public XSLFBackground getBackground() {
  CTBackground bg = _layout.getCSld().getBg();
  if(bg != null) {
    return new XSLFBackground(bg, this);
  } else {
    return getMasterSheet().getBackground();
  }
}

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

/**
 * 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());
      }
    }
  }
}

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

XSLFComments comments = slide.getComments();
XSLFSlideLayout layout = slide.getSlideLayout();
XSLFSlideMaster master = layout.getSlideMaster();
     extractText(layout.getCommonSlideData(), true, text);

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

/**
 * 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;
}

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

/**
 * 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;
}

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

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;
}

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

/**
 *
 * @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();
  }
}

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

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());
}

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

/**
 * @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();
}

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

/**
 * 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;
}

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

slideId.setId2(rp.getRelationship().getId());
layout.copyLayout(slide);
slide.getPackagePart().clearRelationships();
slide.addRelation(null, XSLFRelation.SLIDE_LAYOUT, layout);

代码示例来源:origin: org.apache.tika/tika-parsers

extractContent(slideLayout.getShapes(), true, xhtml, null);
xhtml.endElement("div");
XSLFSheet slideMaster = slideLayout.getMasterSheet();
extractContent(slideMaster.getShapes(), true, xhtml, null);

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

@Override
public XSLFBackground getBackground() {
  CTBackground bg = _layout.getCSld().getBg();
  if(bg != null) {
    return new XSLFBackground(bg, this);
  } else {
    return getMasterSheet().getBackground();
  }
}

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

/**
 * 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());
      }
    }
  }
}

代码示例来源:origin: com.qwazr/qwazr-library-poi

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);

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

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;
}

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com