L
- type of lane used by the application.public class PlotCommitList<L extends PlotLane> extends RevCommitList<PlotCommit<L>>
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.
RevObjectList.Block
Modifier and Type | Field and Description |
---|---|
private java.util.HashSet<PlotLane> |
activeLanes |
private java.util.TreeSet<java.lang.Integer> |
freePositions |
private java.util.HashMap<PlotLane,java.lang.Integer> |
laneLength
number of (child) commits on a lane
|
(package private) static int |
MAX_LENGTH |
private int |
positionsAllocated |
contents, size
Constructor and Description |
---|
PlotCommitList() |
Modifier and Type | Method and Description |
---|---|
private static void |
addBlockedPosition(java.util.BitSet blockedPositions,
PlotCommit rObj) |
void |
clear() |
private void |
closeLane(PlotLane lane) |
private void |
continueActiveLanes(PlotCommit currCommit) |
protected L |
createLane()
Create a new
PlotLane appropriate for this particular
PlotCommitList . |
private void |
drawLaneToChild(int commitIndex,
PlotCommit child,
PlotLane laneToContinue)
Connects the commit at commitIndex to the child, using the given lane.
|
protected void |
enter(int index,
PlotCommit<L> currCommit)
Optional callback invoked when commits enter the list by fillTo.
|
void |
findPassingThrough(PlotCommit<L> currCommit,
java.util.Collection<L> result)
Find the set of lanes passing through a commit's row.
|
private int |
getFreePosition(java.util.BitSet blockedPositions) |
private void |
handleBlockedLanes(int index,
PlotCommit currCommit,
PlotCommit childOnLane)
Sets up fork and merge information in the involved PlotCommits.
|
private PlotLane |
handleMerge(int index,
PlotCommit currCommit,
PlotCommit childOnLane,
PlotCommit child,
PlotLane laneToUse) |
private PlotLane |
nextFreeLane() |
private PlotLane |
nextFreeLane(java.util.BitSet blockedPositions) |
protected void |
recycleLane(L lane)
Return colors and other reusable information to the plotter when a lane
is no longer needed.
|
private void |
setupChildren(PlotCommit<L> currCommit) |
void |
source(RevWalk w)
Set the revision walker this list populates itself from.
|
applyFlag, applyFlag, clearFlag, clearFlag, fillTo, fillTo, indexOf, isPending, lastIndexOf
add, get, set, size
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
static final int MAX_LENGTH
private int positionsAllocated
private final java.util.TreeSet<java.lang.Integer> freePositions
private final java.util.HashSet<PlotLane> activeLanes
private final java.util.HashMap<PlotLane,java.lang.Integer> laneLength
public void clear()
clear
in interface java.util.Collection<PlotCommit<L extends PlotLane>>
clear
in interface java.util.List<PlotCommit<L extends PlotLane>>
clear
in class RevCommitList<PlotCommit<L extends PlotLane>>
public void source(RevWalk w)
source
in class RevCommitList<PlotCommit<L extends PlotLane>>
w
- the walker to populate from.RevCommitList.fillTo(int)
public void findPassingThrough(PlotCommit<L> currCommit, java.util.Collection<L> result)
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.
currCommit
- the commit the caller needs to get the lanes from.result
- collection to add the passing lanes into.protected void enter(int index, PlotCommit<L> currCommit)
This method is only called during RevCommitList.fillTo(int)
.
enter
in class RevCommitList<PlotCommit<L extends PlotLane>>
index
- the list position this object will appear at.currCommit
- the object being added (or set) into the list.private void continueActiveLanes(PlotCommit currCommit)
private void handleBlockedLanes(int index, PlotCommit currCommit, PlotCommit childOnLane)
index
- the index of currCommit
in the listcurrCommit
- childOnLane
- the direct child on the same lane as currCommit
,
may be null if currCommit
is the first commit on
the laneprivate PlotLane handleMerge(int index, PlotCommit currCommit, PlotCommit childOnLane, PlotCommit child, PlotLane laneToUse)
private void drawLaneToChild(int commitIndex, PlotCommit child, PlotLane laneToContinue)
commitIndex
- child
- laneToContinue
- private static void addBlockedPosition(java.util.BitSet blockedPositions, PlotCommit rObj)
private void closeLane(PlotLane lane)
private void setupChildren(PlotCommit<L> currCommit)
private PlotLane nextFreeLane()
private PlotLane nextFreeLane(java.util.BitSet blockedPositions)
private int getFreePosition(java.util.BitSet blockedPositions)
blockedPositions
- may be nullprotected L createLane()
PlotLane
appropriate for this particular
PlotCommitList
.PlotLane
appropriate for this particular
PlotCommitList
.protected void recycleLane(L lane)
lane
- a lane