/** * Implements first stage of a Sugiyama layout. */ public void layeringStage() { model.initialRank(); model.fixRanks(); }
rankList[node.temp[0]].add(cell); node.maxRank = node.temp[0]; node.minRank = node.temp[0]; node.temp[0] = rankList[node.maxRank].size() - 1; rankList[i].add(edge); edge.setGeneralPurposeVariable(i, rankList[i].size() - 1);
public void visit(mxGraphHierarchyNode parent, mxGraphHierarchyNode cell, mxGraphHierarchyEdge connectingEdge, int layer, int seen) { // Check if the cell is in it's own ancestor list, if so // invert the connecting edge and reverse the target/source // relationship to that edge in the parent and the cell if ((cell) .isAncestor(parent)) { connectingEdge.invert(); parent.connectsAsSource.remove(connectingEdge); parent.connectsAsTarget.add(connectingEdge); cell.connectsAsTarget.remove(connectingEdge); cell.connectsAsSource.add(connectingEdge); } seenNodes.add(cell); unseenNodes.remove(cell); } }, rootsArray, true, null);
/** * Utility method to display the x co-ords */ public void printStatus() { mxGraphHierarchyModel model = layout.getModel(); System.out.println("======Coord assignment debug======="); for (int j = 0; j < model.ranks.size(); j++) { System.out.print("Rank " + j + " : " ); mxGraphHierarchyRank rank = model.ranks .get(new Integer(j)); Iterator<mxGraphAbstractHierarchyCell> iter = rank .iterator(); while (iter.hasNext()) { mxGraphAbstractHierarchyCell cell = iter.next(); System.out.print(cell.getX(j) + " "); } System.out.println(); } System.out.println("===================================="); }
rankList[node.temp[0]].add(cell); node.maxRank = node.temp[0]; node.minRank = node.temp[0]; node.temp[0] = rankList[node.maxRank].size() - 1; rankList[i].add(edge); edge.setGeneralPurposeVariable(i, rankList[i].size() - 1);
public void visit(mxGraphHierarchyNode parent, mxGraphHierarchyNode cell, mxGraphHierarchyEdge connectingEdge, int layer, int seen) { // Check if the cell is in it's own ancestor list, if so // invert the connecting edge and reverse the target/source // relationship to that edge in the parent and the cell if ((cell) .isAncestor(parent)) { connectingEdge.invert(); parent.connectsAsSource.remove(connectingEdge); parent.connectsAsTarget.add(connectingEdge); cell.connectsAsTarget.remove(connectingEdge); cell.connectsAsSource.add(connectingEdge); } seenNodes.add(cell); unseenNodes.remove(cell); } }, rootsArray, true, null);
/** * Implements first stage of a Sugiyama layout. */ public void layeringStage() { model.initialRank(); model.fixRanks(); }
public void visit(mxGraphHierarchyNode parent, mxGraphHierarchyNode cell, mxGraphHierarchyEdge connectingEdge, int layer, int seen) { // Check if the cell is in it's own ancestor list, if so // invert the connecting edge and reverse the target/source // relationship to that edge in the parent and the cell if ((cell) .isAncestor(parent)) { connectingEdge.invert(); parent.connectsAsSource.remove(connectingEdge); parent.connectsAsTarget.add(connectingEdge); cell.connectsAsTarget.remove(connectingEdge); cell.connectsAsSource.add(connectingEdge); } seenNodes.add(cell); unseenNodes.remove(cell); } }, unseenNodesArray, true, seenNodesCopy);
public void visit(mxGraphHierarchyNode parent, mxGraphHierarchyNode cell, mxGraphHierarchyEdge connectingEdge, int layer, int seen) { // Check if the cell is in it's own ancestor list, if so // invert the connecting edge and reverse the target/source // relationship to that edge in the parent and the cell if ((cell) .isAncestor(parent)) { connectingEdge.invert(); parent.connectsAsSource.remove(connectingEdge); parent.connectsAsTarget.add(connectingEdge); cell.connectsAsTarget.remove(connectingEdge); cell.connectsAsSource.add(connectingEdge); } seenNodes.add(cell); unseenNodes.remove(cell); } }, unseenNodesArray, true, seenNodesCopy);