@Override public Rectangle2D getAnchor(){ Dimension pg = getSheet().getSlideShow().getPageSize(); return new Rectangle2D.Double(0, 0, pg.getWidth(), pg.getHeight()); }
boolean fetchThemeProperty(final ParagraphPropertyFetcher<?> visitor) { final XSLFTextShape shape = getParentShape(); if (shape.isPlaceholder()) { return false; } // if it is a plain text box then take defaults from presentation.xml @SuppressWarnings("resource") final XMLSlideShow ppt = shape.getSheet().getSlideShow(); final CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getIndentLevel()); return themeProps != null && visitor.fetch(themeProps); }
/** * Get assigned TableStyle * * @return the assigned TableStyle * * @since POI 3.15-beta2 */ protected XSLFTableStyle getTableStyle() { CTTable tab = getCTTable(); // TODO: support inline table style if (!tab.isSetTblPr() || !tab.getTblPr().isSetTableStyleId()) { return null; } String styleId = tab.getTblPr().getTableStyleId(); XSLFTableStyles styles = getSheet().getSlideShow().getTableStyles(); for (XSLFTableStyle style : styles.getStyles()) { if (style.getStyleId().equals(styleId)) { return style; } } return null; }
XSLFPictureShape p = (XSLFPictureShape)shape; XSLFPictureData pd = p.getPictureData(); XSLFPictureData pdNew = getSheet().getSlideShow().addPicture(pd.getData(), pd.getType()); newShape = createPicture(pdNew); } else if (shape instanceof XSLFGroupShape) {
/** * Import a picture data from another document. * * @param blipId ID of the package relationship to retrieve. * @param parent parent document containing the data to import * @return ID of the created relationship */ String importBlip(String blipId, POIXMLDocumentPart parent) { final XSLFPictureData parData = parent.getRelationPartById(blipId).getDocumentPart(); final XSLFPictureData pictureData; if (getPackagePart().getPackage() == parent.getPackagePart().getPackage()) { // handle ref counter correct, if the parent document is the same as this pictureData = parData; } else { XMLSlideShow ppt = getSlideShow(); pictureData = ppt.addPicture(parData.getData(), parData.getType()); } RelationPart rp = addRelation(blipId, XSLFRelation.IMAGES, pictureData); return rp.getRelationship().getId(); }
XMLSlideShow slideShow = sheet.getSlideShow(); CTTableStyleCellStyle tcStyle = tps.getTcStyle(); if (tcStyle.isSetFill()) {
@Override public Rectangle2D getAnchor(){ Dimension pg = getSheet().getSlideShow().getPageSize(); return new Rectangle2D.Double(0, 0, pg.getWidth(), pg.getHeight()); }
@Override public Rectangle2D getAnchor(){ Dimension pg = getSheet().getSlideShow().getPageSize(); return new Rectangle2D.Double(0, 0, pg.getWidth(), pg.getHeight()); }
boolean fetchThemeProperty(final ParagraphPropertyFetcher<?> visitor) { final XSLFTextShape shape = getParentShape(); if (shape.isPlaceholder()) { return false; } // if it is a plain text box then take defaults from presentation.xml @SuppressWarnings("resource") final XMLSlideShow ppt = shape.getSheet().getSlideShow(); final CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getIndentLevel()); return themeProps != null && visitor.fetch(themeProps); }
if(!_shape.getWordWrap()) { width = _shape.getSheet().getSlideShow().getPageSize().getWidth() - anchor.getX(); } else { width = anchor.getWidth() - leftInset - rightInset - leftMargin;
XSLFPictureShape p = (XSLFPictureShape)shape; XSLFPictureData pd = p.getPictureData(); XSLFPictureData pdNew = getSheet().getSlideShow().addPicture(pd.getData(), pd.getType()); newShape = createPicture(pdNew); } else if (shape instanceof XSLFGroupShape) {
/** * Get assigned TableStyle * * @return the assigned TableStyle * * @since POI 3.15-beta2 */ protected XSLFTableStyle getTableStyle() { CTTable tab = getCTTable(); // TODO: support inline table style if (!tab.isSetTblPr() || !tab.getTblPr().isSetTableStyleId()) { return null; } String styleId = tab.getTblPr().getTableStyleId(); XSLFTableStyles styles = getSheet().getSlideShow().getTableStyles(); for (XSLFTableStyle style : styles.getStyles()) { if (style.getStyleId().equals(styleId)) { return style; } } return null; }
/** * Import a picture data from another document. * * @param blipId ID of the package relationship to retrieve. * @param parent parent document containing the data to import * @return ID of the created relationship */ String importBlip(String blipId, POIXMLDocumentPart parent) { final XSLFPictureData parData = parent.getRelationPartById(blipId).getDocumentPart(); final XSLFPictureData pictureData; if (getPackagePart().getPackage() == parent.getPackagePart().getPackage()) { // handle ref counter correct, if the parent document is the same as this pictureData = parData; } else { XMLSlideShow ppt = getSlideShow(); pictureData = ppt.addPicture(parData.getData(), parData.getType()); } RelationPart rp = addRelation(blipId, XSLFRelation.IMAGES, pictureData); return rp.getRelationship().getId(); }
/** * Import a picture data from another document. * * @param blipId ID of the package relationship to retrieve. * @param packagePart package part containing the data to import * @return ID of the created relationship */ String importBlip(String blipId, PackagePart packagePart) { PackageRelationship blipRel = packagePart.getRelationship(blipId); PackagePart blipPart; try { blipPart = packagePart.getRelatedPart(blipRel); } catch (InvalidFormatException e){ throw new POIXMLException(e); } XSLFPictureData data = new XSLFPictureData(blipPart, null); XMLSlideShow ppt = getSlideShow(); int pictureIdx = ppt.addPicture(data.getData(), data.getPictureType()); PackagePart pic = ppt.getAllPictures().get(pictureIdx).getPackagePart(); PackageRelationship rel = getPackagePart().addRelationship( pic.getPartName(), TargetMode.INTERNAL, blipRel.getRelationshipType()); addRelation(rel.getId(), new XSLFPictureData(pic, rel)); return rel.getId(); } }
private boolean fetchCharacterProperty(CharacterPropertyFetcher fetcher){ boolean ok = false; if(_r.isSetRPr()) ok = fetcher.fetch(getRPr()); if(!ok) { XSLFTextShape shape = _p.getParentShape(); ok = shape.fetchShapeProperty(fetcher); if(!ok){ CTPlaceholder ph = shape.getCTPlaceholder(); if(ph == null){ // if it is a plain text box then take defaults from presentation.xml XMLSlideShow ppt = shape.getSheet().getSlideShow(); CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(_p.getLevel()); if(themeProps != null) { fetcher.isFetchingFromMaster = true; ok = fetcher.fetch(themeProps); } } if (!ok) { CTTextParagraphProperties defaultProps = _p.getDefaultMasterStyle(); if(defaultProps != null) { fetcher.isFetchingFromMaster = true; ok = fetcher.fetch(defaultProps); } } } } return ok; }
private boolean fetchParagraphProperty(ParagraphPropertyFetcher visitor){ boolean ok = false; if(_p.isSetPPr()) ok = visitor.fetch(_p.getPPr()); if(!ok) { XSLFTextShape shape = getParentShape(); ok = shape.fetchShapeProperty(visitor); if(!ok){ CTPlaceholder ph = shape.getCTPlaceholder(); if(ph == null){ // if it is a plain text box then take defaults from presentation.xml XMLSlideShow ppt = getParentShape().getSheet().getSlideShow(); CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getLevel()); if(themeProps != null) ok = visitor.fetch(themeProps); } if(!ok){ // defaults for placeholders are defined in the slide master CTTextParagraphProperties defaultProps = getDefaultMasterStyle(); if(defaultProps != null) ok = visitor.fetch(defaultProps); } } } return ok; }
XMLSlideShow slideShow = sheet.getSlideShow(); CTTableStyleCellStyle tcStyle = tps.getTcStyle(); if (tcStyle.isSetFill()) {