Rectangle rect = gaService.createRectangle(containerShape);
StyleUtil.applyBGStyle(rect, this);
if (FeatureSupport.isTargetLane(context) || FeatureSupport.isTargetParticipant(context)) {
GraphicsAlgorithm ga = context.getTargetContainer().getGraphicsAlgorithm();
if (getNumberOfLanes(context) == 1) {
gaService.setLocationAndSize(rect, 15, 0, width - 15, height);
for (Shape s : getFlowNodeShapes(context, lane)) {
Graphiti.getPeService().sendToFront(s);
s.setContainer(containerShape);
}
} else {
if (context.getWidth() == -1 || context.getHeight() == -1) {
gaService.setLocationAndSize(rect, 15, ga.getWidth() - 1, ga.getHeight() - 15, height);
// gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);
} else {
ILayoutService layoutService = Graphiti.getLayoutService();
ILocation loc = layoutService.getLocationRelativeToDiagram(containerShape);
int x = context.getX() - loc.getX();
int y = context.getY() - loc.getY();
gaService.setLocationAndSize(rect, x - 15, y, ga.getWidth() - 15, height);
}
}
containerShape.setContainer(context.getTargetContainer());
} else {
gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);