/** * Fit picture shape into the target rectangle, maintaining the aspect ratio * and repositioning within the target rectangle with a centered alignment. * * @param target The target rectangle */ public void resize(Rectangle2D target) { resize(target, RectAlign.CENTER); }
@Override public XSLFPictureShape createPicture(PictureData pictureData){ if (!(pictureData instanceof XSLFPictureData)) { throw new IllegalArgumentException("pictureData needs to be of type XSLFPictureData"); } RelationPart rp = addRelation(null, XSLFRelation.IMAGES, (XSLFPictureData)pictureData); XSLFPictureShape sh = getDrawing().createPicture(rp.getRelationship().getId()); new DrawPictureShape(sh).resize(); getShapes().add(sh); sh.setParent(this); return sh; }
@Override public XSLFPictureShape createPicture(PictureData pictureData){ if (!(pictureData instanceof XSLFPictureData)) { throw new IllegalArgumentException("pictureData needs to be of type XSLFPictureData"); } RelationPart rp = getSheet().addRelation(null, XSLFRelation.IMAGES, (XSLFPictureData)pictureData); XSLFPictureShape sh = getDrawing().createPicture(rp.getRelationship().getId()); new DrawPictureShape(sh).resize(); _shapes.add(sh); sh.setParent(this); return sh; }
/** * Fit picture shape into the target rectangle, maintaining the aspect ratio * and repositioning within the target rectangle with a centered alignment. * * @param target The target rectangle */ public void resize(Rectangle2D target) { resize(target, RectAlign.CENTER); }
@Override public XSLFPictureShape createPicture(PictureData pictureData){ if (!(pictureData instanceof XSLFPictureData)) { throw new IllegalArgumentException("pictureData needs to be of type XSLFPictureData"); } RelationPart rp = getSheet().addRelation(null, XSLFRelation.IMAGES, (XSLFPictureData)pictureData); XSLFPictureShape sh = getDrawing().createPicture(rp.getRelationship().getId()); new DrawPictureShape(sh).resize(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFPictureShape createPicture(PictureData pictureData){ if (!(pictureData instanceof XSLFPictureData)) { throw new IllegalArgumentException("pictureData needs to be of type XSLFPictureData"); } RelationPart rp = addRelation(null, XSLFRelation.IMAGES, (XSLFPictureData)pictureData); XSLFPictureShape sh = getDrawing().createPicture(rp.getRelationship().getId()); new DrawPictureShape(sh).resize(); getShapes().add(sh); sh.setParent(this); return sh; }
/** * By default set the orininal image size */ @Override protected void afterInsert(HSLFSheet sh){ super.afterInsert(sh); EscherBSERecord bse = getEscherBSERecord(); bse.setRef(bse.getRef() + 1); Rectangle2D anchor = getAnchor(); if (anchor.isEmpty()){ new DrawPictureShape(this).resize(); } }