public void setGeometry(PresetGeometry preset) { geometry.setPrst(preset.underlying); }
/** * Sets the shape types. * * @param type * the shape type, one of the constants defined in * {@link org.apache.poi.ss.usermodel.ShapeTypes}. * @see org.apache.poi.ss.usermodel.ShapeTypes */ public void setShapeType(int type) { ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type)); }
/** * Sets the shape types. * * @param type the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}. * @see org.apache.poi.ss.usermodel.ShapeTypes */ public void setShapeType(int type) { ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type)); }
@Override public void setShapeType(ShapeType type) { XSLFGeometryProperties gp = XSLFPropertiesDelegate.getGeometryDelegate(getShapeProperties()); if (gp == null) { return; } if (gp.isSetCustGeom()) { gp.unsetCustGeom(); } CTPresetGeometry2D prst = (gp.isSetPrstGeom()) ? gp.getPrstGeom() : gp.addNewPrstGeom(); prst.setPrst(STShapeType.Enum.forInt(type.ooxmlId)); }
/** * @param shapeId * 1-based shapeId */ static CTShape prototype(int shapeId) { CTShape ct = CTShape.Factory.newInstance(); CTShapeNonVisual nvSpPr = ct.addNewNvSpPr(); CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr(); cnv.setName("AutoShape " + shapeId); cnv.setId(shapeId); nvSpPr.addNewCNvSpPr(); nvSpPr.addNewNvPr(); CTShapeProperties spPr = ct.addNewSpPr(); CTPresetGeometry2D prst = spPr.addNewPrstGeom(); prst.setPrst(STShapeType.RECT); prst.addNewAvLst(); return ct; }
/** * @param shapeId 1-based shapeId */ static CTConnector prototype(int shapeId) { CTConnector ct = CTConnector.Factory.newInstance(); CTConnectorNonVisual nvSpPr = ct.addNewNvCxnSpPr(); CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr(); cnv.setName("Connector " + shapeId); cnv.setId(shapeId); nvSpPr.addNewCNvCxnSpPr(); nvSpPr.addNewNvPr(); CTShapeProperties spPr = ct.addNewSpPr(); CTPresetGeometry2D prst = spPr.addNewPrstGeom(); prst.setPrst(STShapeType.LINE); prst.addNewAvLst(); /* CTLineProperties ln = */ spPr.addNewLn(); return ct; }
/** * * @param shapeId * 1-based shapeId */ static CTShape prototype(int shapeId) { CTShape ct = CTShape.Factory.newInstance(); CTShapeNonVisual nvSpPr = ct.addNewNvSpPr(); CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr(); cnv.setName("TextBox " + shapeId); cnv.setId(shapeId); nvSpPr.addNewCNvSpPr().setTxBox(true); nvSpPr.addNewNvPr(); CTShapeProperties spPr = ct.addNewSpPr(); CTPresetGeometry2D prst = spPr.addNewPrstGeom(); prst.setPrst(STShapeType.RECT); prst.addNewAvLst(); XDDFTextBody body = new XDDFTextBody(null); initTextBody(body); ct.setTxBody(body.getXmlObject()); return ct; } }
prstGeom.setPrst(STShapeType.RECT); prstGeom.addNewAvLst();
/** * @param shapeId 1-based shapeId * @param rel relationship to the picture data in the ooxml package */ static CTPicture prototype(int shapeId, String rel) { CTPicture ct = CTPicture.Factory.newInstance(); CTPictureNonVisual nvSpPr = ct.addNewNvPicPr(); CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr(); cnv.setName("Picture " + shapeId); cnv.setId(shapeId); nvSpPr.addNewCNvPicPr().addNewPicLocks().setNoChangeAspect(true); nvSpPr.addNewNvPr(); CTBlipFillProperties blipFill = ct.addNewBlipFill(); CTBlip blip = blipFill.addNewBlip(); blip.setEmbed(rel); blipFill.addNewStretch().addNewFillRect(); CTShapeProperties spPr = ct.addNewSpPr(); CTPresetGeometry2D prst = spPr.addNewPrstGeom(); prst.setPrst(STShapeType.RECT); prst.addNewAvLst(); return ct; }
geom.setPrst(STShapeType.RECT); geom.addNewAvLst();
geom.setPrst(STShapeType.RECT); geom.addNewAvLst();
prstGeom.setPrst(STShapeType.RECT); prstGeom.addNewAvLst();
xext.setCy(1270000); spPr.addNewPrstGeom().setPrst(STShapeType.RECT);
geom.setPrst(STShapeType.LINE); geom.addNewAvLst();
/** * Sets the shape types. * * @param type the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}. * @see org.apache.poi.ss.usermodel.ShapeTypes */ public void setShapeType(int type) { ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type)); }
/** * Sets the shape types. * * @param type the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}. * @see org.apache.poi.ss.usermodel.ShapeTypes */ public void setShapeType(int type) { ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type)); }
/** * Sets the shape types. * * @param type * the shape type, one of the constants defined in * {@link org.apache.poi.ss.usermodel.ShapeTypes}. * @see org.apache.poi.ss.usermodel.ShapeTypes */ public void setShapeType(int type) { ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type)); }
/** * Sets the shape types. * * @param type the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}. * @see org.apache.poi.ss.usermodel.ShapeTypes */ public void setShapeType(int type) { ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type)); }
/** * * @param type */ public void setShapeType(XSLFShapeType type){ CTShape shape = (CTShape) getXmlObject(); STShapeType.Enum geom = STShapeType.Enum.forInt(type.getIndex()); shape.getSpPr().getPrstGeom().setPrst(geom); }
@Override public void setShapeType(ShapeType type) { XSLFGeometryProperties gp = XSLFPropertiesDelegate.getGeometryDelegate(getShapeProperties()); if (gp == null) { return; } if (gp.isSetCustGeom()) { gp.unsetCustGeom(); } CTPresetGeometry2D prst = (gp.isSetPrstGeom()) ? gp.getPrstGeom() : gp.addNewPrstGeom(); prst.setPrst(STShapeType.Enum.forInt(type.ooxmlId)); }