浏览代码

Debug information for subgraphs

Kolja Strohm 6 年之前
父节点
当前提交
d2401d563f
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 8 0
      src/bk/BlockCalc.java
  2. 2 0
      src/bk/ExtremalLayoutCalc.java

+ 8 - 0
src/bk/BlockCalc.java

@@ -422,6 +422,14 @@ public class BlockCalc implements AlgorithmStage {
     @Override
     public String getDebugString()
     {
+        if( inside )
+        {
+            String info = "Subgraph of " + graph.getContainedLayers().get( calcLayerIndex() ).get( calcNodeIndex( nodeIndex ) ).getName() + ":\n";
+            String tmp = subgraphAlgs.get( calcLayerIndex() ).get( calcNodeIndex( nodeIndex ) ).getDebugString();
+            tmp = tmp.replaceAll( "\n", "\n " );
+            info += " " + tmp;
+            return info;
+        }
         return "";
     }
 }

+ 2 - 0
src/bk/ExtremalLayoutCalc.java

@@ -146,6 +146,8 @@ public class ExtremalLayoutCalc implements AlgorithmStage {
                     "|" + TextLayoutHelper.strToLen( n.getX( type ) + "", 5 ) + 
                     "|" + TextLayoutHelper.strToLen( !n.isXUndefined( type ) + "", 8 ) + "|\n";
         }
+        if( inside && status == LayoutState.BLOCK_CALCULATION )
+            info += bc.getDebugString();
         return info;
     }