@Override
  public Dimension getPreferredSize(JComponent c) {
    Dimension size = super.getPreferredSize(c);
    if (size != null) updatePreferredSize(c, size);
    return size;
  }
@Override
  public Dimension getPreferredSize(JComponent c)