From 356f9bc8e341e2267bb2dde1206ea38ef962f377 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Wed, 28 Jan 2015 11:14:12 +0300 Subject: [PATCH] [vcs-log] get rid of executeWithoutRepaint since we modify graph only in ui thread --- .../com/intellij/vcs/log/ui/VcsLogUiImpl.java | 12 ++-------- .../vcs/log/ui/frame/VcsLogGraphTable.java | 22 ------------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java index e0afa1578af8..2de95e641c77 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java @@ -145,7 +145,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable { } private void performLongAction(@NotNull final GraphAction graphAction, @NotNull String title) { - runUnderModalProgress(title, new Runnable() { + ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() { @Override public void run() { final GraphAnswer answer = myVisiblePack.getVisibleGraph().getActionController().performAction(graphAction); @@ -159,7 +159,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable { } }); } - }); + }, title, false, null, getMainFrame().getMainComponent()); } public void showAll() { @@ -364,14 +364,6 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable { return myProject; } - public void runUnderModalProgress(@NotNull final String task, @NotNull final Runnable runnable) { - getTable().executeWithoutRepaint(new Runnable() { - public void run() { - ProgressManager.getInstance().runProcessWithProgressSynchronously(runnable, task, false, null, getMainFrame().getMainComponent()); - } - }); - } - @Override public void setBranchesPanelVisible(boolean visible) { myMainFrame.setBranchesPanelVisible(visible); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java index dec8a97834fa..933fe986b943 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java @@ -87,7 +87,6 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C private final GraphCommitCellRender myGraphCommitCellRender; private boolean myColumnsSizeInitialized = false; - private final AtomicInteger myRepaintFreezedCounter = new AtomicInteger(); @NotNull private final Collection myHighlighters = ContainerUtil.newArrayList(); @@ -234,27 +233,6 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C } } - @Override - protected void paintComponent(@NotNull Graphics g) { - if (myRepaintFreezedCounter.get() > 0) { - return; - } - super.paintComponent(g); - } - - /** - * Freeze repaint to avoid repainting during changing the Graph. - */ - public void executeWithoutRepaint(@NotNull Runnable action) { - myRepaintFreezedCounter.incrementAndGet(); - try { - action.run(); - } - finally { - myRepaintFreezedCounter.decrementAndGet(); - } - } - @Nullable public List getSelectedChanges() { TableModel model = getModel();