ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
Iterator<Shape> iterator = Graphiti.getPeService().getAllContainedShapes(containerShape).iterator();
while (iterator.hasNext()) {
Shape shape = iterator.next();
GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
IGaService gaService = Graphiti.getGaService();
int newWidth = parentGa.getWidth();
int newHeight = parentGa.getHeight();
String markerProperty = Graphiti.getPeService().getPropertyValue(shape,
GraphicsUtil.ACTIVITY_MARKER_CONTAINER);
if (markerProperty != null && new Boolean(markerProperty)) {
int x = (newWidth / 2) - (ga.getWidth() / 2);
int y = newHeight - ga.getHeight() - 3 - getMarkerContainerOffset();
gaService.setLocation(ga, x, y);
continue;
}
Shape rectShape = FeatureSupport.getShape(containerShape, "activity", Boolean.toString(true));
gaService.setSize(rectShape.getGraphicsAlgorithm(), newWidth, newHeight);
layoutInRectangle((RoundedRectangle) rectShape.getGraphicsAlgorithm());
Object[] objects = getAllBusinessObjectsForPictogramElement(shape);
for (Object bo : objects) {
layoutHook(shape, ga, bo, newWidth, newHeight);
}