gpt4 book ai didi

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

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

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

XSLFSlideMaster介绍

[英]Slide master object associated with this layout.

Within a slide master slide are contained all elements that describe the objects and their corresponding formatting for within a presentation slide.

Within a slide master slide are two main elements. The cSld element specifies the common slide elements such as shapes and their attached text bodies. Then the txStyles element specifies the formatting for the text within each of these shapes. The other properties within a slide master slide specify other properties for within a presentation slide such as color information, headers and footers, as well as timing and transition information for all corresponding presentation slides.
[中]与此布局关联的幻灯片母版对象。
幻灯片主幻灯片中包含描述演示幻灯片中对象及其相应格式的所有元素。
在幻灯片主幻灯片中有两个主要元素。cSld元素指定常见的幻灯片元素,例如形状及其附加的文本体。然后txStyles元素指定每个形状中文本的格式。幻灯片母版幻灯片中的其他属性指定演示幻灯片中的其他属性,例如颜色信息、页眉和页脚,以及所有相应演示幻灯片的计时和转换信息。

代码示例

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

/**
 * Create a blank slide using the default (first) master.
 */
@Override
public XSLFSlide createSlide() {
  XSLFSlideMaster sm = _masters.get(0);
  XSLFSlideLayout layout = sm.getLayout(SlideLayout.BLANK);
  if (layout == null) {
    LOG.log(POILogger.WARN, "Blank layout was not found - defaulting to first slide layout in master");
    XSLFSlideLayout sl[] = sm.getSlideLayouts();
    if (sl.length == 0) {
      throw new POIXMLException("SlideMaster must contain a SlideLayout.");
    }
    layout = sl[0];
  }
  return createSlide(layout);
}

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

/**
 * Get the slide layout by name.
 *
 * @param name  The layout name (case-insensitive). Cannot be null.
 *
 * @return the layout found or null on failure
 */
public XSLFSlideLayout getLayout(String name) {
  return getLayouts().get(name.toLowerCase(Locale.ROOT));
}

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

/**
 * Scan the master slides for the first slide layout with the given name.
 *
 * @param name The layout name (case-insensitive). Cannot be null.
 * @return the first layout found or null on failure
 */
public XSLFSlideLayout findLayout(String name) {
  for (XSLFSlideMaster master : getSlideMasters()) {
    XSLFSlideLayout layout = master.getLayout(name);
    if (layout != null) {
      return layout;
    }
  }
  return null;
}

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

@Override
public XSLFTheme getTheme() {
  return getSlideMaster().getTheme();
}

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

@SuppressWarnings(value = "unused")
protected CTTextListStyle getTextProperties(Placeholder textType) {
  CTTextListStyle props;
  CTSlideMasterTextStyles txStyles = getXmlObject().getTxStyles();
  switch (textType){
    case TITLE:
    case CENTERED_TITLE:
    case SUBTITLE:
      props = txStyles.getTitleStyle();
      break;
    case BODY:
      props = txStyles.getBodyStyle();
      break;
    default:
      props = txStyles.getOtherStyle();
      break;
  }
  return props;
}

代码示例来源: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.openl.rules/org.openl.lib.poi.dev

protected XSLFSlideMaster(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
  super(part, rel);
  SldMasterDocument doc =
    SldMasterDocument.Factory.parse(getPackagePart().getInputStream());
  _slide = doc.getSldMaster();
  setCommonSlideData(_slide.getCSld());
}

代码示例来源:origin: ekoz/kbase-doc

for (int i=0;i<pptx.getSlideMasters().size();i++) {
  XSLFSlideMaster slideMaster = pptx.getSlideMasters().get(i);
  XSLFSlideLayout[] slideLayouts = slideMaster.getSlideLayouts();
  for (XSLFSlideLayout slidelayout : slideLayouts) {
    XSLFPictureShape pictureShape = slidelayout.createPicture(pictureData);

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

/**
 * @since POI 3.14-Beta1
 */
protected XSLFSlideMaster(PackagePart part) throws IOException, XmlException {
  super(part);
  SldMasterDocument doc =
    SldMasterDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS);
  _slide = doc.getSldMaster();
}

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

XSLFSlideMaster master = (XSLFSlideMaster)sm;
int textType = getPlaceholderType(ph);
XSLFSimpleShape masterShape = master.getPlaceholderByType(textType);
return masterShape != null && visitor.fetch(masterShape);

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

extractText(master.getCommonSlideData(), true, text);

代码示例来源:origin: stackoverflow.com

XSLFSlideMaster defaultMaster = slideShow.getSlideMasters()[0];    
XSLFSlideLayout titleLayout = defaultMaster.getLayout(SlideLayout.TITLE);

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

@Override
public XSLFTheme getTheme(){
  return getSlideLayout().getSlideMaster().getTheme();
}

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

private CTHeaderFooter getHeaderFooter(final boolean create) {
  final XSLFSheet sheet = shape.getSheet();
  final XSLFSheet master = (sheet instanceof MasterSheet && !(sheet instanceof XSLFSlideLayout)) ? sheet : (XSLFSheet)sheet.getMasterSheet();
  if (master instanceof XSLFSlideMaster) {
    final CTSlideMaster ct = ((XSLFSlideMaster) master).getXmlObject();
    return (ct.isSetHf() || !create) ? ct.getHf() : ct.addNewHf();
  } else if (master instanceof  XSLFNotesMaster) {
    final CTNotesMaster ct = ((XSLFNotesMaster) master).getXmlObject();
    return (ct.isSetHf() || !create) ? ct.getHf() : ct.addNewHf();
  } else {
    return null;
  }
}

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

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.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * @since POI 3.14-Beta1
 */
protected XSLFSlideMaster(PackagePart part) throws IOException, XmlException {
  super(part);
  SldMasterDocument doc =
    SldMasterDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS);
  _slide = doc.getSldMaster();
}

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

XSLFSlideMaster master = (XSLFSlideMaster)sm;
int textType = getPlaceholderType(ph);
XSLFSimpleShape masterShape = master.getPlaceholderByType(textType);
return masterShape != null && visitor.fetch(masterShape);

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

final String text = extractText(master.getCommonSlideData(), true);
result.add(MASTER, text);
result.add(CONTENT, text);

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

/**
 * Create a blank slide using the default (first) master.
 */
@Override
public XSLFSlide createSlide() {
  XSLFSlideMaster sm = _masters.get(0);
  XSLFSlideLayout layout = sm.getLayout(SlideLayout.BLANK);
  if (layout == null) {
    LOG.log(POILogger.WARN, "Blank layout was not found - defaulting to first slide layout in master");
    XSLFSlideLayout sl[] = sm.getSlideLayouts();
    if (sl.length == 0) {
      throw new POIXMLException("SlideMaster must contain a SlideLayout.");
    }
    layout = sl[0];
  }
  return createSlide(layout);
}

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