@Override
  public Dimension getPreferredSize() {
    Dimension size = super.getPreferredSize();
    if (myHorizontalSizeReferent != null && myHorizontalSizeReferent.isShowing()) {
      size.width = Math.max(size.width, myHorizontalSizeReferent.getPreferredSize().width);
    }
    if (myVerticalSizeReferent != null && myVerticalSizeReferent.isShowing()) {
      size.height = Math.max(size.height, myVerticalSizeReferent.getPreferredSize().height);
    }
    return size;
  }
@Override
  public Dimension getPreferredSize()