[vcs-log] rename getIndicatorVersion -> getIndicatorColor, getBackgroundVersion -> getBackgroundColor

This commit is contained in:
Julia Beliaeva
2015-08-27 17:54:14 +03:00
parent f3bf05a400
commit 4f9cf97d51
4 changed files with 9 additions and 9 deletions
@@ -54,25 +54,25 @@ public class VcsLogColorManagerImpl implements VcsLogColorManager {
}
@NotNull
public static JBColor getBackgroundVersion(@NotNull final Color rootColor) {
public static JBColor getBackgroundColor(@NotNull final Color baseRootColor) {
return new JBColor(new NotNullProducer<Color>() {
@NotNull
@Override
public Color produce() {
return ColorUtil.mix(rootColor, UIUtil.getTableBackground(), 0.75);
return ColorUtil.mix(baseRootColor, UIUtil.getTableBackground(), 0.75);
}
});
}
@NotNull
public static JBColor getIndicatorVersion(@NotNull final Color rootColor) {
if (Registry.is("vcs.log.square.labels")) return getBackgroundVersion(rootColor);
public static JBColor getIndicatorColor(@NotNull final Color baseRootColor) {
if (Registry.is("vcs.log.square.labels")) return getBackgroundColor(baseRootColor);
return new JBColor(new NotNullProducer<Color>() {
@NotNull
@Override
public Color produce() {
if (UIUtil.isUnderDarcula()) return rootColor;
return ColorUtil.darker(ColorUtil.softer(rootColor), 2);
if (UIUtil.isUnderDarcula()) return baseRootColor;
return ColorUtil.darker(ColorUtil.softer(baseRootColor), 2);
}
});
}
@@ -117,7 +117,7 @@ public class BranchesPanel extends JPanel {
for (RefGroup group : entry.getValue()) {
// it is assumed here that all refs in a single group belong to a single root
if (myRoots == null || myRoots.contains(root)) {
Color rootIndicatorColor = VcsLogColorManagerImpl.getIndicatorVersion(myUI.getColorManager().getRootColor(root));
Color rootIndicatorColor = VcsLogColorManagerImpl.getIndicatorColor(myUI.getColorManager().getRootColor(root));
Rectangle rectangle = myReferencePainter
.paintLabel(group.getName(), g, paddingX, (getHeight() - myReferencePainter.getHeight(this)) / 2 - VERTICAL_SPACE, group.getBgColor(),
rootIndicatorColor);
@@ -410,7 +410,7 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C
}
public static JBColor getRootBackgroundColor(@NotNull VirtualFile root, @NotNull VcsLogColorManager colorManager) {
return VcsLogColorManagerImpl.getBackgroundVersion(colorManager.getRootColor(root));
return VcsLogColorManagerImpl.getBackgroundColor(colorManager.getRootColor(root));
}
public void handleAnswer(@Nullable GraphAnswer<Integer> answer, boolean dataCouldChange, @Nullable Selection previousSelection) {
@@ -55,7 +55,7 @@ public class LabelPainters {
public void paintReference(@NotNull VcsRef reference, @NotNull Graphics g, int paddingX, int paddingY) {
myLabelPainter.paintLabel((Graphics2D)g, reference.getName(), paddingX, paddingY, reference.getType().getBackgroundColor(),
VcsLogColorManagerImpl.getIndicatorVersion(myColorManager.getRootColor(reference.getRoot())));
VcsLogColorManagerImpl.getIndicatorColor(myColorManager.getRootColor(reference.getRoot())));
}
public Rectangle paintLabel(@NotNull String text,