LinearGraphAnswer (@NotNull ActionContext context) { CollapsedGraph.Modification modification = context.myCollapsedGraph.startModification(); modification.removeAdditionalEdges(); modification.resetNodesVisibility(); LinearGraph delegateGraph = context.getDelegatedGraph(); for (int nodeIndex = 0; nodeIndex < delegateGraph.nodesCount(); nodeIndex++) { if (modification.isNodeHidden(nodeIndex)) continue; GraphFragment fragment = context.myDelegatedFragmentGenerators.linearFragmentGenerator.getLongDownFragment(nodeIndex); if (fragment != null) { Set<Integer> middleNodes = context.myDelegatedFragmentGenerators.fragmentGenerator.getMiddleNodes(fragment.upNodeIndex, fragment.downNodeIndex, true); for (Integer nodeIndexForHide : middleNodes) modification.hideNode(nodeIndexForHide); modification.createEdge(new GraphEdge(fragment.upNodeIndex, fragment.downNodeIndex, null, GraphEdgeType.DOTTED)); } } return new DeferredGraphAnswer(GraphChangesUtil.SOME_CHANGES, modification); }