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