return bo instanceof TextAnnotation;
}
@Override
public boolean layout(ILayoutContext context) {
final ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
final GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
final IGaService gaService = Graphiti.getGaService();
boolean changed = false;
if (ga.getWidth() < 100) {
// we deny anything smaller than 100 pixels width
ga.setWidth(100);
changed = true;
}
if (ga.getHeight() < 50) {
// we deny anything smaller than 50 pixels height
ga.setHeight(50);
changed = true;
}
int containerWidth = ga.getWidth();
int containerHeight = ga.getHeight();
for (final Shape shape : containerShape.getChildren()) {
final GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
final IDimension size = gaService.calculateSize(shapeGa);
if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
gaService.setWidth(shapeGa, containerWidth - 5);