@Override
protected void paintCommit(final PlotCommit commit, final int h) {
final int dotSize = computeDotSize(h);
final PlotLane myLane = commit.getLane();
final int myLaneX = laneC(myLane);
final Color myColor = laneColor(myLane);
int maxCenter = 0;
for (final PlotLane passingLane : (PlotLane[]) commit.passingLanes) {
final int cx = laneC(passingLane);
final Color c = laneColor(passingLane);
drawLine(c, cx, 0, cx, h, LINE_WIDTH);
maxCenter = Math.max(maxCenter, cx);
}
final int nParent = commit.getParentCount();
for (int i = 0; i < nParent; i++) {
final PlotCommit<PlotLane> p;
final PlotLane pLane;
final Color pColor;
final int cx;
p = (PlotCommit<PlotLane>) commit.getParent(i);
pLane = p.getLane();
if (pLane == null)
continue;
pColor = laneColor(pLane);
cx = laneC(pLane);
if (Math.abs(myLaneX - cx) > LANE_WIDTH) {
if (myLaneX < cx) {
final int ix = cx - LANE_WIDTH / 2;
drawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);
drawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);
} else {
final int ix = cx + LANE_WIDTH / 2;
drawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);
drawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);
}
} else {
drawLine(pColor, myLaneX, h / 2, cx, h, LINE_WIDTH);
}
maxCenter = Math.max(maxCenter, cx);
}
final int dotX = myLaneX - dotSize / 2 - 1;
final int dotY = (h - dotSize) / 2;
if (commit.getChildCount() > 0)
drawLine(myColor, myLaneX, 0, myLaneX, dotY, LINE_WIDTH);
if (commit.has(RevFlag.UNINTERESTING))
drawBoundaryDot(dotX, dotY, dotSize, dotSize);
else
drawCommitDot(dotX, dotY, dotSize, dotSize);
}