afreechart/src/main/java/org/afree/chart/block/CenterArrangement.java
/**
     * Arranges the blocks with the overall width and height to fit within
     * specified ranges.
     * 
     * @param container
     *            the container.
     * @param canvas
     *            the graphics device.
     * @param constraint
     *            the constraint.
     * 
     * @return The size after the arrangement.
     */
Arranges the blocks with the overall width and height to fit within
specified ranges.

@param container
the container.
@param canvas
the graphics device.
@param constraint
the constraint.

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