@Override
  public Dimension getPreferredSize(JComponent c) {
    int thickness = getThickness();
    Alignment alignment = Alignment.get(c);
    Dimension preferred = new Dimension(thickness, thickness);
    if (alignment == Alignment.LEFT || alignment == Alignment.RIGHT) {
      preferred.height += preferred.height;
      addPreferredHeight(preferred, ClientProperty.get(myScrollBar, LEADING));
      addPreferredHeight(preferred, ClientProperty.get(myScrollBar, TRAILING));
    }
    else {
      preferred.width += preferred.width;
      addPreferredWidth(preferred, ClientProperty.get(myScrollBar, LEADING));
      addPreferredWidth(preferred, ClientProperty.get(myScrollBar, TRAILING));
    }
    return preferred;
  }
@Override
  public Dimension getPreferredSize(JComponent c)