blob: e4e9b87ad4e3af2649f6246c452db9e9a4656adb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.vcs.log.graph;
public interface GraphColorManager<CommitId> {
/**
* Returns the color which should be used to draw the given branch.
* @param headCommit branch head commit index.
*/
int getColorOfBranch(CommitId headCommit);
/**
* Returns the color which should be used to draw a not-main fragment of a branch
* (e.g. there was master, then I've checked out a feature, made some commits and merged back to master - these my commits form such
* a fragment which is the same branch in terms of VCS, but is a separate branch in terms of graph,
* and therefore we may want to color it separately.
*
* @param headCommit commit of the branch head which the fragment belongs to.
* @param magicIndex some magic index identifying the fragment (we don't know which one - it is some Graph internal thing).
* @return the colorId which should be used to draw this fragment.
*/
int getColorOfFragment(CommitId headCommit, int magicIndex);
/**
* Returns 1, 0 or -1 if branch identified by commit {@code head1} is "more powerful", "equally powerful" or "less powerful"
* than the branch identified by commit {@code head2}.
* <p/>
* If branch1 is more powerful than branch2, it means that its color will be reused by the subgraph below the point when these branches
* were diverged.
*/
int compareHeads(CommitId head1, CommitId head2); // todo drop this
}
|