private static @NotNull Control.Painter getPainter(@NotNull JTree tree) {
    Control.Painter painter = ClientProperty.get(tree, Control.Painter.KEY);
    if (painter != null) {
      return painter;
    }
    // painter is not specified for the given tree
    Application application = getApplication();
    if (application != null) {
      painter = application.getUserData(Control.Painter.KEY);
      if (painter != null) return painter;
      // painter is not specified for the whole application
    }
    UISettings settings = UISettings.getInstanceOrNull();
    if (settings != null && settings.getCompactTreeIndents()) return Control.Painter.COMPACT;
    if (is("ide.tree.painter.classic.compact")) return Control.Painter.COMPACT;
    if (is("ide.tree.painter.compact.default")) return CompactPainter.DEFAULT;
    return Control.Painter.DEFAULT;
  }
private static @NotNull Control.Painter getPainter(@NotNull JTree tree)