/** * Change Master of this slide. */ public void setMasterSheet(HSLFMasterSheet master){ SlideAtom sa = getSlideRecord().getSlideAtom(); int sheetNo = master._getSheetNumber(); sa.setMasterID(sheetNo); }
/** * Background for this slide. */ @Override public HSLFBackground getBackground() { if (getFollowMasterBackground()) { final HSLFMasterSheet ms = getMasterSheet(); return (ms == null) ? null : ms.getBackground(); } return super.getBackground(); }
/** * Color scheme for this slide. */ @Override public ColorSchemeAtom getColorScheme() { if (getFollowMasterScheme()) { final HSLFMasterSheet ms = getMasterSheet(); return (ms == null) ? null : ms.getColorScheme(); } return super.getColorScheme(); }
private void extractMaster(XHTMLContentHandler xhtml, HSLFMasterSheet master) throws SAXException { if (master == null) { return; } List<HSLFShape> shapes = master.getShapes(); if (shapes == null || shapes.isEmpty()) { return; } xhtml.startElement("div", "class", "slide-master-content"); for (HSLFShape shape : shapes) { if (shape != null && !HSLFMasterSheet.isPlaceholder(shape)) { if (shape instanceof HSLFTextShape) { HSLFTextShape tsh = (HSLFTextShape) shape; String text = tsh.getText(); if (text != null) { xhtml.element("p", text); } } } } xhtml.endElement("div"); }
/** * Delegate the call to the underlying slide master. */ @Override public TextPropCollection getPropCollection(final int txtype, final int level, final String name, final boolean isCharacter) { final HSLFMasterSheet master = getMasterSheet(); return (master == null) ? null : master.getPropCollection(txtype, level, name, isCharacter); }
@Override protected void setSlideShow(HSLFSlideShow ss) { super.setSlideShow(ss);
HSLFSheet sh = getSheet(); HSLFMasterSheet master = (sh != null) ? sh.getMasterSheet() : null; HSLFTextShape masterShape = (master != null) ? master.getPlaceholderByTextType(type) : null; if (masterShape != null && type != TextHeaderAtom.OTHER_TYPE) { align = masterShape.getAlignment();
private void setPropValInner(final TextPropCollection props, final String name, Consumer<? extends TextProp> handler) { final boolean isChar = props.getTextPropType() == TextPropType.character; final TextPropCollection pc; if (_sheet instanceof HSLFMasterSheet) { pc = ((HSLFMasterSheet)_sheet).getPropCollection(getRunType(), getIndentLevel(), "*", isChar); if (pc == null) { throw new HSLFException("Master text property collection can't be determined."); } } else { pc = props; } if (handler == null) { pc.removeByName(name); } else { // Fetch / Add the TextProp handler.accept(pc.addWithName(name)); } setDirty(); }
private <T extends TextProp> T getMasterProp(final String name) { final int txtype = parentParagraph.getRunType(); final HSLFSheet sheet = parentParagraph.getSheet(); if (sheet == null) { logger.log(POILogger.ERROR, "Sheet is not available"); return null; } final HSLFMasterSheet master = sheet.getMasterSheet(); if (master == null) { logger.log(POILogger.WARN, "MasterSheet is not available"); return null; } final TextPropCollection col = master.getPropCollection(txtype, parentParagraph.getIndentLevel(), name, true); return (col == null) ? null : col.findByName(name); }
TextPropCollection masterProps = master.getPropCollection(txtype, getIndentLevel(), pn, isChar); if (masterProps != null) { T prop = masterProps.findByName(pn);