public boolean isSameBranch(@NotNull Node nodeA, @NotNull Node nodeB) { Node up, down; if (nodeA.getRowIndex() > nodeB.getRowIndex()) { up = nodeB; down = nodeA; } else { up = nodeA; down = nodeB; } return getGraphModel().getFragmentManager().getUpNodes(down).contains(up); }
@Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { Node jumpToNode = arrowToNode(e); if (jumpToNode != null) { jumpToRow(jumpToNode.getRowIndex()); return; } GraphElement graphElement = overCell(e); myUI.click(graphElement); if (graphElement == null) { myUI.click(PositionUtil.getRowIndex(e)); } } myTableListener.onClick(e, e.getClickCount()); }
public int getRowByHash(Hash commitHash) { Node node = getNodeByHash(commitHash); return node == null ? -1 : node.getRowIndex(); }