本文整理汇总了Java中org.eclipse.jgit.revplot.PlotLane类的典型用法代码示例。如果您正苦于以下问题:Java PlotLane类的具体用法?Java PlotLane怎么用?Java PlotLane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlotLane类属于org.eclipse.jgit.revplot包,在下文中一共展示了PlotLane类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNewCommits
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
/**
* Helper method that returns commits between the given old branch heads and new branch heads
*
* @param oldBranches previous locations of branch heads
* @param newBranches current locations of branch heads
* @return a list of all commits found between oldBranches and newBranches
* @throws GitAPIException
* @throws IOException
*/
private List<CommitHelper> getNewCommits(Map<String, BranchHelper> oldBranches, List<? extends BranchHelper> newBranches) throws GitAPIException, IOException {
List<ObjectId> startPoints = new ArrayList<>();
List<ObjectId> stopPoints = new ArrayList<>();
for (BranchHelper newBranch : newBranches) {
if (oldBranches.containsKey(newBranch.getRefName())) {
ObjectId newBranchHeadID = newBranch.getHeadId();
ObjectId oldBranchHeadID = oldBranches.get(newBranch.getRefName()).getHeadId();
if (!newBranchHeadID.equals(oldBranchHeadID)) {
startPoints.add(newBranchHeadID);
}
stopPoints.add(oldBranchHeadID);
} else {
startPoints.add(newBranch.getHeadId());
}
}
PlotCommitList<PlotLane> newCommits = this.parseRawCommits(startPoints, stopPoints);
return wrapRawCommits(newCommits);
}
开发者ID:dmusican,项目名称:Elegit,代码行数:29,代码来源:RepoHelper.java
示例2: parseAllRawLocalCommits
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
/**
* Utilizes JGit to walk through the repo and create raw commit objects - more
* specifically, JGit objects of (super)type RevCommit. This is an expensive
* operation and should only be called when necessary
*
* @return a list of raw local commits
* @throws IOException
*/
private PlotCommitList<PlotLane> parseAllRawLocalCommits() throws IOException, GitAPIException {
ObjectId headId = repo.resolve("HEAD");
if (headId == null) return new PlotCommitList<>();
List<ObjectId> examinedCommitIDs = new ArrayList<>();
PlotCommitList<PlotLane> rawLocalCommits = parseRawCommits(headId, examinedCommitIDs);
examinedCommitIDs.add(headId);
List<LocalBranchHelper> branches = this.branchModel.getLocalBranchesTyped();
for (BranchHelper branch : branches) {
ObjectId branchId = branch.getHeadId();
PlotCommitList<PlotLane> toAdd = parseRawCommits(branchId, examinedCommitIDs);
if (toAdd.size() > 0) {
rawLocalCommits.addAll(toAdd);
examinedCommitIDs.add(toAdd.get(0).getId());
}
}
return rawLocalCommits;
}
开发者ID:dmusican,项目名称:Elegit,代码行数:27,代码来源:RepoHelper.java
示例3: parseRawCommits
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
/**
* Utilizes JGit to walk through the repo and create raw commit objects - more
* specifically, JGit objects of (super)type RevCommit. This is an expensive
* operation and should only be called when necessary
*
* @param startPoints the starting ids to parse from
* @param stopPoints the ids at which parsing should stop
* @return a list of raw commits starting from each id in startPoints, excluding those beyond each id in stopPoints
* @throws IOException
*/
private PlotCommitList<PlotLane> parseRawCommits(List<ObjectId> startPoints, List<ObjectId> stopPoints) throws IOException {
PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<>();
PlotWalk w = new PlotWalk(repo);
for (ObjectId stopId : stopPoints) {
w.markUninteresting(w.parseCommit(stopId));
}
for (ObjectId startId : startPoints) {
w.markStart(w.parseCommit(startId));
PlotCommitList<PlotLane> temp = new PlotCommitList<>();
temp.source(w);
temp.fillTo(Integer.MAX_VALUE);
plotCommitList.addAll(temp);
}
w.dispose();
return plotCommitList;
}
开发者ID:dmusican,项目名称:Elegit,代码行数:33,代码来源:RepoHelper.java
示例4: addButtonsFor
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
private void addButtonsFor(PlotCommit<PlotLane> commit, final Relation relation) {
ViewGroup buttonGroup = buttonGroups.get(relation);
buttonGroup.removeAllViews();
View.OnClickListener clickListener = new View.OnClickListener() {
@SuppressWarnings("unchecked")
public void onClick(View v) {
commitSelectedListener.onCommitSelected(relation, (PlotCommit<PlotLane>) v.getTag());
}
};
for (PlotCommit<PlotLane> relatedCommit : relation.relationsOf(commit)) {
Button button = (Button) layoutInflater.inflate(R.layout.related_commit_button, buttonGroup, false);
button.setTag(relatedCommit);
String abbrId = relatedCommit.getName().substring(0, 4);
String buttonText = (relation == PARENT) ? ("« " + abbrId) : (abbrId + " »");
button.setText(buttonText);
button.setOnClickListener(clickListener);
buttonGroup.addView(button);
}
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:21,代码来源:CommitNavigationView.java
示例5: main
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
try (Repository repository = CookbookHelper.openJGitCookbookRepository()) {
try (PlotWalk revWalk = new PlotWalk(repository)) {
ObjectId rootId = repository.resolve("refs/heads/master");
RevCommit root = revWalk.parseCommit(rootId);
revWalk.markStart(root);
PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<>();
plotCommitList.source(revWalk);
plotCommitList.fillTo(Integer.MAX_VALUE);
System.out.println("Printing children of commit " + root);
for (RevCommit com : revWalk) {
System.out.println("Child: " + com);
}
System.out.println("Printing with next()");
System.out.println("next: " + revWalk.next());
}
}
}
开发者ID:centic9,项目名称:jgit-cookbook,代码行数:21,代码来源:ListChildrenOfCommit.java
示例6: getCommitsByTree
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public PlotCommitList<PlotLane> getCommitsByTree(final String treeName) throws Exception {
try (PlotWalk revWalk = new PlotWalk(repository)) {
final ObjectId rootId = repository.resolve(treeName);
final RevCommit root = revWalk.parseCommit(rootId);
revWalk.markStart(root);
final PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<>();
plotCommitList.source(revWalk);
plotCommitList.fillTo(Integer.MAX_VALUE);
revWalk.dispose();
return plotCommitList;
}
}
开发者ID:iazarny,项目名称:gitember,代码行数:14,代码来源:GitRepositoryService.java
示例7: laneColor
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
@Override
protected Object laneColor(PlotLane myLane) {
if (plotLaneColorHashMap.get(myLane) == null) {
plotLaneColorHashMap.put(
myLane,
colors[ (1 + plotLaneColorHashMap.size()) % colors.length ]
);
}
return plotLaneColorHashMap.get(myLane);
}
开发者ID:iazarny,项目名称:gitember,代码行数:11,代码来源:PlotCommitRenderer.java
示例8: parseAllRawRemoteCommits
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
/**
* Utilizes JGit to walk through the repo and create raw commit objects - more
* specifically, JGit objects of (super)type RevCommit. This is an expensive
* operation and should only be called when necessary
*
* @return a list of raw remote commits
* @throws IOException
*/
private PlotCommitList<PlotLane> parseAllRawRemoteCommits() throws IOException, GitAPIException {
List<ObjectId> examinedCommitIDs = new ArrayList<>();
PlotCommitList<PlotLane> rawRemoteCommits = new PlotCommitList<>();
for (BranchHelper branch : this.branchModel.getRemoteBranchesTyped()) {
ObjectId branchId = branch.getHeadId();
PlotCommitList<PlotLane> toAdd = parseRawCommits(branchId, examinedCommitIDs);
if (toAdd.size() > 0) {
rawRemoteCommits.addAll(toAdd);
examinedCommitIDs.add(toAdd.get(0).getId());
}
}
return rawRemoteCommits;
}
开发者ID:dmusican,项目名称:Elegit,代码行数:23,代码来源:RepoHelper.java
示例9: setCommit
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public void setCommit(final PlotCommit<PlotLane> c) throws IOException {
this.commit = c;
CommitViewerActivity commitViewerActivity = (CommitViewerActivity) getContext();
pager.setAdapter(new CommitPagerAdapter(commitViewerActivity.getSupportFragmentManager(), repository, c));
tabPageIndicator.setViewPager(pager);
tabPageIndicator.notifyDataSetChanged();
Log.d(TAG, "setCommit : " + commit);
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:10,代码来源:CommitView.java
示例10: onCreateView
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
try {
Repository repository = FileRepositoryBuilder.create(gitDirFrom(getArguments()));
ObjectId commitId = revisionIdFrom(repository, getArguments(), REVISION);
Log.d(TAG, "onCreateView with "+commitId);
View v=inflater.inflate(R.layout.commit_detail_view, container, false);
CommitNavigationView commitNavigationView = (CommitNavigationView) v.findViewById(R.id.commit_navigation);
commitNavigationView.setCommitSelectedListener(commitSelectedListener);
PlotCommit<PlotLane> commit = commitSelectedListener.plotCommitFor(commitId);
commitNavigationView.setCommit(commit);
((ObjectIdView) v.findViewById(R.id.commit_id)).setObjectId(commit);
ViewGroup vg = (ViewGroup) v.findViewById(R.id.commit_people_group);
PersonIdent author = commit.getAuthorIdent(), committer = commit.getCommitterIdent();
if (author.equals(committer)) {
addPerson("Author & Committer", author, vg);
} else {
addPerson("Author", author, vg);
addPerson("Committer", committer, vg);
}
TextView textView = (TextView) v.findViewById(R.id.commit_message_text);
textView.setText(commit.getFullMessage());
return v;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:36,代码来源:CommitDetailsFragment.java
示例11: moveToCommit
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public void moveToCommit(PlotCommit<PlotLane> newCommit, Relation relation) {
setCurrentCommit(newCommit);
try {
nextCommitView.setCommit(newCommit);
} catch (Exception e) {
throw new RuntimeException(e);
}
relationAnimations.get(relation).animateViews();
swapCommitViewVars();
setCurrentCommitViewVisible();
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:13,代码来源:CommitViewerActivity.java
示例12: generatePlotWalk
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
private PlotWalk generatePlotWalk() throws IOException {
Stopwatch stopwatch = new Stopwatch().start();
PlotWalk revWalk = new PlotWalk(repo());
logStartProvider.markStartsOn(revWalk);
PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<PlotLane>();
plotCommitList.source(revWalk);
plotCommitList.fillTo(Integer.MAX_VALUE);
Log.d(TAG, "generatePlotWalk duration" + stopwatch.stop());
return revWalk;
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:12,代码来源:CommitViewerActivity.java
示例13: GitPlotRenderer
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public GitPlotRenderer(PlotCommitList<PlotLane> commitList) {
// Plot to create
plot = new GPlot();
// List of commit IDs
commits = new ArrayList<>();
// Loops over the commits
rowIndex = 0;
for (PlotCommit<PlotLane> commit : commitList) {
commits.add(commit);
currentCommit = commit;
paintCommit(commit, rowHeight);
rowIndex++;
}
}
开发者ID:nemerosa,项目名称:ontrack,代码行数:15,代码来源:GitPlotRenderer.java
示例14: laneColor
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
@Override
protected GColor laneColor(PlotLane myLane) {
if (myLane == null) {
return new GColor(0);
} else {
return new GColor(myLane.getPosition());
}
}
开发者ID:nemerosa,项目名称:ontrack,代码行数:9,代码来源:GitPlotRenderer.java
示例15: graph
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
@Override
public GitLog graph(String from, String to) {
try {
GitRange range = range(from, to, false);
PlotWalk walk = new PlotWalk(git.getRepository());
// Log
walk.markStart(walk.lookupCommit(range.getFrom().getId()));
walk.markUninteresting(walk.lookupCommit(range.getTo().getId()));
PlotCommitList<PlotLane> commitList = new PlotCommitList<>();
commitList.source(walk);
commitList.fillTo(Integer.MAX_VALUE);
// Rendering
GitPlotRenderer renderer = new GitPlotRenderer(commitList);
GPlot plot = renderer.getPlot();
// Gets the commits
List<GitCommit> commits = Lists.transform(
renderer.getCommits(),
this::toCommit
);
// OK
return new GitLog(
plot,
commits
);
} catch (IOException e) {
throw new GitRepositoryIOException(repository.getRemote(), e);
}
}
开发者ID:nemerosa,项目名称:ontrack,代码行数:34,代码来源:GitRepositoryClientImpl.java
示例16: calculateLineColumnWidth
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
private int calculateLineColumnWidth(PlotCommitList<PlotLane> plotCommits) {
return 36 + 12 * plotCommits.stream().mapToInt(p -> p.getLane().getPosition()).max().orElse(0);
}
开发者ID:iazarny,项目名称:gitember,代码行数:4,代码来源:BranchViewController.java
示例17: laneColor
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
@Override
protected Object laneColor(PlotLane myLane) {
return null;
}
开发者ID:iazarny,项目名称:gitember,代码行数:5,代码来源:HistoryPlotRenderer.java
示例18: CommitPagerAdapter
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public CommitPagerAdapter(FragmentManager fm, Repository repository, PlotCommit<PlotLane> c) {
super(fm);
this.repository = repository;
this.commit = c;
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:6,代码来源:CommitView.java
示例19: setCommit
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
public void setCommit(PlotCommit<PlotLane> commit) {
addButtonsFor(commit, PARENT);
addButtonsFor(commit, CHILD);
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:5,代码来源:CommitNavigationView.java
示例20: onCommitSelected
import org.eclipse.jgit.revplot.PlotLane; //导入依赖的package包/类
@Override
public void onCommitSelected(Relation relation, PlotCommit<PlotLane> commit) {
moveToCommit(commit, relation);
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:5,代码来源:CommitViewerActivity.java
注:本文中的org.eclipse.jgit.revplot.PlotLane类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论