Package org.eclipse.jgit.revplot
Class PlotCommitList<L extends PlotLane>
java.lang.Object
- Type Parameters:
L- type of lane used by the application.
- All Implemented Interfaces:
Iterable<PlotCommit<L>>,Collection<PlotCommit<L>>,List<PlotCommit<L>>
- Direct Known Subclasses:
SwingCommitList
An ordered list of
PlotCommit subclasses.
Commits are allocated into lanes as they enter the list, based upon their connections between descendant (child) commits and ancestor (parent) commits.
The source of the list must be a PlotWalk
and RevCommitList.fillTo(int) must be used to populate the list.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jgit.revwalk.RevObjectList
RevObjectList.Block -
Field Summary
FieldsModifier and TypeFieldDescriptionnumber of (child) commits on a lane(package private) static final intprivate intFields inherited from class org.eclipse.jgit.revwalk.RevObjectList
contents, sizeFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddBlockedPosition(BitSet blockedPositions, PlotCommit rObj) voidclear()private voidprivate voidcontinueActiveLanes(PlotCommit currCommit) protected LCreate a newPlotLaneappropriate for this particularPlotCommitList.private voiddrawLaneToChild(int commitIndex, PlotCommit child, PlotLane laneToContinue) Connects the commit at commitIndex to the child, using the given lane.protected voidenter(int index, PlotCommit<L> currCommit) Optional callback invoked when commits enter the list by fillTo.voidfindPassingThrough(PlotCommit<L> currCommit, Collection<L> result) Find the set of lanes passing through a commit's row.private intgetFreePosition(BitSet blockedPositions) private voidhandleBlockedLanes(int index, PlotCommit currCommit, PlotCommit childOnLane) Sets up fork and merge information in the involved PlotCommits.private PlotLanehandleMerge(int index, PlotCommit currCommit, PlotCommit childOnLane, PlotCommit child, PlotLane laneToUse) private PlotLaneprivate PlotLanenextFreeLane(BitSet blockedPositions) protected voidrecycleLane(L lane) Return colors and other reusable information to the plotter when a lane is no longer needed.private voidsetupChildren(PlotCommit<L> currCommit) voidSet the revision walker this list populates itself from.Methods inherited from class org.eclipse.jgit.revwalk.RevCommitList
applyFlag, applyFlag, clearFlag, clearFlag, fillTo, fillTo, indexOf, isPending, lastIndexOfMethods inherited from class org.eclipse.jgit.revwalk.RevObjectList
add, get, set, sizeMethods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
MAX_LENGTH
static final int MAX_LENGTH- See Also:
-
positionsAllocated
private int positionsAllocated -
freePositions
-
activeLanes
-
laneLength
number of (child) commits on a lane
-
-
Constructor Details
-
PlotCommitList
public PlotCommitList()
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceCollection<L extends PlotLane>- Specified by:
clearin interfaceList<L extends PlotLane>- Overrides:
clearin classRevCommitList<PlotCommit<L extends PlotLane>>
-
source
Set the revision walker this list populates itself from.- Overrides:
sourcein classRevCommitList<PlotCommit<L extends PlotLane>>- Parameters:
w- the walker to populate from.- See Also:
-
findPassingThrough
Find the set of lanes passing through a commit's row.Lanes passing through a commit are lanes that the commit is not directly on, but that need to travel through this commit to connect a descendant (child) commit to an ancestor (parent) commit. Typically these lanes will be drawn as lines in the passed commit's box, and the passed commit won't appear to be connected to those lines.
This method modifies the passed collection by adding the lanes in any order.
- Parameters:
currCommit- the commit the caller needs to get the lanes from.result- collection to add the passing lanes into.
-
enter
Optional callback invoked when commits enter the list by fillTo.This method is only called during
RevCommitList.fillTo(int).- Overrides:
enterin classRevCommitList<PlotCommit<L extends PlotLane>>- Parameters:
index- the list position this object will appear at.currCommit- the object being added (or set) into the list.
-
continueActiveLanes
-
handleBlockedLanes
Sets up fork and merge information in the involved PlotCommits. Recognizes and handles blockades that involve forking or merging arcs.- Parameters:
index- the index ofcurrCommitin the listcurrCommit-childOnLane- the direct child on the same lane ascurrCommit, may be null ifcurrCommitis the first commit on the lane
-
handleMerge
private PlotLane handleMerge(int index, PlotCommit currCommit, PlotCommit childOnLane, PlotCommit child, PlotLane laneToUse) -
drawLaneToChild
Connects the commit at commitIndex to the child, using the given lane. All blockades on the lane must be resolved before calling this method.- Parameters:
commitIndex-child-laneToContinue-
-
addBlockedPosition
-
closeLane
-
setupChildren
-
nextFreeLane
-
nextFreeLane
-
getFreePosition
- Parameters:
blockedPositions- may be null- Returns:
- a free lane position
-
createLane
Create a newPlotLaneappropriate for this particularPlotCommitList.- Returns:
- a new
PlotLaneappropriate for this particularPlotCommitList.
-
recycleLane
Return colors and other reusable information to the plotter when a lane is no longer needed.- Parameters:
lane- a lane
-