@Override
    public Insets getBorderInsets(Component view, Insets insets) {
      if (insets == null) {
        insets = JBInsets.emptyInsets();
      }
      else {
        insets.set(0, 0, 0, 0);
      }
      if (myBorder != null) {
        Insets inner = myBorder.getBorderInsets(view);
        if (inner != null) insets.set(inner.top, inner.left, inner.bottom, inner.right);
      }
      if (view instanceof JComponent) {
        addViewInsets((JComponent)view, insets);
      }
      if (!myInsets.equals(insets)) {
        myInsets.set(insets.top, insets.left, insets.bottom, insets.right);
        if (view instanceof JComponent component) {
          if (component instanceof JTree tree) {
            TreeUtil.invalidateCacheAndRepaint(tree.getUI());
          }
          component.revalidate();
        }
        else {
          view.invalidate();
          view.repaint();
        }
      }
      return insets;
    }
@Override
    public Insets getBorderInsets(Component view, Insets insets)