void addPainter(@NotNull Painter painter, @Nullable Component component) {
    painters.add(painter);
    painterToComponent.put(painter, component == null ? rootComponent : component);
    painter.addListener(this);
  }
void addPainter(@NotNull Painter painter, @Nullable Component component)