In the examples, a new shape is added to a diagram using the following code:
long shapeId = page.addShape(x, y, width, height, masterName);
Shape shape = page.getShapes().getShape(shapeId);
// Set the new shape’s properties
Due to the organization of my code, I need to create a new shape object first then add it to the diagram second. For example:
Shape shape = new Shape();
// Set the new shape’s properties
page.addShape(shape);
Is is possible to do it this way? If so, can you provide an example?