@Override
  public Dimension preferredLayoutSize(Container parent) {
    return layoutSize(parent, myVertical, component -> component.getPreferredSize());
  }
@Override
  public Dimension preferredLayoutSize(Container parent)