[vcs-log] get rid of executeWithoutRepaint since we modify graph only in ui thread

This commit is contained in:
Julia Beliaeva
2015-02-02 16:45:52 +03:00
parent 68020482c3
commit 356f9bc8e3
2 changed files with 2 additions and 32 deletions
@@ -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<Integer> 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);
@@ -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<VcsLogHighlighter> 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<Change> getSelectedChanges() {
TableModel model = getModel();