@Override public XSLFFreeformShape createFreeform(){ XSLFFreeformShape sh = getDrawing().createFreeform(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFGroupShape createGroup(){ XSLFGroupShape sh = getDrawing().createGroup(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFAutoShape createAutoShape(){ XSLFAutoShape sh = getDrawing().createAutoShape(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFTextBox createTextBox(){ XSLFTextBox sh = getDrawing().createTextBox(); _shapes.add(sh); sh.setParent(this); return sh; }
public XSLFTable createTable(){ XSLFTable sh = getDrawing().createTable(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFConnectorShape createConnector(){ XSLFConnectorShape sh = getDrawing().createConnector(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFTable createTable(int numRows, int numCols){ if (numRows < 1 || numCols < 1) { throw new IllegalArgumentException("numRows and numCols must be greater than 0"); } XSLFTable sh = getDrawing().createTable(); _shapes.add(sh); sh.setParent(this); for (int r=0; r<numRows; r++) { XSLFTableRow row = sh.addRow(); for (int c=0; c<numCols; c++) { row.addCell(); } } 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; }
@Override public XSLFObjectShape createOleShape(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); XSLFObjectShape sh = getDrawing().createOleShape(rp.getRelationship().getId()); CTOleObject oleObj = sh.getCTOleObject(); Dimension dim = pictureData.getImageDimension(); oleObj.setImgW(Units.toEMU(dim.getWidth())); oleObj.setImgH(Units.toEMU(dim.getHeight())); getShapes().add(sh); sh.setParent(this); return sh; }
public XSLFGroupShape createGroup(){ XSLFGroupShape sh = getDrawing().createGroup(); _shapes.add(sh); return sh; }
public XSLFFreeformShape createFreeform(){ XSLFFreeformShape sh = getDrawing().createFreeform(); _shapes.add(sh); return sh; }
public XSLFConnectorShape createConnector(){ XSLFConnectorShape sh = getDrawing().createConnector(); _shapes.add(sh); return sh; }
public XSLFAutoShape createAutoShape(){ XSLFAutoShape sh = getDrawing().createAutoShape(); _shapes.add(sh); return sh; }
@Override public XSLFAutoShape createAutoShape(){ XSLFAutoShape sh = getDrawing().createAutoShape(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFTextBox createTextBox(){ XSLFTextBox sh = getDrawing().createTextBox(); _shapes.add(sh); sh.setParent(this); return sh; }
public XSLFTable createTable(){ XSLFTable sh = getDrawing().createTable(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFConnectorShape createConnector(){ XSLFConnectorShape sh = getDrawing().createConnector(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFGroupShape createGroup(){ XSLFGroupShape sh = getDrawing().createGroup(); _shapes.add(sh); sh.setParent(this); return sh; }
@Override public XSLFFreeformShape createFreeform(){ XSLFFreeformShape sh = getDrawing().createFreeform(); _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 = 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; }