0.0, hh), LengthConstraintType.RANGE);
Object retValue = null;
final BlockParams p = new BlockParams();
p.setGenerateEntities(entities);
if (position == RectangleEdge.TOP) {
final Size2D size = t.arrange(g2, constraint);
titleArea = this.createAlignedRectangle2D(size, area, t
.getHorizontalAlignment(), VerticalAlignment.TOP);
retValue = t.draw(g2, titleArea, p);
RectangleUtil.setRect(area, area.x, (int) Math.min(area.y
+ size.height, RectangleUtil.getMaxY(area)), area.width,
(int) Math.max(area.height - size.height, 0));
} else if (position == RectangleEdge.BOTTOM) {
final Size2D size = t.arrange(g2, constraint);
titleArea = this.createAlignedRectangle2D(size, area, t
.getHorizontalAlignment(), VerticalAlignment.BOTTOM);
retValue = t.draw(g2, titleArea, p);
RectangleUtil.setRect(area, area.x, area.y, area.width,
(int) (area.height - size.height));
} else if (position == RectangleEdge.RIGHT) {
final Size2D size = t.arrange(g2, constraint);
titleArea = this.createAlignedRectangle2D(size, area,
HorizontalAlignment.RIGHT, t.getVerticalAlignment());
retValue = t.draw(g2, titleArea, p);
RectangleUtil.setRect(area, area.x, area.y,
area.width - size.width, area.height);
}
else if (position == RectangleEdge.LEFT) {
final Size2D size = t.arrange(g2, constraint);
titleArea = this.createAlignedRectangle2D(size, area,
HorizontalAlignment.LEFT, t.getVerticalAlignment());
retValue = t.draw(g2, titleArea, p);
RectangleUtil.setRect(area, area.x + size.width, area.y, area.width
- size.width, area.height);