Parcourir la source

Debug information for subgraphs

Kolja Strohm il y a 6 ans
Parent
commit
d2401d563f
2 fichiers modifiés avec 10 ajouts et 0 suppressions
  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
     @Override
     public String getDebugString()
     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 "";
         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.getX( type ) + "", 5 ) + 
                     "|" + TextLayoutHelper.strToLen( !n.isXUndefined( type ) + "", 8 ) + "|\n";
                     "|" + TextLayoutHelper.strToLen( !n.isXUndefined( type ) + "", 8 ) + "|\n";
         }
         }
+        if( inside && status == LayoutState.BLOCK_CALCULATION )
+            info += bc.getDebugString();
         return info;
         return info;
     }
     }