void (@NotNull List<? extends Rectangle> bounds) { final int componentCount = getComponentCount(); LOG.assertTrue(componentCount <= bounds.size()); final int width = getWidth(); final int height = getHeight(); final Insets insets = getInsets(); if (myAdjustTheSameSize) { final int maxWidth = getMaxButtonWidth(); final int maxHeight = getMaxButtonHeight(); int offset = 0; if (myOrientation == SwingConstants.HORIZONTAL) { for (int i = 0; i < componentCount; i++) { final Rectangle r = bounds.get(i); r.setBounds(insets.left + offset, insets.top + (height - maxHeight) / 2, maxWidth, maxHeight); offset += maxWidth; } } else { for (int i = 0; i < componentCount; i++) { final Rectangle r = bounds.get(i); r.setBounds(insets.left + (width - maxWidth) / 2, insets.top + offset, maxWidth, maxHeight); offset += maxHeight; } } } else { if (myOrientation == SwingConstants.HORIZONTAL) { final int maxHeight = getMaxButtonHeight(); int offset = 0; for (int i = 0; i < componentCount; i++) { final Dimension d = getChildPreferredSize(i); final Rectangle r = bounds.get(i); r.setBounds(insets.left + offset, insets.top + (maxHeight - d.height) / 2, d.width, d.height); offset += d.width; } } else { final int maxWidth = getMaxButtonWidth(); int offset = 0; for (int i = 0; i < componentCount; i++) { final Dimension d = getChildPreferredSize(i); final Rectangle r = bounds.get(i); r.setBounds(insets.left + (maxWidth - d.width) / 2, insets.top + offset, d.width, d.height); offset += d.height; } } } }