use of com.intellij.vcs.log.graph.impl.print.elements.TerminalEdgePrintElement in project intellij-community by JetBrains.
the class AbstractPrintElementGenerator method getPrintElements.
@NotNull
public Collection<PrintElementWithGraphElement> getPrintElements(int rowIndex) {
Collection<PrintElementWithGraphElement> result = new ArrayList<>();
Collection<SimpleRowElement> simpleRowElements = getSimpleRowElements(rowIndex);
Map<GraphEdge, SimpleRowElement> arrows = ContainerUtil.newHashMap();
for (SimpleRowElement rowElement : simpleRowElements) {
if (!rowElement.myType.equals(RowElementType.NODE)) {
arrows.put((GraphEdge) rowElement.myElement, rowElement);
}
}
if (rowIndex < myLinearGraph.nodesCount() - 1) {
for (ShortEdge shortEdge : getDownShortEdges(rowIndex)) {
RowElementType rowElementType = RowElementType.NODE;
if ((arrows.get(shortEdge.myEdge) != null) && RowElementType.DOWN_ARROW.equals(arrows.get(shortEdge.myEdge).myType)) {
rowElementType = RowElementType.DOWN_ARROW;
arrows.remove(shortEdge.myEdge);
}
result.add(createEdgePrintElement(rowIndex, shortEdge, EdgePrintElement.Type.DOWN, !rowElementType.equals(RowElementType.NODE)));
}
}
if (rowIndex > 0) {
for (ShortEdge shortEdge : getDownShortEdges(rowIndex - 1)) {
RowElementType rowElementType = RowElementType.NODE;
if ((arrows.get(shortEdge.myEdge) != null) && RowElementType.UP_ARROW.equals(arrows.get(shortEdge.myEdge).myType)) {
rowElementType = RowElementType.UP_ARROW;
arrows.remove(shortEdge.myEdge);
}
result.add(createEdgePrintElement(rowIndex, shortEdge, EdgePrintElement.Type.UP, !rowElementType.equals(RowElementType.NODE)));
}
}
for (SimpleRowElement arrow : arrows.values()) {
result.add(new TerminalEdgePrintElement(rowIndex, arrow.myPosition, arrow.myType == RowElementType.UP_ARROW ? EdgePrintElement.Type.UP : EdgePrintElement.Type.DOWN, (GraphEdge) arrow.myElement, myPrintElementManager));
}
for (SimpleRowElement rowElement : simpleRowElements) {
if (rowElement.myType.equals(RowElementType.NODE)) {
result.add(createSimplePrintElement(rowIndex, rowElement));
}
}
return result;
}
Aggregations