Ver código fonte

Merge branch 'BetterStructure' of https://koljastrohm-games.com:3000/GraphDrawer/NodeShuffler into BetterStructure

Kolja Strohm 6 anos atrás
pai
commit
10b7340245

+ 2 - 2
src/animation/PseudoCodeProcessor.java

@@ -76,7 +76,7 @@ public class PseudoCodeProcessor {
                 });
             }
             if( programPointer.getChildCount() == 0 )
-                throw new IllegalStateException( "A Codeline without sublines tryd to make a STEP_INTO." );
+                throw new IllegalStateException( "A Codeline without sublines tried to make a STEP_INTO." );
             else
                 return selectNextNode( (PseudoCodeNode)programPointer.getFirstChild(), programPointer );
         case ControlFlow.STEP_OVER:
@@ -106,7 +106,7 @@ public class PseudoCodeProcessor {
             });
             return selectNextNode( f, programPointer );
         }
-        throw new IllegalStateException( "Unbekannte ControlFlow Aktion" );
+        throw new IllegalStateException( "Unknown ControlFlow action" );
     }
     
     public CodeStatus forwardStepOver()

+ 6 - 6
src/bk/BKNodePlacement.java

@@ -15,7 +15,7 @@ import animation.Memory.ReadOnlyMemory;
 import codelines.DeclareVariable;
 import codelines.FunctionCall;
 import codelines.FunctionDefinition;
-import codelines.Kommentar;
+import codelines.Comment;
 import codelines.SetVariable;
 import graph.LayeredGraphNode;
 import lib.TextLayoutHelper;
@@ -116,19 +116,19 @@ public class BKNodePlacement extends AnimatedAlgorithm {
         }) );
         mainFunction.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "call calcLayout( layout, graph )", vars ), tree, new FunctionCall( calcLayout, new String[]{ "layout", "graph" } ) ) );
         mainFunction.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "call combine( graph )", vars ), tree, new FunctionCall( combine, new String[]{ "graph" } ) ) );
-        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- Markiert alle Typ 1 konflikte im Graphen --" ), tree, new Kommentar() ) );
+        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- mark type 1 conflicts --" ), tree, new Comment() ) );
         root.add( conflictDetectionFunction );
         PseudoCodeNode blockCalc = new BlockCalc( this ).createPseudocodeTree( tree );
         PseudoCodeNode horizontalCompaction = new Compaction().createPseudocodeTree( tree );
         calcLayout.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "call calculateBlockGraph( layout, graph )", vars ), tree, new FunctionCall( blockCalc, vars ) ) );
         calcLayout.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "call horizontalCompaction( layout, graph )", vars ), tree, new FunctionCall( horizontalCompaction, vars ) ) );
-        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- Berechnet ein bestimmtes extremes layout --" ), tree, new Kommentar() ) );
+        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- Compute an extremal layout --" ), tree, new Comment() ) );
         root.add( calcLayout );
-        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- Berechnet den Blockgraphen eines layouts --" ), tree, new Kommentar() ) );
+        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- vertical alignment --" ), tree, new Comment() ) );
         root.add( blockCalc );
-        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- Berechnet die Positionen der Knoten eines Layouts --" ), tree, new Kommentar() ) );
+        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- horizontal compaction --" ), tree, new Comment() ) );
         root.add( horizontalCompaction );
-        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- Kombiniert die 4 Layouts zum Ergebnis --" ), tree, new Kommentar() ) );
+        root.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage( "-- balancing --" ), tree, new Comment() ) );
         root.add( combine );
         processor = new PseudoCodeProcessor( root );
         return root;

+ 3 - 3
src/bk/ConflictDetection.java

@@ -20,7 +20,7 @@ import codelines.ForLoop;
 import codelines.FunctionCall;
 import codelines.FunctionDefinition;
 import codelines.IfLoop;
-import codelines.Kommentar;
+import codelines.Comment;
 import codelines.SetVariable;
 import codelines.WhileLoop;
 import graph.LayeredGraphEdge;
@@ -108,7 +108,7 @@ public class ConflictDetection implements AlgorithmStage {
                 return info;
             }
         };
-        PseudoCodeNode text = new PseudoCodeNode(TextLayoutHelper.setupPseudoCodeStage( "-- mark conflicts in subgraphs --" ), tree, new Kommentar() );
+        PseudoCodeNode text = new PseudoCodeNode(TextLayoutHelper.setupPseudoCodeStage( "-- mark conflicts in subgraphs --" ), tree, new Comment() );
         root.add( text );
         PseudoCodeNode foreach = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "foreach n in graph.getContainedNodes() do", vars ), tree, new ForEachLoop<LayeredGraphNode>( "n" ) {
 			@Override
@@ -126,7 +126,7 @@ public class ConflictDetection implements AlgorithmStage {
         foreach.add( ifNode );
         PseudoCodeNode call = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "call mark_conflicts( n );", vars ), tree, new FunctionCall( root, new String[]{ "n" } ) );
         ifNode.add( call );
-        text = new PseudoCodeNode(TextLayoutHelper.setupPseudoCodeStage( "-- mark conflicts in graph --" ), tree, new Kommentar() );
+        text = new PseudoCodeNode(TextLayoutHelper.setupPseudoCodeStage( "-- mark conflicts in graph --" ), tree, new Comment() );
         root.add( text );
         PseudoCodeNode init = new PseudoCodeNode(TextLayoutHelper.setupPseudoCode( "L = graph.getContainedLayers();", vars), tree, new DeclareVariable<ArrayList<ArrayList<LayeredGraphNode>>>( "L" ) {
             @Override

+ 1 - 1
src/codelines/Kommentar.java → src/codelines/Comment.java

@@ -4,7 +4,7 @@ import animation.CodeLine;
 import animation.ControlFlow;
 import animation.Memory;
 
-public class Kommentar extends CodeLine{
+public class Comment extends CodeLine{
 	@Override
 	public ControlFlow runForward(Memory m) {
 		return new ControlFlow( ControlFlow.STEP_OVER ); // just do nothing

+ 1 - 1
src/graph/RandomGraphGenerator.java

@@ -85,7 +85,7 @@ public class RandomGraphGenerator {
                 node = createRandomNode( parent, depth, false );
             }
             if( !validate( node ) )
-                throw new IllegalArgumentException( "No coherent graph found with this parameters.");
+                throw new IllegalArgumentException( "No acceptable graph found with this parameters.");
         }
         return node;
     }

+ 3 - 3
src/graph/io/Reader.java

@@ -99,11 +99,11 @@ public class Reader {
     private LayeredGraphEdge parseEdge( JSONObject edge, LayeredGraphNode parent ) throws JSONException
     {
         if( !edge.has( "source" ) || !edge.has( "target" ) )
-            throw new JSONException( edge + " is no valid Layered Graph Edge." );
+            throw new JSONException( edge + " is not a valid LayeredGraphEdge." );
         if( parent.findNodeByName( edge.getString( "source" ) ) == null )
-            throw new JSONException( edge + " is no valid Layered Graph Edge." );
+            throw new JSONException( edge + " is not a valid LayeredGraphEdge." );
         if( parent.findNodeByName( edge.getString( "target" ) ) == null )
-            throw new JSONException( edge + " is no valid Layered Graph Edge." );
+            throw new JSONException( edge + " is not a valid LayeredGraphEdge." );
         LayeredGraphEdge newEdge = parent.createSimpleEdge( null, parent.findNodeByName( edge.getString( "source" ) ), parent.findNodeByName( edge.getString( "target" ) ) );
         if( parent.findNodeByName( edge.getString( "source" ) ).isDummyNode() && parent.findNodeByName( edge.getString( "target" ) ).isDummyNode() )
             newEdge.setDummyEdge();

+ 2 - 2
src/lib/SweepCrossingMinimizer.java

@@ -20,7 +20,7 @@ public class SweepCrossingMinimizer {
      */
     public void minimizeCrossings( LayeredGraphNode graph ) {
         ArrayList< ArrayList< LayeredGraphNode > > layers = graph.getContainedLayers();
-        System.out.println( "Number of Detected Crossings before minimization: " + numberOfCrossings( layers ) );
+        System.out.println( "Number of detected crossings before minimization: " + numberOfCrossings( layers ) );
         for( int i = 1; i < layers.size(); i++ )
         { // Gehe alle Layer durch
             ArrayList<LayeredGraphNode> l1 = layers.get( i - 1 );
@@ -33,7 +33,7 @@ public class SweepCrossingMinimizer {
             ArrayList<LayeredGraphNode> l2 = layers.get( i );
             graph.setOrderedLayer( reduceCrossingsBetweenLayers( l1, l2, true ), i );  // minnimiere die Kreuzungen zwischen den letzten beiden Layern
         }
-        System.out.println( "Number of Detected Crossings after minimization: " + numberOfCrossings( layers ) );
+        System.out.println( "Number of detected crossings after minimization: " + numberOfCrossings( layers ) );
     }
     
     /**