Top Description Fields Constructors Methods
org.eclipse.jgit.revplot

public Class PlotCommitList<L extends PlotLane>

extends RevCommitList<PlotCommit<L extends PlotLane>>
Class Inheritance
Type Parameters
<L>
type of lane used by the application.
Imports
java.text.MessageFormat, java.util.BitSet, .Collection, .HashMap, .HashSet, .TreeSet, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.revwalk.RevCommitList, .RevWalk

An ordered list of org.eclipse.jgit.revplot.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 org.eclipse.jgit.revplot.PlotWalk and fillTo(int) must be used to populate the list.

Field Summary

Modifier and TypeField and Description
private final HashSet<PlotLane>
private final TreeSet<Integer>
private final HashMap<PlotLane, Integer>
laneLength

number of (child) commits on a lane

pack-priv static final int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
addBlockedPosition(BitSet blockedPositions, final PlotCommit<L extends PlotLane> rObj)

public void
clear()

Overrides org.eclipse.jgit.revwalk.RevCommitList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Removes all of the elements from this list (optional operation).

private void
private void
continueActiveLanes(PlotCommit<L extends PlotLane> currCommit)

protected L

Returns:

a new PlotLane appropriate for this particular PlotCommitList.
createLane
()

Create a new PlotLane appropriate for this particular PlotCommitList.

private void
drawLaneToChild(final int
commit index
commitIndex
,
PlotCommit<L extends PlotLane>
child to connect
child
,
PlotLane
lane to continue
laneToContinue
)

Connects the commit at commitIndex to the child, using the given lane.

protected void
enter(int
the list position this object will appear at.
index
,
PlotCommit<L>
the object being added (or set) into the list.
currCommit
)

Overrides org.eclipse.jgit.revwalk.RevCommitList.enter.

Optional callback invoked when commits enter the list by fillTo.

public void
findPassingThrough(final PlotCommit<L>
the commit the caller needs to get the lanes from.
currCommit
,
final Collection<L>
collection to add the passing lanes into.
result
)

Find the set of lanes passing through a commit's row.

private int

Returns:

a free lane position
getFreePosition
(BitSet
may be null
blockedPositions
)

private void
handleBlockedLanes(final int
the index of currCommit in the list
index
,
final PlotCommit<L extends PlotLane>
the current commit
currCommit
,
final PlotCommit<L extends PlotLane>
the direct child on the same lane as currCommit, may be null if currCommit is the first commit on the lane
childOnLane
)

Sets up fork and merge information in the involved PlotCommits.

private PlotLane
handleMerge(final int index, final PlotCommit<L extends PlotLane> currCommit, final PlotCommit<L extends PlotLane> childOnLane, PlotCommit<L extends PlotLane> child, PlotLane laneToUse)

private PlotLane
private PlotLane
nextFreeLane(BitSet blockedPositions)

protected void
recycleLane(L
a lane
lane
)

Return colors and other reusable information to the plotter when a lane is no longer needed.

private void
setupChildren(PlotCommit<L> currCommit)

public void
source(RevWalk
the walker to populate from.
w
)

Overrides org.eclipse.jgit.revwalk.RevCommitList.source.

Set the revision walker this list populates itself from.

Inherited from org.eclipse.jgit.revwalk.RevCommitList:
applyFlagapplyFlagclearFlagclearFlagfillTofillToindexOfisPendinglastIndexOf

Field Detail

activeLanesback to summary
private final HashSet<PlotLane> activeLanes
freePositionsback to summary
private final TreeSet<Integer> freePositions
laneLengthback to summary
private final HashMap<PlotLane, Integer> laneLength

number of (child) commits on a lane

MAX_LENGTHback to summary
pack-priv static final int MAX_LENGTH
positionsAllocatedback to summary
private int positionsAllocated

Constructor Detail

PlotCommitListback to summary
public PlotCommitList()

Method Detail

addBlockedPositionback to summary
private static void addBlockedPosition(BitSet blockedPositions, final PlotCommit<L extends PlotLane> rObj)
clearback to summary
public void clear()

Overrides org.eclipse.jgit.revwalk.RevCommitList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Doc from java.util.AbstractList.clear.

Removes all of the elements from this list (optional operation). The list will be empty after this call returns.

Annotations
@Override
closeLaneback to summary
private void closeLane(PlotLane lane)
Annotations
@SuppressWarnings:unchecked
continueActiveLanesback to summary
private void continueActiveLanes(PlotCommit<L extends PlotLane> currCommit)
createLaneback to summary
protected L createLane()

Create a new PlotLane appropriate for this particular PlotCommitList.

Returns:L

a new PlotLane appropriate for this particular PlotCommitList.

Annotations
@SuppressWarnings:unchecked
drawLaneToChildback to summary
private void drawLaneToChild(final int commitIndex, PlotCommit<L extends PlotLane> child, PlotLane laneToContinue)

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:int

commit index

child:PlotCommit<L extends PlotLane>

child to connect

laneToContinue:PlotLane

lane to continue

Annotations
@SuppressWarnings:ReferenceEquality
enterback to summary
protected void enter(int index, PlotCommit<L> currCommit)

Overrides org.eclipse.jgit.revwalk.RevCommitList.enter.

Doc from org.eclipse.jgit.revwalk.RevCommitList.enter.

Optional callback invoked when commits enter the list by fillTo.

This method is only called during fillTo(int).

Parameters
index:int

the list position this object will appear at.

currCommit:PlotCommit<L>

the object being added (or set) into the list.

Annotations
@SuppressWarnings:ReferenceEquality
@Override
findPassingThroughback to summary
public void findPassingThrough(final PlotCommit<L> currCommit, final Collection<L> result)

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:PlotCommit<L>

the commit the caller needs to get the lanes from.

result:Collection<L>

collection to add the passing lanes into.

Annotations
@SuppressWarnings:unchecked
getFreePositionback to summary
private int getFreePosition(BitSet blockedPositions)
Parameters
blockedPositions:BitSet

may be null

Returns:int

a free lane position

handleBlockedLanesback to summary
private void handleBlockedLanes(final int index, final PlotCommit<L extends PlotLane> currCommit, final PlotCommit<L extends PlotLane> childOnLane)

Sets up fork and merge information in the involved PlotCommits. Recognizes and handles blockades that involve forking or merging arcs.

Parameters
index:int

the index of currCommit in the list

currCommit:PlotCommit<L extends PlotLane>

the current commit

childOnLane:PlotCommit<L extends PlotLane>

the direct child on the same lane as currCommit, may be null if currCommit is the first commit on the lane

Annotations
@SuppressWarnings:ReferenceEquality
handleMergeback to summary
private PlotLane handleMerge(final int index, final PlotCommit<L extends PlotLane> currCommit, final PlotCommit<L extends PlotLane> childOnLane, PlotCommit<L extends PlotLane> child, PlotLane laneToUse)
Annotations
@SuppressWarnings:ReferenceEquality
nextFreeLaneback to summary
private PlotLane nextFreeLane()
nextFreeLaneback to summary
private PlotLane nextFreeLane(BitSet blockedPositions)
recycleLaneback to summary
protected void recycleLane(L lane)

Return colors and other reusable information to the plotter when a lane is no longer needed.

Parameters
lane:L

a lane

setupChildrenback to summary
private void setupChildren(PlotCommit<L> currCommit)
sourceback to summary
public void source(RevWalk w)

Overrides org.eclipse.jgit.revwalk.RevCommitList.source.

Doc from org.eclipse.jgit.revwalk.RevCommitList.source.

Set the revision walker this list populates itself from.

Parameters
w:RevWalk

the walker to populate from.

Annotations
@Override