public Dimension preferredLayoutSize(final Container parent) {

        Component c0, c1, c2, c3, c4, c5;

        synchronized (parent.getTreeLock()) {
            final Insets insets = parent.getInsets();
            int componentIndex = 0;
            final int rowCount = this.rowHeights.length;
            for (int i = 0; i < this.columnWidths.length; i++) {
                this.columnWidths[i] = 0;
            }
            this.columns1and2Width = 0;
            this.columns4and5Width = 0;
            this.columns1to4Width = 0;
            this.columns1to5Width = 0;
            this.columns0to5Width = 0;

            this.totalHeight = 0;
            for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
            final int format 
                = this.rowFormats[rowIndex % this.rowFormats.length];
                switch (format) {
                    case FormatLayout.C:
                        c0 = parent.getComponent(componentIndex);
                        updateC(rowIndex, c0.getPreferredSize());
                        componentIndex = componentIndex + 1;
                        break;
                    case FormatLayout.LC:
                        c0 = parent.getComponent(componentIndex);
                        c1 = parent.getComponent(componentIndex + 1);
                        updateLC(rowIndex, c0.getPreferredSize(), 
                                c1.getPreferredSize());
                        componentIndex = componentIndex + 2;
                        break;
                    case FormatLayout.LCB:
                        c0 = parent.getComponent(componentIndex);
                        c1 = parent.getComponent(componentIndex + 1);
                        c2 = parent.getComponent(componentIndex + 2);
                        updateLCB(rowIndex,
                                  c0.getPreferredSize(),
                                  c1.getPreferredSize(),
                                  c2.getPreferredSize());
                        componentIndex = componentIndex + 3;
                        break;
                    case FormatLayout.LCLC:
                        c0 = parent.getComponent(componentIndex);
                        c1 = parent.getComponent(componentIndex + 1);
                        c2 = parent.getComponent(componentIndex + 2);
                        c3 = parent.getComponent(componentIndex + 3);
                        updateLCLC(rowIndex,
                                   c0.getPreferredSize(),
                                   c1.getPreferredSize(),
                                   c2.getPreferredSize(),
                                   c3.getPreferredSize());
                        componentIndex = componentIndex + 4;
                        break;
                    case FormatLayout.LCBLC:
                        c0 = parent.getComponent(componentIndex);
                        c1 = parent.getComponent(componentIndex + 1);
                        c2 = parent.getComponent(componentIndex + 2);
                        c3 = parent.getComponent(componentIndex + 3);
                        c4 = parent.getComponent(componentIndex + 4);
                        updateLCBLC(rowIndex,
                                    c0.getPreferredSize(),
                                    c1.getPreferredSize(),
                                    c2.getPreferredSize(),
                                    c3.getPreferredSize(),
                                    c4.getPreferredSize());
                        componentIndex = componentIndex + 5;
                        break;
                    case FormatLayout.LCLCB:
                        c0 = parent.getComponent(componentIndex);
                        c1 = parent.getComponent(componentIndex + 1);
                        c2 = parent.getComponent(componentIndex + 2);
                        c3 = parent.getComponent(componentIndex + 3);
                        c4 = parent.getComponent(componentIndex + 4);
                        updateLCLCB(rowIndex,
                                    c0.getPreferredSize(),
                                    c1.getPreferredSize(),
                                    c2.getPreferredSize(),
                                    c3.getPreferredSize(),
                                    c4.getPreferredSize());
                        componentIndex = componentIndex + 5;
                        break;
                    case FormatLayout.LCBLCB:
                        c0 = parent.getComponent(componentIndex);
                        c1 = parent.getComponent(componentIndex + 1);
                        c2 = parent.getComponent(componentIndex + 2);
                        c3 = parent.getComponent(componentIndex + 3);
                        c4 = parent.getComponent(componentIndex + 4);
                        c5 = parent.getComponent(componentIndex + 5);
                        updateLCBLCB(rowIndex,
                                     c0.getPreferredSize(),
                                     c1.getPreferredSize(),
                                     c2.getPreferredSize(),
                                     c3.getPreferredSize(),
                                     c4.getPreferredSize(),
                                     c5.getPreferredSize());
                        componentIndex = componentIndex + 6;
                        break;
                }
            }
            complete();
            return new Dimension(this.totalWidth + insets.left + insets.right,
                    this.totalHeight + (rowCount - 1) * this.rowGap
                                 + insets.top + insets.bottom);
        }
    }