private static int getSplitCount(JComponent component) {
   if (component.getComponentCount() > 0) {
     final JComponent firstChild = (JComponent) component.getComponent(0);
     if (firstChild instanceof Splitter) {
       final Splitter splitter = (Splitter) firstChild;
       return getSplitCount(splitter.getFirstComponent())
           + getSplitCount(splitter.getSecondComponent());
     }
     return 1;
   }
   return 0;
 }
  public boolean isToDrawMacCorner() {
    if (!SystemInfo.isMac || myComponent.getComponentCount() <= 0) {
      return false;
    }

    if (myComponent.getComponentCount() > 0) {
      Component component = myComponent.getComponent(0);
      if (component instanceof JComponent
          && Boolean.TRUE.equals(((JComponent) component).getClientProperty(SUPPRESS_MAC_CORNER))) {
        return false;
      }
    }

    return true;
  }