@Override
  public Dimension preferredLayoutSize(Container container) {
    Component component = getComponent(container);
    return getSize(container, component != null ? component.getPreferredSize() : new Dimension());
  }
@Override
  public Dimension preferredLayoutSize(Container container)