/** * Arranges the blocks with the overall width and height to fit within * specified ranges. * * @param container the container. * @param constraint the constraint. * @param g2 the graphics device. * * @return The size after the arrangement. */ protected Size2D arrangeRR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { // first arrange without constraints, and see if this fits within // the required ranges... Size2D s1 = arrangeNN(container, g2); if (constraint.getWidthRange().contains(s1.width)) { return s1; // TODO: we didn't check the height yet } else { RectangleConstraint c = constraint.toFixedWidth( constraint.getWidthRange().getUpperBound() ); return arrangeFR(container, g2, c); } }
/** * Arranges the blocks with the overall width and height to fit within * specified ranges. * * @param container the container. * @param constraint the constraint. * @param g2 the graphics device. * * @return The size after the arrangement. */ protected Size2D arrangeRR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { // first arrange without constraints, and see if this fits within // the required ranges... Size2D s1 = arrangeNN(container, g2); if (constraint.getWidthRange().contains(s1.width)) { return s1; // TODO: we didn't check the height yet } else { RectangleConstraint c = constraint.toFixedWidth( constraint.getWidthRange().getUpperBound() ); return arrangeFR(container, g2, c); } }
return arrangeFR(container, g2, constraint);
return arrangeFR(container, g2, constraint);