int[] (final DimensionInfo info, final boolean min) { final int[] widths = new int[info.getCellCount()]; Arrays.fill(widths, myMinCellSize); // single spaned components for (int i = info.getComponentCount() - 1; i >= 0; i--) { if (info.getSpan(i) != 1) { continue; } int size = min ? getMin2(info, i) : Math.max(info.getMinimumWidth(i), info.getPreferredWidth(i)); int cell = info.getCell(i); final int gap = countGap(info, cell, info.getSpan(i)); size = Math.max(size - gap, 0); widths[cell] = Math.max(widths[cell], size); } // components inheriting layout from us updateSizesFromChildren(info, min, widths); // multispanned components final boolean[] toProcess = new boolean[info.getCellCount()]; for (int i = info.getComponentCount() - 1; i >= 0; i--) { int size = min ? getMin2(info, i) : Math.max(info.getMinimumWidth(i), info.getPreferredWidth(i)); final int span = info.getSpan(i); final int cell = info.getCell(i); final int gap = countGap(info, cell, span); size = Math.max(size - gap, 0); Arrays.fill(toProcess, false); int curSize = 0; for (int j=0; j < span; j++){ curSize += widths[j + cell]; toProcess[j + cell] = true; } if (curSize >= size) { continue; } final boolean[] higherPriorityCells = new boolean[toProcess.length]; getCellsWithHigherPriorities(info, toProcess, higherPriorityCells, false, widths); distribute(higherPriorityCells, info, size - curSize, widths); } return widths; }