public Insets getBorderInsets(Component c) {
    if (c instanceof JComponent && ((JComponent) c).getComponentCount() == 0)
      return new Insets(0, 0, 0, 0);

    Direction orientation = getTabAreaDirection(c);

    return orientation != null ? new Insets(drawTop(orientation) ? 1 : 0,
                                            drawLeft(orientation) ? 1 : 0,
                                            drawBottom(orientation) ? 1 : 0,
                                            drawRight(orientation) ? 1 : 0) :
           new Insets(0, 0, 0, 0);
  }