afreechart/src/main/java/org/afree/chart/block/BorderArrangement.java
/**
     * Performs an arrangement without constraints.
     * 
     * @param container
     *            the container.
     * @param canvas
     *            the graphics device.
     * 
     * @return The container size after the arrangement.
     */
Performs an arrangement without constraints.

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

@return The container size after the arrangement.
Performs an arrangement without constraints . @param container the container . @param canvas the graphics device . @return The container size after the arrangement .
protected Size2D arrangeNN(BlockContainer container, Canvas canvas) {
        double[] w = new double[5];
        double[] h = new double[5];
        if (this.topBlock != null) {
            Size2D size = this.topBlock.arrange(canvas, RectangleConstraint.NONE);
            w[0] = size.width;
            h[0] = size.height;
        }
        if (this.bottomBlock != null) {
            Size2D size = this.bottomBlock
                    .arrange(canvas, RectangleConstraint.NONE);
            w[1] = size.width;
            h[1] = size.height;
        }
        if (this.leftBlock != null) {
            Size2D size = this.leftBlock.arrange(canvas, RectangleConstraint.NONE);
            w[2] = size.width;
            h[2] = size.height;
        }
        if (this.rightBlock != null) {
            Size2D size = this.rightBlock.arrange(canvas, RectangleConstraint.NONE);
            w[3] = size.width;
            h[3] = size.height;
        }
        h[2] = Math.max(h[2], h[3]);
        h[3] = h[2];
        if (this.centerBlock != null) {
            Size2D size = this.centerBlock
                    .arrange(canvas, RectangleConstraint.NONE);
            w[4] = size.width;
            h[4] = size.height;
        }
        double width = Math.max(w[0], Math.max(w[1], w[2] + w[4] + w[3]));
        double centerHeight = Math.max(h[2], Math.max(h[3], h[4]));
        double height = h[0] + h[1] + centerHeight;
        if (this.topBlock != null) {
            this.topBlock.setBounds(new RectShape(0.0, 0.0, width,
                    h[0]));
        }
        if (this.bottomBlock != null) {
            this.bottomBlock.setBounds(new RectShape(0.0, height
                    - h[1], width, h[1]));
        }
        if (this.leftBlock != null) {
            this.leftBlock.setBounds(new RectShape(0.0, h[0], w[2],
                    centerHeight));
        }
        if (this.rightBlock != null) {
            this.rightBlock.setBounds(new RectShape(width - w[3],
                    h[0], w[3], centerHeight));
        }
        if (this.centerBlock != null) {
            this.centerBlock.setBounds(new RectShape(w[2], h[0], width
                    - w[2] - w[3], centerHeight));
        }
        return new Size2D(width, height);
    }
protected Size2D arrangeNN ( BlockContainer container , Canvas canvas ) { double [ ] w = new double [ 5 ] ; double [ ] h = new double [ 5 ] ; if ( this . topBlock != null ) { Size2D size = this . topBlock . arrange ( canvas , RectangleConstraint . NONE ) ; w [ 0 ] = size . width ; h [ 0 ] = size . height ; } if ( this . bottomBlock != null ) { Size2D size = this . bottomBlock . arrange ( canvas , RectangleConstraint . NONE ) ; w [ 1 ] = size . width ; h [ 1 ] = size . height ; } if ( this . leftBlock != null ) { Size2D size = this . leftBlock . arrange ( canvas , RectangleConstraint . NONE ) ; w [ 2 ] = size . width ; h [ 2 ] = size . height ; } if ( this . rightBlock != null ) { Size2D size = this . rightBlock . arrange ( canvas , RectangleConstraint . NONE ) ; w [ 3 ] = size . width ; h [ 3 ] = size . height ; } h [ 2 ] = Math . max ( h [ 2 ] , h [ 3 ] ) ; h [ 3 ] = h [ 2 ] ; if ( this . centerBlock != null ) { Size2D size = this . centerBlock . arrange ( canvas , RectangleConstraint . NONE ) ; w [ 4 ] = size . width ; h [ 4 ] = size . height ; } double width = Math . max ( w [ 0 ] , Math . max ( w [ 1 ] , w [ 2 ] + w [ 4 ] + w [ 3 ] ) ) ; double centerHeight = Math . max ( h [ 2 ] , Math . max ( h [ 3 ] , h [ 4 ] ) ) ; double height = h [ 0 ] + h [ 1 ] + centerHeight ; if ( this . topBlock != null ) { this . topBlock . setBounds ( new RectShape ( 0.0 , 0.0 , width , h [ 0 ] ) ) ; } if ( this . bottomBlock != null ) { this . bottomBlock . setBounds ( new RectShape ( 0.0 , height - h [ 1 ] , width , h [ 1 ] ) ) ; } if ( this . leftBlock != null ) { this . leftBlock . setBounds ( new RectShape ( 0.0 , h [ 0 ] , w [ 2 ] , centerHeight ) ) ; } if ( this . rightBlock != null ) { this . rightBlock . setBounds ( new RectShape ( width - w [ 3 ] , h [ 0 ] , w [ 3 ] , centerHeight ) ) ; } if ( this . centerBlock != null ) { this . centerBlock . setBounds ( new RectShape ( w [ 2 ] , h [ 0 ] , width - w [ 2 ] - w [ 3 ] , centerHeight ) ) ; } return new Size2D ( width , height ) ; }
Performs an arrangement without constraints.
Performs an arrangement without constraints .