EList<Shape> children = container.getChildren();
ECollections.sort(children, new SiblingLaneComparator());
for (Shape s : children) {
Object bo = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
if (bo != null && (bo instanceof Lane || bo instanceof Participant) && !bo.equals(elem)) {
GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
service.setLocation(ga, 15, height);
height += ga.getHeight() - 1;
if (ga.getWidth() >= width) {
width = ga.getWidth();
} else {
service.setSize(ga, width, ga.getHeight());
}
}
}
GraphicsAlgorithm ga = container.getGraphicsAlgorithm();
if (height == 0) {
return new Dimension(ga.getWidth(), ga.getHeight());
} else {
int newWidth = width + 15;
int newHeight = height + 1;
service.setSize(ga, newWidth, newHeight);
for (Shape s : children) {
GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
if (childGa instanceof Text) {
s.getGraphicsAlgorithm().setHeight(newHeight);
} else if (childGa instanceof Polyline) {
Polyline line = (Polyline) childGa;
Point firstPoint = line.getPoints().get(0);