@SuppressWarnings("WeakerAccess") protected static PaintStyle selectPaint(final CTBlipFillProperties blipFill, final PackagePart parentPart) { final CTBlip blip = blipFill.getBlip(); return new TexturePaint() { private PackagePart getPart() {
protected CTBlip getBlip(){ return getBlipFill().getBlip(); }
protected CTBlip getBlip(){ return getBlipFill().getBlip(); }
public XDDFPicture getPicture() { if (props.isSetBlip()) { return new XDDFPicture(props.getBlip()); } else { return null; } }
/** * Link Picture with PictureData * * @param rel */ public void setPictureReference(PackageRelationship rel) { ctPic.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link this shape with the picture data * * @param rel relationship referring the picture data */ protected void setPictureReference(PackageRelationship rel){ ctPicture.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Return picture data for this shape * * @return picture data for this shape */ public XSSFPictureData getPictureData() { String blipId = ctPicture.getBlipFill().getBlip().getEmbed(); return (XSSFPictureData)getDrawing().getRelationById(blipId); }
/** * Get the PictureData of the Picture, if present. * Note - not all kinds of picture have data */ public XWPFPictureData getPictureData() { CTBlipFillProperties blipProps = ctPic.getBlipFill(); if (blipProps == null || !blipProps.isSetBlip()) { // return null if Blip data is missing return null; } String blipId = blipProps.getBlip().getEmbed(); POIXMLDocumentPart part = run.getParent().getPart(); if (part != null) { POIXMLDocumentPart relatedPart = part.getRelationById(blipId); if (relatedPart instanceof XWPFPictureData) { return (XWPFPictureData) relatedPart; } } return null; }
@Override public XSLFSlide importContent(XSLFSheet src){ super.importContent(src); if (!(src instanceof XSLFSlide)) { return this; } // only copy direct backgrounds - not backgrounds of master sheet CTBackground bgOther = ((XSLFSlide)src)._slide.getCSld().getBg(); if (bgOther == null) { return this; } CTBackground bgThis = _slide.getCSld().getBg(); // remove existing background if (bgThis != null) { if (bgThis.isSetBgPr() && bgThis.getBgPr().isSetBlipFill()) { String oldId = bgThis.getBgPr().getBlipFill().getBlip().getEmbed(); removeRelation(oldId); } _slide.getCSld().unsetBg(); } bgThis = (CTBackground)_slide.getCSld().addNewBg().set(bgOther); if(bgOther.isSetBgPr() && bgOther.getBgPr().isSetBlipFill()){ String idOther = bgOther.getBgPr().getBlipFill().getBlip().getEmbed(); String idThis = importBlip(idOther, src); bgThis.getBgPr().getBlipFill().getBlip().setEmbed(idThis); } return this; }
CTBlip blip = getBlipFill().getBlip(); blip.setEmbed(relId);
CTBlip blip = fp.getBlipFill().getBlip(); String blipId = blip.getEmbed();
public XDDFPicture getPicture() { if (props.isSetBlip()) { return new XDDFPicture(props.getBlip()); } else { return null; } }
/** * Returns the picture data of the given picture. * * @param picture * @return */ public XWPFPictureData getPictureData( CTPicture picture ) { String blipId = picture.getBlipFill().getBlip().getEmbed(); return getPictureDataByID( blipId ); }
/** * Link Picture with PictureData * @param rel */ public void setPictureReference(PackageRelationship rel){ ctPic.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link this shape with the picture data * * @param rel relationship referring the picture data */ protected void setPictureReference(PackageRelationship rel){ ctPicture.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Returns the picture data of the given picture. * * @param picture * @return */ public XWPFPictureData getPictureData( CTPicture picture ) { String blipId = picture.getBlipFill().getBlip().getEmbed(); return getPictureDataByID( blipId ); }
/** * Link Picture with PictureData * * @param rel */ public void setPictureReference(PackageRelationship rel) { ctPic.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link this shape with the picture data * * @param rel relationship referring the picture data */ protected void setPictureReference(PackageRelationship rel){ ctPicture.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Return picture data for this shape * * @return picture data for this shape */ public XSSFPictureData getPictureData() { String blipId = ctPicture.getBlipFill().getBlip().getEmbed(); return (XSSFPictureData)getDrawing().getRelationById(blipId); }