Browse Source

replace tabs with four spaces

Eren Yilmaz 6 years ago
parent
commit
c88c7b1cd5

+ 23 - 23
src/bk/BKNodePlacement.java

@@ -56,28 +56,28 @@ public class BKNodePlacement {
      */
     public PseudoCodeNode createPseudocodeTree( JTree tree )
     {
-    	// Liste mit Variablen die eine andere Farbe im Code bekommen sollen
-    	String[] vars = { "layout", "graph" };
-    	// Die Mainfunktion des BK Node Placement Algorithmus
-    	PseudoCodeNode mainFunction = new PseudoCodeNode( "function bkNodePlacement( graph )", vars, tree, new FunctionDefinition( new String[]{"graph"} ) );
-    	PseudoCodeNode root = new PseudoCodeNode( "-- BK Node Placement Algorithm --", vars, tree, new CodeLine() {
+        // Liste mit Variablen die eine andere Farbe im Code bekommen sollen
+        String[] vars = { "layout", "graph" };
+        // Die Mainfunktion des BK Node Placement Algorithmus
+        PseudoCodeNode mainFunction = new PseudoCodeNode( "function bkNodePlacement( graph )", vars, tree, new FunctionDefinition( new String[]{"graph"} ) );
+        PseudoCodeNode root = new PseudoCodeNode( "-- BK Node Placement Algorithm --", vars, tree, new CodeLine() {
 
-			@Override
-			public ControlFlow runForward(Memory m) {
-				if( m.isDefined( "Called", Visibility.GLOBAL ) )
-				{
-					actions.push( (Memory mem) -> {} );
-					return new ControlFlow( ControlFlow.STEP_OVER );
-				}
+            @Override
+            public ControlFlow runForward(Memory m) {
+                if( m.isDefined( "Called", Visibility.GLOBAL ) )
+                {
+                    actions.push( (Memory mem) -> {} );
+                    return new ControlFlow( ControlFlow.STEP_OVER );
+                }
                 m.declare( "param1", m.read( "graph", Visibility.GLOBAL ), Visibility.GLOBAL ); // schreibe den Graph in die Globalen Parameter Register des Speichers
-				m.declare( "Called", true, Visibility.GLOBAL );
-				actions.push( (Memory mem) -> {
+                m.declare( "Called", true, Visibility.GLOBAL );
+                actions.push( (Memory mem) -> {
                     m.undeclare( "param1", Visibility.GLOBAL );
-	                m.undeclare( "Called", Visibility.GLOBAL );
-				} );
-				return new ControlFlow( mainFunction ); // Rufe die Hauptfunktion von BK auf (Jump to mainFunction)
-				// Diese lädt den Graph selbstständig aus dem globalen Speicher in ihr neues Stack Frame
-			}
+                    m.undeclare( "Called", Visibility.GLOBAL );
+                } );
+                return new ControlFlow( mainFunction ); // Rufe die Hauptfunktion von BK auf (Jump to mainFunction)
+                // Diese l�dt den Graph selbstst�ndig aus dem globalen Speicher in ihr neues Stack Frame
+            }
 
         } );
         root.setSelected( true );
@@ -133,7 +133,7 @@ public class BKNodePlacement {
         };
         root.add( conflictsStage );
         conflictsStage.add( conflictDetectionFunction );
-        // Erzeuge die Funktion zum berechnen der Blöcke
+        // Erzeuge die Funktion zum berechnen der Bl�cke
         PseudoCodeNode blockCalc = VerticalAligment.calculateBlockGraph( tree, calcLayout );
         // Erzeuge die Placeblock Function
         PseudoCodeNode placeBlock = PlaceBlock.place_block( tree );
@@ -145,14 +145,14 @@ public class BKNodePlacement {
             private static final long serialVersionUID = 4141215748809071958L;
 
             @Override
-            public String getDebugOutput( Memory m ) { // Debug Text für die Layout Berechnungs Phase
+            public String getDebugOutput( Memory m ) { // Debug Text f�r die Layout Berechnungs Phase
                 if( !m.isSomewhereDefined( "graph", Visibility.COMPLETE_STACK ) || !m.isSomewhereDefined( "layout", Visibility.COMPLETE_STACK ) )
                     return "";
                 String info = "| Node | Shift | Sink | Root | Align |  x  |  xDef  |\n";
                 info +=       "|------|-------|------|------|-------|-----|--------|\n";
                 LayeredGraphNode graph = m.read( "graph", Visibility.COMPLETE_STACK );
                 LayoutType type = LayoutType.fromString( m.read( "layout", Visibility.COMPLETE_STACK ) );
-                switch( type ) { // Aktualisierung des aktuellen Zustandes des Algorithmus (Wird zum Zeichnen des richtigen Layouts benötigt)
+                switch( type ) { // Aktualisierung des aktuellen Zustandes des Algorithmus (Wird zum Zeichnen des richtigen Layouts ben�tigt)
                 case LEFTMOST_UPPER:
                     stage = Stage.LEFTMOST_UPPER;
                     break;
@@ -196,7 +196,7 @@ public class BKNodePlacement {
             private static final long serialVersionUID = 4212377075998840086L;
 
             @Override
-            public String getDebugOutput( Memory m ) { // Debug Text für die Berechnung des kombinierten Layouts
+            public String getDebugOutput( Memory m ) { // Debug Text f�r die Berechnung des kombinierten Layouts
                 stage = Stage.COMBINE;
                 if( !m.isSomewhereDefined( "graph", Visibility.COMPLETE_STACK ) )
                     return "";

+ 88 - 88
src/bk/ConflictDetection.java

@@ -107,23 +107,23 @@ public class ConflictDetection {
         PseudoCodeNode root = new PseudoCodeNode( "function mark_conflicts( graph )", vars, tree, new FunctionDefinition( params ) );
         PseudoCodeNode text = new PseudoCodeNode( "-- mark conflicts in subgraphs --", vars, tree, new Comment() );
         root.add( text );
-        // Für jeden Knoten im Graphen
+        // F�r jeden Knoten im Graphen
         PseudoCodeNode foreach = new PseudoCodeNode( "foreach n in graph.getContainedNodes() do", vars, tree, new ForEachLoop<LayeredGraphNode>( "n" ) {
-			@Override
-			protected List<LayeredGraphNode> list(ReadOnlyMemory m) {
-				return m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedNodes();
-			}
+            @Override
+            protected List<LayeredGraphNode> list(ReadOnlyMemory m) {
+                return m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedNodes();
+            }
         } );
         root.add( foreach );
         // Falls der Knoten einen Subgraphen hat
         PseudoCodeNode ifNode = new PseudoCodeNode( "if n has subgraph then", vars, tree, new IfLoop() {
-			@Override
-			protected boolean condition(ReadOnlyMemory m) {
-				return m.<LayeredGraphNode>read( "n", Visibility.LOCAL ).getContainedLayers().size() > 0;
-			}
+            @Override
+            protected boolean condition(ReadOnlyMemory m) {
+                return m.<LayeredGraphNode>read( "n", Visibility.LOCAL ).getContainedLayers().size() > 0;
+            }
         } );
         foreach.add( ifNode );
-        // Rufe die Funktion rekursiv für den Subgraphen auf
+        // Rufe die Funktion rekursiv f�r den Subgraphen auf
         PseudoCodeNode call = new PseudoCodeNode( "call mark_conflicts( n );", vars, tree, new FunctionCall( root, new String[]{ "n" } ) );
         ifNode.add( call );
         text = new PseudoCodeNode( "-- mark conflicts in graph --", vars, tree, new Comment() );
@@ -136,122 +136,122 @@ public class ConflictDetection {
             }
         } );
         root.add( init );
-        // Für jeden Layerindex vom 2. bis zum vorletzten (nur hier können innere Segmente auftreten)
+        // F�r jeden Layerindex vom 2. bis zum vorletzten (nur hier k�nnen innere Segmente auftreten)
         PseudoCodeNode outerLoop = new PseudoCodeNode( "for i=1 to |L|-2 do", vars, tree, new ForLoop( "i" ) {
-			@Override
-			protected int minimum( ReadOnlyMemory m ) {
-				return 1;
-			}
-			@Override
-			protected int maximum( ReadOnlyMemory m ) {
-				return m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", Visibility.LOCAL ).size() - 2;
-			}
+            @Override
+            protected int minimum( ReadOnlyMemory m ) {
+                return 1;
+            }
+            @Override
+            protected int maximum( ReadOnlyMemory m ) {
+                return m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", Visibility.LOCAL ).size() - 2;
+            }
         } );
         root.add( outerLoop );
         // Initialisiere lokale Variablen
         PseudoCodeNode line = new PseudoCodeNode( "k0 = 0; l = 0;", vars, tree, new CodeLine() {
-			@Override
-			public ControlFlow runForward(Memory m) {
-				m.declare( "k0", 0, Visibility.LOCAL ); // deklariere die Variablen im aktuellen Stack Frame
-				m.declare( "l", 0, Visibility.LOCAL );
-				actions.push( (Memory mem) -> { // Merkt sich die Rückgängig-mach-Aktion
-					mem.undeclare( "k0", Visibility.LOCAL );
-					mem.undeclare( "l", Visibility.LOCAL );
-				} );
-				return new ControlFlow( ControlFlow.STEP_OVER );
-			}
+            @Override
+            public ControlFlow runForward(Memory m) {
+                m.declare( "k0", 0, Visibility.LOCAL ); // deklariere die Variablen im aktuellen Stack Frame
+                m.declare( "l", 0, Visibility.LOCAL );
+                actions.push( (Memory mem) -> { // Merkt sich die R�ckg�ngig-mach-Aktion
+                    mem.undeclare( "k0", Visibility.LOCAL );
+                    mem.undeclare( "l", Visibility.LOCAL );
+                } );
+                return new ControlFlow( ControlFlow.STEP_OVER );
+            }
         } );
         outerLoop.add( line );
-        // Für eine genauere Beschreibung des Algoritmus zum markieren von Konflikten siehe Karstens Paper (link in Dokumentation)
+        // F�r eine genauere Beschreibung des Algoritmus zum markieren von Konflikten siehe Karstens Paper (link in Dokumentation)
         PseudoCodeNode innerLoop = new PseudoCodeNode( "for l1=0 to |L[i+1]|-1 do", vars, tree, new ForLoop( "l1" ) {
-			@Override
-			protected int minimum(ReadOnlyMemory m) {
-				return 0;
-			}
-			@Override
-			protected int maximum(ReadOnlyMemory m) {
-				return m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", Visibility.LOCAL ).get( m.<Integer>read( "i", Visibility.LOCAL ) + 1 ).size() - 1;
-			}
+            @Override
+            protected int minimum(ReadOnlyMemory m) {
+                return 0;
+            }
+            @Override
+            protected int maximum(ReadOnlyMemory m) {
+                return m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", Visibility.LOCAL ).get( m.<Integer>read( "i", Visibility.LOCAL ) + 1 ).size() - 1;
+            }
         } );
         outerLoop.add( innerLoop );
         ifNode = new PseudoCodeNode( "if l1==|L[i+1]|-1 or L[i+1][l1] incident to inner segment between L[i+1] and L[i] then", vars, tree, new IfLoop() {
-			@Override
-			protected boolean condition(ReadOnlyMemory m) {
-	            return m.<Integer>read( "l1", Visibility.LOCAL ) == m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.<Integer>read( "i", Visibility.LOCAL ) + 1).size() - 1 ||
-	            		incidentToInnerSegmentBetweenLiPlusOneAndLi( m );
-			}
+            @Override
+            protected boolean condition(ReadOnlyMemory m) {
+                return m.<Integer>read( "l1", Visibility.LOCAL ) == m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.<Integer>read( "i", Visibility.LOCAL ) + 1).size() - 1 ||
+                        incidentToInnerSegmentBetweenLiPlusOneAndLi( m );
+            }
         } );
         innerLoop.add( ifNode );
         line = new PseudoCodeNode( "k1 = |L[i]|-1;", vars, tree, new DeclareVariable<Integer>( "k1" ) {
-			@Override
-			protected Integer value(ReadOnlyMemory m) {
-				return (int)m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", Visibility.LOCAL ).get( m.read( "i", Visibility.LOCAL ) ).size() - 1;
-			}
+            @Override
+            protected Integer value(ReadOnlyMemory m) {
+                return (int)m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", Visibility.LOCAL ).get( m.read( "i", Visibility.LOCAL ) ).size() - 1;
+            }
         } );
         ifNode.add( line );
         PseudoCodeNode innerIfNode = new PseudoCodeNode( "if L[i+1][l1] incident to inner segment between L[i+1] and L[i] then", vars, tree, new IfLoop() {
-			@Override
-			protected boolean condition(ReadOnlyMemory m) {
-				return incidentToInnerSegmentBetweenLiPlusOneAndLi( m ); // Prüfe ob ein inneres Segment da ist
-			}
-		} );
+            @Override
+            protected boolean condition(ReadOnlyMemory m) {
+                return incidentToInnerSegmentBetweenLiPlusOneAndLi( m ); // Pr�fe ob ein inneres Segment da ist
+            }
+        } );
         ifNode.add( innerIfNode );
         
         line = new PseudoCodeNode( "k1 = pos(pred(L[i+1][l1])[0]);", vars, tree, new SetVariable<Integer>( "k1" ) {
-			@Override
-			protected Integer value(ReadOnlyMemory m) {
-				return (int)m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.read( "i", Visibility.LOCAL ) ).indexOf(
-						m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.<Integer>read( "i", Visibility.LOCAL ) + 1 ).get( m.read( "l1", Visibility.LOCAL ) ).getSortedIncomingEdges().get( 0 ).getSources().get( 0 ) );
-			}
+            @Override
+            protected Integer value(ReadOnlyMemory m) {
+                return (int)m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.read( "i", Visibility.LOCAL ) ).indexOf(
+                        m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.<Integer>read( "i", Visibility.LOCAL ) + 1 ).get( m.read( "l1", Visibility.LOCAL ) ).getSortedIncomingEdges().get( 0 ).getSources().get( 0 ) );
+            }
         } );
         innerIfNode.add( line );
         PseudoCodeNode whileLoop = new PseudoCodeNode( "while l <= l1 do", vars, tree, new WhileLoop() {
-			@Override
-			protected boolean condition( ReadOnlyMemory m ) {
-				return m.<Integer>read( "l", Visibility.LOCAL ) <= m.<Integer>read( "l1", Visibility.LOCAL );
-			}
+            @Override
+            protected boolean condition( ReadOnlyMemory m ) {
+                return m.<Integer>read( "l", Visibility.LOCAL ) <= m.<Integer>read( "l1", Visibility.LOCAL );
+            }
         } );
         ifNode.add( whileLoop );
         foreach = new PseudoCodeNode( "foreach v in pred(L[i+1][l]) do", vars, tree, new ForEachLoop<LayeredGraphEdge>( "v" ) {
-			@Override
-			protected List<LayeredGraphEdge> list(ReadOnlyMemory m) {
-				return m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.<Integer>read( "i", Visibility.LOCAL ) + 1 ).get( m.read( "l", Visibility.LOCAL ) ).getIncomingEdges();
-			}
+            @Override
+            protected List<LayeredGraphEdge> list(ReadOnlyMemory m) {
+                return m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.<Integer>read( "i", Visibility.LOCAL ) + 1 ).get( m.read( "l", Visibility.LOCAL ) ).getIncomingEdges();
+            }
         } );
         whileLoop.add( foreach );
         innerIfNode = new PseudoCodeNode( "if pos(v) < k0 or pos(v) > k1 then", vars, tree, new IfLoop() {
-			@Override
-			protected boolean condition(ReadOnlyMemory m) {
-			    int k = m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.read( "i", Visibility.LOCAL ) ).indexOf( m.<LayeredGraphEdge>read( "v", Visibility.LOCAL ).getSources().get( 0 ) );
-				return k < m.<Integer>read( "k0", Visibility.LOCAL ) || k > m.<Integer>read( "k1", Visibility.LOCAL );
-			}
+            @Override
+            protected boolean condition(ReadOnlyMemory m) {
+                int k = m.<LayeredGraphNode>read( "graph", Visibility.LOCAL ).getContainedLayers().get( m.read( "i", Visibility.LOCAL ) ).indexOf( m.<LayeredGraphEdge>read( "v", Visibility.LOCAL ).getSources().get( 0 ) );
+                return k < m.<Integer>read( "k0", Visibility.LOCAL ) || k > m.<Integer>read( "k1", Visibility.LOCAL );
+            }
         } );
         foreach.add( innerIfNode );
         line = new PseudoCodeNode( "mark segment (v,L[i+1][l]);", vars, tree, new CodeLine() {
-			@Override
-			public ControlFlow runForward(Memory m) {
-				LayeredGraphEdge e = m.read( "v", Visibility.LOCAL );
-				boolean old = e.isConflicted( LayoutType.LEFTMOST_UPPER );
-				e.setConflicted( true, null ); // Markiere die Kante als Konflicted
-				actions.add( (Memory mem) -> {
-					e.setConflicted( old, null ); // Rückwärts
-				});
-				return new ControlFlow( ControlFlow.STEP_OVER );
-			}
+            @Override
+            public ControlFlow runForward(Memory m) {
+                LayeredGraphEdge e = m.read( "v", Visibility.LOCAL );
+                boolean old = e.isConflicted( LayoutType.LEFTMOST_UPPER );
+                e.setConflicted( true, null ); // Markiere die Kante als Konflicted
+                actions.add( (Memory mem) -> {
+                    e.setConflicted( old, null ); // R�ckw�rts
+                });
+                return new ControlFlow( ControlFlow.STEP_OVER );
+            }
         } );
         innerIfNode.add( line );
         line = new PseudoCodeNode( "l = l+1;", vars, tree, new SetVariable<Integer>( "l" ) {
-			@Override
-			protected Integer value(ReadOnlyMemory m) {
-				return (int)m.<Integer>read( "l", Visibility.LOCAL ) + 1;
-			}
+            @Override
+            protected Integer value(ReadOnlyMemory m) {
+                return (int)m.<Integer>read( "l", Visibility.LOCAL ) + 1;
+            }
         } );
         whileLoop.add( line );
         line = new PseudoCodeNode( "k0 = k1;", vars, tree, new SetVariable<Integer>( "k0" ) {
-			@Override
-			protected Integer value(ReadOnlyMemory m) {
-				return (int)m.<Integer>read( "k1", Visibility.LOCAL );
-			}
+            @Override
+            protected Integer value(ReadOnlyMemory m) {
+                return (int)m.<Integer>read( "k1", Visibility.LOCAL );
+            }
         } );
         ifNode.add( line );
         return root;

+ 27 - 27
src/codeline/CodeLine.java

@@ -16,31 +16,31 @@ public abstract class CodeLine {
      * @author kolja
      *
      */
-	public interface BackwardAction
-	{
-		public void backward( Memory m );
-	}
-	
-	protected Stack<BackwardAction> actions;
-	protected int lineId;
-	private static int nextLineId = 0;
-	
-	/**
-	 * creates a new line of code
-	 */
-	public CodeLine()
-	{
-		synchronized( CodeLine.class ) {
-			lineId = nextLineId++;
-		}
-		actions = new Stack<BackwardAction>();
-	}
-	
-	/**
-	 * executes the line of code
-	 * @param m the memory in which the variables are
-	 * @return what should be executed next
-	 */
+    public interface BackwardAction
+    {
+        public void backward( Memory m );
+    }
+
+    protected Stack<BackwardAction> actions;
+    protected int lineId;
+    private static int nextLineId = 0;
+
+    /**
+     * creates a new line of code
+     */
+    public CodeLine()
+    {
+        synchronized( CodeLine.class ) {
+            lineId = nextLineId++;
+        }
+        actions = new Stack<BackwardAction>();
+    }
+
+    /**
+     * executes the line of code
+     * @param m the memory in which the variables are
+     * @return what should be executed next
+     */
     public abstract ControlFlow runForward( Memory m );
     
     /**
@@ -49,8 +49,8 @@ public abstract class CodeLine {
      */
     public void runBackward( Memory m )
     {
-    	if( actions.size() != 0 )
-    	    actions.pop().backward( m ); // Arbeite den Stack von Rückwärts Aktionen ab
+        if( actions.size() != 0 )
+            actions.pop().backward( m ); // Arbeite den Stack von R�ckw�rts Aktionen ab
     }
 
     /**

+ 4 - 4
src/codeline/Comment.java

@@ -8,8 +8,8 @@ import processor.Memory;
  * @author kolja
  */
 public class Comment extends CodeLine{
-	@Override
-	public ControlFlow runForward(Memory m) {
-		return new ControlFlow( ControlFlow.STEP_OVER ); // just do nothing
-	}
+    @Override
+    public ControlFlow runForward(Memory m) {
+        return new ControlFlow( ControlFlow.STEP_OVER ); // just do nothing
+    }
 }

+ 30 - 30
src/codeline/DeclareVariable.java

@@ -13,14 +13,14 @@ import processor.Memory.Visibility;
  */
 public abstract class DeclareVariable <T> extends CodeLine {
 
-	private boolean oldExists;
-	private String name;
-	private Visibility vis;
+    private boolean oldExists;
+    private String name;
+    private Visibility vis;
     
-	/**
-	 * create the line of pseudo code (not the variable)
-	 * @param name the name of the variable
-	 */
+    /**
+     * create the line of pseudo code (not the variable)
+     * @param name the name of the variable
+     */
     public DeclareVariable( String name )
     {
         this.name = name;
@@ -32,30 +32,30 @@ public abstract class DeclareVariable <T> extends CodeLine {
      * @param name the name of the variable
      * @param vis the visibility of the variable
      */
-	public DeclareVariable( String name, Visibility vis )
-	{
-		this.name = name;
-		this.vis = vis;
-	}
+    public DeclareVariable( String name, Visibility vis )
+    {
+        this.name = name;
+        this.vis = vis;
+    }
+
+    @Override
+    public ControlFlow runForward(Memory m) {
 
-	@Override
-	public ControlFlow runForward(Memory m) {
-		
-		oldExists = m.isDefined( name, vis );
-		T oldVal = m.read( name, vis );
-		m.declare( name, value( m.createReadOnlyMemory() ), vis ); // deklariere die Variable je nach Sichtbarkeit im aktuellen Stack oder im Globalen Speicher
-		actions.push( (Memory mem) -> { // Rückwärts machen
-			mem.undeclare( name, vis );
+        oldExists = m.isDefined( name, vis );
+        T oldVal = m.read( name, vis );
+        m.declare( name, value( m.createReadOnlyMemory() ), vis ); // deklariere die Variable je nach Sichtbarkeit im aktuellen Stack oder im Globalen Speicher
+        actions.push( (Memory mem) -> { // R�ckw�rts machen
+            mem.undeclare( name, vis );
             if( oldExists )
-				mem.write( name, oldVal, vis );
-		});
-		return new ControlFlow( ControlFlow.STEP_OVER );
-	}
-	
-	/**
-	 * returns the value that will be stored in the variable
+                mem.write( name, oldVal, vis );
+        });
+        return new ControlFlow( ControlFlow.STEP_OVER );
+    }
+
+    /**
+     * returns the value that will be stored in the variable
      * @param m the memory in which the variables are stored
-	 * @return the value
-	 */
-	protected abstract T value( ReadOnlyMemory m );
+     * @return the value
+     */
+    protected abstract T value( ReadOnlyMemory m );
 }

+ 56 - 56
src/codeline/ForEachLoop.java

@@ -18,67 +18,67 @@ import processor.StackFrame.FrameType;
 public abstract class ForEachLoop <T> extends CodeLine {
 
     private String loopVar;
-	
+
     /**
      * Erstelle eine for-each Schleife
      * @param varName Der Name der Schleifenvariable
      */
-	public ForEachLoop( String varName )
-	{
-		this.loopVar = varName;
-	}
-	
-	@Override
-	public ControlFlow runForward(Memory m) {
-		boolean declared = false; // prove if it is the first step in the loop
-		if( !m.isSomewhereDefined( "line_" + lineId + "_index", Visibility.LOCAL ) )
-		{ // first loop step
-			m.declare( "line_" + lineId + "_index", 0, Visibility.LOCAL );
-			declared = true;
-		}
-		if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > list( m.createReadOnlyMemory() ).size() - 1 ) // prove if the loop has finished
-		{
-			actions.push( (Memory mem) -> {});
-			return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
-		}
-		if( declared )
-		{
-			m.addFrame( new StackFrame( FrameType.LOOP ) );
+    public ForEachLoop( String varName )
+    {
+        this.loopVar = varName;
+    }
+
+    @Override
+    public ControlFlow runForward(Memory m) {
+        boolean declared = false; // prove if it is the first step in the loop
+        if( !m.isSomewhereDefined( "line_" + lineId + "_index", Visibility.LOCAL ) )
+        { // first loop step
+            m.declare( "line_" + lineId + "_index", 0, Visibility.LOCAL );
+            declared = true;
+        }
+        if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > list( m.createReadOnlyMemory() ).size() - 1 ) // prove if the loop has finished
+        {
+            actions.push( (Memory mem) -> {});
+            return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
+        }
+        if( declared )
+        {
+            m.addFrame( new StackFrame( FrameType.LOOP ) );
             m.declare( loopVar, list( m.createReadOnlyMemory() ).get( m.read( "line_" + lineId + "_index", Visibility.LOCAL ) ), Visibility.LOCAL ); // set loop variable
-			actions.push( (Memory mem) -> {
-				mem.removeFrame(); // remove Loop Stack Frame
-				mem.undeclare( "line_" + lineId + "_index", Visibility.LOCAL );
-			} );
-		}
-		else
-		{
-			int oldIndex = m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL );
-			m.write( "line_" + lineId + "_index", oldIndex + 1, Visibility.LOCAL ); // count index down
-			if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > list( m.createReadOnlyMemory() ).size() - 1 ) // prove if loop was finished
-			{
-				StackFrame sf = m.removeFrame(); // remove loop stack
-				actions.push( (Memory mem) -> {
+            actions.push( (Memory mem) -> {
+                mem.removeFrame(); // remove Loop Stack Frame
+                mem.undeclare( "line_" + lineId + "_index", Visibility.LOCAL );
+            } );
+        }
+        else
+        {
+            int oldIndex = m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL );
+            m.write( "line_" + lineId + "_index", oldIndex + 1, Visibility.LOCAL ); // count index down
+            if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > list( m.createReadOnlyMemory() ).size() - 1 ) // prove if loop was finished
+            {
+                StackFrame sf = m.removeFrame(); // remove loop stack
+                actions.push( (Memory mem) -> {
                     mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
-					mem.addFrame( sf ); // restore last loop stack
-				});
-				return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
-			}
-			StackFrame old = m.removeFrame(); // fresh stack frame for loop body
-			m.addFrame( new StackFrame( FrameType.LOOP ) );
-			m.declare( loopVar, list( m.createReadOnlyMemory() ).get( m.read( "line_" + lineId + "_index", Visibility.LOCAL ) ), Visibility.LOCAL ); // update loop variable
-			actions.push( (Memory mem) -> {
-				mem.removeFrame();
-				mem.addFrame( old ); // restore last loop stack
-				mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
-			});
-		}
-		return new ControlFlow( ControlFlow.STEP_INTO );
-	}
-	
-	/**
-	 * returns the list which the loop iterates through
+                    mem.addFrame( sf ); // restore last loop stack
+                });
+                return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
+            }
+            StackFrame old = m.removeFrame(); // fresh stack frame for loop body
+            m.addFrame( new StackFrame( FrameType.LOOP ) );
+            m.declare( loopVar, list( m.createReadOnlyMemory() ).get( m.read( "line_" + lineId + "_index", Visibility.LOCAL ) ), Visibility.LOCAL ); // update loop variable
+            actions.push( (Memory mem) -> {
+                mem.removeFrame();
+                mem.addFrame( old ); // restore last loop stack
+                mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
+            });
+        }
+        return new ControlFlow( ControlFlow.STEP_INTO );
+    }
+
+    /**
+     * returns the list which the loop iterates through
      * @param m the memory in which the variables are stored
-	 * @return the list
-	 */
-	protected abstract List<T> list( ReadOnlyMemory m );
+     * @return the list
+     */
+    protected abstract List<T> list( ReadOnlyMemory m );
 }

+ 58 - 58
src/codeline/ForLoop.java

@@ -15,66 +15,66 @@ import processor.StackFrame.FrameType;
 public abstract class ForLoop extends CodeLine {
 
     private String loopVar;
-	
-	public ForLoop( String varName )
-	{
-		this.loopVar = varName;
-	}
-	
-	@Override
-	public ControlFlow runForward(Memory m) {
-		boolean declared = false; // prove if it is the first step in the loop
-		if( !m.isSomewhereDefined( "line_" + lineId + "_index", Visibility.LOCAL ) )
-		{ // first loop step
-			m.declare( "line_" + lineId + "_index", minimum( m.createReadOnlyMemory() ), Visibility.LOCAL );
-			declared = true;
-		}
-		if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > maximum( m.createReadOnlyMemory() ) ) // prove if the loop has finished
-		{
-			actions.push( (Memory mem) -> {});
-			return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
-		}
-		if( declared )
-		{
-			m.addFrame( new StackFrame( FrameType.LOOP ) );
+
+    public ForLoop( String varName )
+    {
+        this.loopVar = varName;
+    }
+
+    @Override
+    public ControlFlow runForward(Memory m) {
+        boolean declared = false; // prove if it is the first step in the loop
+        if( !m.isSomewhereDefined( "line_" + lineId + "_index", Visibility.LOCAL ) )
+        { // first loop step
+            m.declare( "line_" + lineId + "_index", minimum( m.createReadOnlyMemory() ), Visibility.LOCAL );
+            declared = true;
+        }
+        if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > maximum( m.createReadOnlyMemory() ) ) // prove if the loop has finished
+        {
+            actions.push( (Memory mem) -> {});
+            return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
+        }
+        if( declared )
+        {
+            m.addFrame( new StackFrame( FrameType.LOOP ) );
             m.declare( loopVar, minimum( m.createReadOnlyMemory() ), Visibility.LOCAL ); // set loop variable
-			actions.push( (Memory mem) -> {
-				mem.removeFrame(); // remove loop stack
-				mem.undeclare( "line_" + lineId + "_index", Visibility.LOCAL );
-			} );
-		}
-		else
-		{
-			int oldIndex = m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL );
-			m.write( "line_" + lineId + "_index", oldIndex + 1, Visibility.LOCAL ); // count index down
-			if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > maximum( m.createReadOnlyMemory() ) ) // prove if loop was finished
-			{
-				StackFrame sf = m.removeFrame(); // remove loop stack
-				actions.add( (Memory mem) -> {
-	                //m.declare( loopVar, old, false );
-					mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
-					mem.addFrame( sf ); // restore last loop stack
-				});
-				return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
-			}
-			StackFrame old = m.removeFrame(); // fresh stack frame for loop body
-			m.addFrame( new StackFrame( FrameType.LOOP ) );
-			m.declare( loopVar, (int)m.read( "line_" + lineId + "_index", Visibility.LOCAL ), Visibility.LOCAL ); // update loop variable
-			actions.push( (Memory mem) -> {
-				mem.removeFrame();
-				mem.addFrame( old ); // restore last loop stack
-				mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
-			});
-		}
-		return new ControlFlow( ControlFlow.STEP_INTO );
-	}
-	
-	/**
-	 * returns the first value of the loop
+            actions.push( (Memory mem) -> {
+                mem.removeFrame(); // remove loop stack
+                mem.undeclare( "line_" + lineId + "_index", Visibility.LOCAL );
+            } );
+        }
+        else
+        {
+            int oldIndex = m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL );
+            m.write( "line_" + lineId + "_index", oldIndex + 1, Visibility.LOCAL ); // count index down
+            if( m.<Integer>read( "line_" + lineId + "_index", Visibility.LOCAL ) > maximum( m.createReadOnlyMemory() ) ) // prove if loop was finished
+            {
+                StackFrame sf = m.removeFrame(); // remove loop stack
+                actions.add( (Memory mem) -> {
+                    //m.declare( loopVar, old, false );
+                    mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
+                    mem.addFrame( sf ); // restore last loop stack
+                });
+                return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
+            }
+            StackFrame old = m.removeFrame(); // fresh stack frame for loop body
+            m.addFrame( new StackFrame( FrameType.LOOP ) );
+            m.declare( loopVar, (int)m.read( "line_" + lineId + "_index", Visibility.LOCAL ), Visibility.LOCAL ); // update loop variable
+            actions.push( (Memory mem) -> {
+                mem.removeFrame();
+                mem.addFrame( old ); // restore last loop stack
+                mem.write( "line_" + lineId + "_index", oldIndex, Visibility.LOCAL );
+            });
+        }
+        return new ControlFlow( ControlFlow.STEP_INTO );
+    }
+
+    /**
+     * returns the first value of the loop
      * @param m the memory in which the variables are stored
      * @return the starting value
-	 */
-	protected abstract int minimum( ReadOnlyMemory m );
+     */
+    protected abstract int minimum( ReadOnlyMemory m );
 
     
     /**
@@ -82,5 +82,5 @@ public abstract class ForLoop extends CodeLine {
      * @param m the memory in which the variables are stored
      * @return the last value
      */
-	protected abstract int maximum( ReadOnlyMemory m );
+    protected abstract int maximum( ReadOnlyMemory m );
 }

+ 32 - 32
src/codeline/FunctionCall.java

@@ -11,37 +11,37 @@ import processor.Memory.Visibility;
  */
 public class FunctionCall extends CodeLine {
 
-	private PseudoCodeNode target;
-	private String[] params;
-	
-	/**
-	 * Erstellt einen neuen Funktionsaufruf
-	 * @param function der PseudoCode Knoten der Funktion (sollte eine FunctionDefinition CodeLine beinhalten aber das ist nicht Pflicht)
-	 * @param params Liste mit namen von Lokalen variablen, welche als Parameter übergeben werden sollen
-	 */
-	public FunctionCall( PseudoCodeNode function, String[] params )
-	{
-		this.target = function;
-		this.params = params;
-	}
-	
-	@Override
-	public ControlFlow runForward(Memory m) {
-		int index = 1;
-		for( String p : params )
-		{ // Schreibe die Parameter der Funktion in die dafür vorgesehenen Globalen Register
-			m.declare( "param" + index, m.read( p, Visibility.LOCAL ), Visibility.GLOBAL );
-			index++;
-		}
-		actions.push( (Memory mem) -> { // Rückwärtsaktion merken
-			int ind = 1;
-			for( @SuppressWarnings("unused") String p : params )
-			{
-				m.undeclare( "param" + ind, Visibility.GLOBAL );
-				ind++;
-			}
-		} );
-		return new ControlFlow( target ); // Gibt ein ControlFlow Object zurück, welches dem Prozessor die Anweisung gibt zu einem Bestimmten Knoten zu springen
-	}
+    private PseudoCodeNode target;
+    private String[] params;
+
+    /**
+     * Erstellt einen neuen Funktionsaufruf
+     * @param function der PseudoCode Knoten der Funktion (sollte eine FunctionDefinition CodeLine beinhalten aber das ist nicht Pflicht)
+     * @param params Liste mit namen von Lokalen variablen, welche als Parameter �bergeben werden sollen
+     */
+    public FunctionCall( PseudoCodeNode function, String[] params )
+    {
+        this.target = function;
+        this.params = params;
+    }
+
+    @Override
+    public ControlFlow runForward(Memory m) {
+        int index = 1;
+        for( String p : params )
+        { // Schreibe die Parameter der Funktion in die daf�r vorgesehenen Globalen Register
+            m.declare( "param" + index, m.read( p, Visibility.LOCAL ), Visibility.GLOBAL );
+            index++;
+        }
+        actions.push( (Memory mem) -> { // R�ckw�rtsaktion merken
+            int ind = 1;
+            for( @SuppressWarnings("unused") String p : params )
+            {
+                m.undeclare( "param" + ind, Visibility.GLOBAL );
+                ind++;
+            }
+        } );
+        return new ControlFlow( target ); // Gibt ein ControlFlow Object zur�ck, welches dem Prozessor die Anweisung gibt zu einem Bestimmten Knoten zu springen
+    }
 
 }

+ 46 - 46
src/codeline/FunctionDefinition.java

@@ -12,50 +12,50 @@ import processor.StackFrame.FrameType;
  */
 public class FunctionDefinition extends CodeLine {
 
-	private String[] params;
-	
-	/**
-	 * Erstellt eine neue Funktion
-	 * @param params Eine Liste mit Namen von Argumenten die automatisch beim Aufruf aus den Globalen Registern in das neue Stackframe geladen werden sollen
-	 */
-	public FunctionDefinition( String[] params )
-	{
-		this.params = params;
-	}
-	
-	@Override
-	public ControlFlow runForward(Memory m) {
-		if( !m.isDefined( "line_" + lineId + "_inside", Visibility.LOCAL ) )
-		{ // Funktion wurde noch nicht aufgerufen
-			m.addFrame( new StackFrame( FrameType.FUNCTION ) ); // Füge neues Stackframe hinzu
-			m.declare( "line_" + lineId + "_inside", true, Visibility.LOCAL );
-			int index = 1;
-			Object[] olds = new Object[ params.length ];
-			for( String p : params )
-			{ // Lade alle Parameter aus den Globalen Registern
-				olds[ index - 1 ] = m.read( "param" + index, Visibility.GLOBAL );
-				m.declare( p, olds[ index - 1 ], Visibility.LOCAL ); // Speichere sie im Stack
-				m.undeclare( "param" + index, Visibility.GLOBAL );
-				index++;
-			}
-			actions.push( (Memory mem) -> { // merkt sich die Rückwärtsaktion
-				mem.removeFrame();
-				int i = 1;
-				for( @SuppressWarnings("unused") String p : params )
-				{
-					mem.declare( "param" + i, olds[ i - 1], Visibility.GLOBAL );
-					i++;
-				}
-			} );
-			return new ControlFlow( ControlFlow.STEP_INTO ); // springe in die Funktion
-		}
-		else
-		{ // Funktion ist bereits follständig ausgeführt worden
-			StackFrame frame = m.removeFrame();
-			actions.push( (Memory mem) -> {
-				mem.addFrame( frame );
-			} );
-			return new ControlFlow( ControlFlow.STEP_OVER ); // return
-		}
-	}
+    private String[] params;
+
+    /**
+     * Erstellt eine neue Funktion
+     * @param params Eine Liste mit Namen von Argumenten die automatisch beim Aufruf aus den Globalen Registern in das neue Stackframe geladen werden sollen
+     */
+    public FunctionDefinition( String[] params )
+    {
+        this.params = params;
+    }
+
+    @Override
+    public ControlFlow runForward(Memory m) {
+        if( !m.isDefined( "line_" + lineId + "_inside", Visibility.LOCAL ) )
+        { // Funktion wurde noch nicht aufgerufen
+            m.addFrame( new StackFrame( FrameType.FUNCTION ) ); // F�ge neues Stackframe hinzu
+            m.declare( "line_" + lineId + "_inside", true, Visibility.LOCAL );
+            int index = 1;
+            Object[] olds = new Object[ params.length ];
+            for( String p : params )
+            { // Lade alle Parameter aus den Globalen Registern
+                olds[ index - 1 ] = m.read( "param" + index, Visibility.GLOBAL );
+                m.declare( p, olds[ index - 1 ], Visibility.LOCAL ); // Speichere sie im Stack
+                m.undeclare( "param" + index, Visibility.GLOBAL );
+                index++;
+            }
+            actions.push( (Memory mem) -> { // merkt sich die R�ckw�rtsaktion
+                mem.removeFrame();
+                int i = 1;
+                for( @SuppressWarnings("unused") String p : params )
+                {
+                    mem.declare( "param" + i, olds[ i - 1], Visibility.GLOBAL );
+                    i++;
+                }
+            } );
+            return new ControlFlow( ControlFlow.STEP_INTO ); // springe in die Funktion
+        }
+        else
+        { // Funktion ist bereits follst�ndig ausgef�hrt worden
+            StackFrame frame = m.removeFrame();
+            actions.push( (Memory mem) -> {
+                mem.addFrame( frame );
+            } );
+            return new ControlFlow( ControlFlow.STEP_OVER ); // return
+        }
+    }
 }

+ 23 - 23
src/codeline/IfLoop.java

@@ -14,37 +14,37 @@ import processor.StackFrame.FrameType;
  */
 public abstract class IfLoop extends CodeLine {
 
-	@Override
-	public ControlFlow runForward(Memory m) {
-		// Prüfe ob die Kindknoten bereits ausgeführt wurden
-		if( m.isDefined( "line_" + lineId + "_inside", Visibility.LOCAL ) )
-		{ // Wurde bereits ausgeführt
-			StackFrame old = m.removeFrame();
-			actions.push( (Memory mem) -> {
-				mem.addFrame( old );
-			} );
+    @Override
+    public ControlFlow runForward(Memory m) {
+        // Pr�fe ob die Kindknoten bereits ausgef�hrt wurden
+        if( m.isDefined( "line_" + lineId + "_inside", Visibility.LOCAL ) )
+        { // Wurde bereits ausgef�hrt
+            StackFrame old = m.removeFrame();
+            actions.push( (Memory mem) -> {
+                mem.addFrame( old );
+            } );
             return new ControlFlow( ControlFlow.STEP_OVER ); // Springe zum nachfolgenden Knoten
-		}
-		else
-		{ // Wurde noch nicht ausgeführt
-            if( condition( m.createReadOnlyMemory() ) ) { // Prüfe ob die Bedingung erfüllt ist
-            	m.addFrame( new StackFrame( FrameType.LOOP ) );
-            	m.declare( "line_" + lineId + "_inside", true, Visibility.LOCAL );
-            	actions.push( (Memory mem) -> {
-            		mem.removeFrame();
-            	} );
-            	return new ControlFlow( ControlFlow.STEP_INTO ); // Springe in das If rein
+        }
+        else
+        { // Wurde noch nicht ausgef�hrt
+            if( condition( m.createReadOnlyMemory() ) ) { // Pr�fe ob die Bedingung erf�llt ist
+                m.addFrame( new StackFrame( FrameType.LOOP ) );
+                m.declare( "line_" + lineId + "_inside", true, Visibility.LOCAL );
+                actions.push( (Memory mem) -> {
+                    mem.removeFrame();
+                } );
+                return new ControlFlow( ControlFlow.STEP_INTO ); // Springe in das If rein
             } else {
-            	actions.push( (Memory mem) -> {} );
+                actions.push( (Memory mem) -> {} );
                 return new ControlFlow( ControlFlow.STEP_OVER ); // Springe zum nachfolgenden Knoten
             }
-		}
-	}
+        }
+    }
 
     /**
      * the exit condition of the loop
      * @param m the memory in which the variables are stored
      * @return false if the loop is over
      */
-	protected abstract boolean condition( ReadOnlyMemory m );
+    protected abstract boolean condition( ReadOnlyMemory m );
 }

+ 26 - 26
src/codeline/WhileLoop.java

@@ -14,13 +14,13 @@ import processor.StackFrame.FrameType;
  */
 public abstract class WhileLoop extends CodeLine {
 
-	@Override
-	public ControlFlow runForward(Memory m) {
-		boolean declared = false; // prove if it is the first step in the loop
-		if( !m.isDefined( "line_" + lineId + "_index", Visibility.LOCAL ) )
-		{ // first loop step
-			declared = true;
-		}
+    @Override
+    public ControlFlow runForward(Memory m) {
+        boolean declared = false; // prove if it is the first step in the loop
+        if( !m.isDefined( "line_" + lineId + "_index", Visibility.LOCAL ) )
+        { // first loop step
+            declared = true;
+        }
         if( !condition( m.createReadOnlyMemory() ) ) // prove if loop was finished
         {
             if( !declared )
@@ -36,26 +36,26 @@ public abstract class WhileLoop extends CodeLine {
             }
             return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
         }
-		if( declared )
-		{
-			m.addFrame( new StackFrame( FrameType.LOOP ) );
+        if( declared )
+        {
+            m.addFrame( new StackFrame( FrameType.LOOP ) );
             m.declare( "line_" + lineId + "_index", 0, Visibility.LOCAL );
-			actions.push( (Memory mem) -> {
-				mem.removeFrame();
-			} );
-		}
-		else
-		{
-			StackFrame old = m.removeFrame(); // fresh stack frame for loop body
-			m.addFrame( new StackFrame( FrameType.LOOP ) );
+            actions.push( (Memory mem) -> {
+                mem.removeFrame();
+            } );
+        }
+        else
+        {
+            StackFrame old = m.removeFrame(); // fresh stack frame for loop body
+            m.addFrame( new StackFrame( FrameType.LOOP ) );
             m.declare( "line_" + lineId + "_index", 0, Visibility.LOCAL );
-			actions.push( (Memory mem) -> {
-				mem.removeFrame();
-				mem.addFrame( old );
-			});
-		}
-		return new ControlFlow( ControlFlow.STEP_INTO );
-	}
+            actions.push( (Memory mem) -> {
+                mem.removeFrame();
+                mem.addFrame( old );
+            });
+        }
+        return new ControlFlow( ControlFlow.STEP_INTO );
+    }
 
 
     /**
@@ -63,5 +63,5 @@ public abstract class WhileLoop extends CodeLine {
      * @param m the memory in which the variables are stored
      * @return false if the loop is over
      */
-	protected abstract boolean condition( ReadOnlyMemory  m );
+    protected abstract boolean condition( ReadOnlyMemory  m );
 }

+ 25 - 25
src/graph/LayeredNode.java

@@ -23,7 +23,7 @@ public class LayeredNode implements LayeredGraphNode {
     private boolean dummy;
 
     private class LayoutInfo {
-    	private double x;
+        private double x;
         private double y;
         private double w;
         private double h;
@@ -41,11 +41,11 @@ public class LayeredNode implements LayeredGraphNode {
     }
 
     private class CombinedLayoutInfo {
-    	private double x;
-    	private double y;
-    	private double w;
-    	private double h;
-    	private boolean selected;
+        private double x;
+        private double y;
+        private double w;
+        private double h;
+        private boolean selected;
         private NodeView view;
     }
 
@@ -107,10 +107,10 @@ public class LayeredNode implements LayeredGraphNode {
         {
             if( original != null )
             {
-            	l.x = original.getX();
-            	l.y = original.getX();
-            	l.w = original.getWidth();
-            	l.h = original.getHeight();
+                l.x = original.getX();
+                l.y = original.getX();
+                l.w = original.getWidth();
+                l.h = original.getHeight();
             }
             l.align = this;
             l.root = this;
@@ -663,13 +663,13 @@ public class LayeredNode implements LayeredGraphNode {
     public double getHeight( LayoutType layout ) {
         if( nodes.size() > 0 )
         {
-        	double max = 0;
+            double max = 0;
           // check contained nodes
-        	for( LayeredGraphNode n : nodes )
-        	{
-        		if( max < n.getY(layout) + n.getHeight(layout) )
-        			max = n.getY(layout) + n.getHeight(layout);
-        	}
+            for( LayeredGraphNode n : nodes )
+            {
+                if( max < n.getY(layout) + n.getHeight(layout) )
+                    max = n.getY(layout) + n.getHeight(layout);
+            }
             if( layout == LayoutType.LEFTMOST_UPPER )
                 return Math.max( max, layouts[ 0 ].h );
             if( layout == LayoutType.RIGHTMOST_UPPER )
@@ -873,17 +873,17 @@ public class LayeredNode implements LayeredGraphNode {
     public ArrayList<LayeredGraphEdge> getSortedOutgoingEdges(LayeredGraphNode n) {
         // get edges
         ArrayList<LayeredGraphEdge> result = new ArrayList<>();
-    	if( n.getLayer() + 1 >= layers.size() )
-    		return result;
+        if( n.getLayer() + 1 >= layers.size() )
+            return result;
         ArrayList< LayeredGraphEdge > unsorted = getOutgoingEdges( n );
         
         // sort
         for( LayeredGraphNode node : layers.get( n.getLayer() + 1 ) )
         {
-        	for( LayeredGraphEdge e : unsorted )
+            for( LayeredGraphEdge e : unsorted )
             {
                 if( e.getTargets().contains( node ) && !result.contains( e ) )
-                	result.add( e );
+                    result.add( e );
             }
         }
         return result;
@@ -893,17 +893,17 @@ public class LayeredNode implements LayeredGraphNode {
     public ArrayList<LayeredGraphEdge> getSortedIncomingEdges(LayeredGraphNode n) {
         // get edges
         ArrayList<LayeredGraphEdge> result = new ArrayList<>();
-    	if( n.getLayer() - 1 < 0 )
-    		return result;
-    	
+        if( n.getLayer() - 1 < 0 )
+            return result;
+
         // sort
         ArrayList< LayeredGraphEdge > unsorted = getIncomingEdges( n );
         for( LayeredGraphNode node : layers.get( n.getLayer() - 1 ) )
         {
-        	for( LayeredGraphEdge e : unsorted )
+            for( LayeredGraphEdge e : unsorted )
             {
                 if( e.getSources().contains( node ) && !result.contains( e ) )
-                	result.add( e );
+                    result.add( e );
             }
         }
         return result;

+ 2 - 2
src/test/TestProcessor.java

@@ -17,8 +17,8 @@ import processor.PseudoCodeProcessor;
 class TestProcessor {
     
     public static void main(String[] args) throws InterruptedException {
-    	
-    	RandomGraphGenerator r = new RandomGraphGenerator( 0.2, 0.8, 3, 5, 2, 5, 3 );
+
+        RandomGraphGenerator r = new RandomGraphGenerator( 0.2, 0.8, 3, 5, 2, 5, 3 );
         LayeredGraphNode graph = r.createRandomNode( null, 0, true );
         SweepCrossingMinimizer cminzer = new SweepCrossingMinimizer();
         for( int i = 0; i < 10; i++ )

+ 5 - 5
src/view/AnimatedView.java

@@ -8,10 +8,10 @@ package view;
  */
 public interface AnimatedView {
 
-	/**
-	 * 
-	 * @return Die X Koordinate, die das Model der View hat
-	 */
+    /**
+     *
+     * @return Die X Koordinate, die das Model der View hat
+     */
     public int getVirtualX();
     /**
      * 
@@ -25,7 +25,7 @@ public interface AnimatedView {
     public int getVirtualWidth();
     /**
      * 
-     * @return Die Höhe des Models der View
+     * @return Die H�he des Models der View
      */
     public int getVirtualHeight();
 }

+ 54 - 54
src/view/LegendView.java

@@ -16,28 +16,28 @@ import javax.swing.JPanel;
  */
 public class LegendView extends JPanel {
 
-	private static final long serialVersionUID = 1L;
-	private static final int PADDING = 4;
+    private static final long serialVersionUID = 1L;
+    private static final int PADDING = 4;
 
-	@Override
-	public void paintComponent( Graphics g ) {
-	 // Zeichnet die Legende
-		g.setFont( RenderHelper.font );
-		FontMetrics fm = g.getFontMetrics(); // Font Metrics berechnen
-		setPreferredSize( new Dimension( getPreferredSize().width, fm.getHeight() + PADDING * 2 ) );
-		
-		int height = fm.getHeight() + PADDING * 2;
-		
-		int x = PADDING;
-		g.drawString( "Legend:", x, fm.getMaxAscent() + PADDING );
-		x += fm.stringWidth( "Legend:" ) + PADDING;
-		// Wurzeln von Blöcken
-		g.setColor( Color.LIGHT_GRAY );
-		g.fillOval( x, PADDING, height - PADDING*2, height - PADDING*2 );
-		x += height;
-		g.setColor( Color.BLACK );
-		g.drawString( "block root", x, fm.getMaxAscent() + PADDING );
-		x += fm.stringWidth( "block root" ) + PADDING * 4;
+    @Override
+    public void paintComponent( Graphics g ) {
+     // Zeichnet die Legende
+        g.setFont( RenderHelper.font );
+        FontMetrics fm = g.getFontMetrics(); // Font Metrics berechnen
+        setPreferredSize( new Dimension( getPreferredSize().width, fm.getHeight() + PADDING * 2 ) );
+
+        int height = fm.getHeight() + PADDING * 2;
+
+        int x = PADDING;
+        g.drawString( "Legend:", x, fm.getMaxAscent() + PADDING );
+        x += fm.stringWidth( "Legend:" ) + PADDING;
+        // Wurzeln von Bl�cken
+        g.setColor( Color.LIGHT_GRAY );
+        g.fillOval( x, PADDING, height - PADDING*2, height - PADDING*2 );
+        x += height;
+        g.setColor( Color.BLACK );
+        g.drawString( "block root", x, fm.getMaxAscent() + PADDING );
+        x += fm.stringWidth( "block root" ) + PADDING * 4;
         // Dummy Knoten
         g.setColor( Color.LIGHT_GRAY );
         g.fillOval( x, PADDING, height / 3, height - PADDING*2 );
@@ -45,38 +45,38 @@ public class LegendView extends JPanel {
         g.setColor( Color.BLACK );
         g.drawString( "dummy node", x, fm.getMaxAscent() + PADDING );
         x += fm.stringWidth( "dummy node" ) + PADDING * 4;
-		// Knoten mit Subgraph
-		g.setColor( Color.LIGHT_GRAY );
+        // Knoten mit Subgraph
+        g.setColor( Color.LIGHT_GRAY );
         ((Graphics2D)g).setStroke(new BasicStroke(2));
-		g.drawRect( x, PADDING, height - PADDING * 2, height - PADDING * 2 );
-		x += height;
-		g.setColor( Color.BLACK );
-		g.drawString( "node with subgraph", x, fm.getMaxAscent() + PADDING );
-		x += fm.stringWidth( "node with subgraph" ) + PADDING * 4;
-		// Kanten, welche als conflicted markiert wurden
-		g.setColor( Color.RED );
-		g.drawLine( x, height / 2, x + height - PADDING * 2, height / 2 );
-		x += height;
-		g.setColor( Color.BLACK );
-		g.drawString( "conflicted edge", x, fm.getMaxAscent() + PADDING );
-		x += fm.stringWidth( "conflicted edge" ) + PADDING * 4;
-		// Farbe der Klassen
-		g.setColor( Color.BLUE );
-		g.fillRect( x, 0, height, height );
-		g.setColor( Color.LIGHT_GRAY );
-		g.fillOval( x + PADDING, PADDING, height - PADDING * 2, height - PADDING * 2 );
-		x += height + PADDING;
-		g.setColor( Color.BLACK );
-		g.drawString( "class color", x, fm.getMaxAscent() + PADDING );
-		x += fm.stringWidth( "class color" ) + PADDING * 4;
-		// Farben der Blöcke
-		g.setColor( Color.LIGHT_GRAY );
-		g.fillRect( x, 0, height, height );
-		g.setColor( Color.BLUE );
-		g.fillOval( x + PADDING, PADDING, height - PADDING * 2, height - PADDING * 2 );
-		x += height + PADDING;
-		g.setColor( Color.BLACK );
-		g.drawString( "block color", x, fm.getMaxAscent() + PADDING );
-		x += fm.stringWidth( "block color" ) + PADDING * 4;
-	}
+        g.drawRect( x, PADDING, height - PADDING * 2, height - PADDING * 2 );
+        x += height;
+        g.setColor( Color.BLACK );
+        g.drawString( "node with subgraph", x, fm.getMaxAscent() + PADDING );
+        x += fm.stringWidth( "node with subgraph" ) + PADDING * 4;
+        // Kanten, welche als conflicted markiert wurden
+        g.setColor( Color.RED );
+        g.drawLine( x, height / 2, x + height - PADDING * 2, height / 2 );
+        x += height;
+        g.setColor( Color.BLACK );
+        g.drawString( "conflicted edge", x, fm.getMaxAscent() + PADDING );
+        x += fm.stringWidth( "conflicted edge" ) + PADDING * 4;
+        // Farbe der Klassen
+        g.setColor( Color.BLUE );
+        g.fillRect( x, 0, height, height );
+        g.setColor( Color.LIGHT_GRAY );
+        g.fillOval( x + PADDING, PADDING, height - PADDING * 2, height - PADDING * 2 );
+        x += height + PADDING;
+        g.setColor( Color.BLACK );
+        g.drawString( "class color", x, fm.getMaxAscent() + PADDING );
+        x += fm.stringWidth( "class color" ) + PADDING * 4;
+        // Farben der Bl�cke
+        g.setColor( Color.LIGHT_GRAY );
+        g.fillRect( x, 0, height, height );
+        g.setColor( Color.BLUE );
+        g.fillOval( x + PADDING, PADDING, height - PADDING * 2, height - PADDING * 2 );
+        x += height + PADDING;
+        g.setColor( Color.BLACK );
+        g.drawString( "block color", x, fm.getMaxAscent() + PADDING );
+        x += fm.stringWidth( "block color" ) + PADDING * 4;
+    }
 }

+ 34 - 34
src/view/MainView.java

@@ -88,11 +88,11 @@ public class MainView {
     private JLabel delayText;
     private JTextField delay;
     private JTree pseudoTree; // Die Pseudocode Ansicht
-    private LayeredGraphNode graph; // Die interne Graph Repräsentation
+    private LayeredGraphNode graph; // Die interne Graph Repr�sentation
     private OptionsDialog optionsDialog; // Der Dialog mit Optionen
 
     private String debugInfo()
-    { // Gesammter Debug Text für alle Layouts
+    { // Gesammter Debug Text f�r alle Layouts
         String info = "Debug Information Table: \n";
         info += "_______________________________________________________________________________________________________________________________________________________________________________________________________________________\n";
         info += "|" + TextLayoutHelper.strToLen( "Top -> Bottom :> Left", 51 ) + "| |" + TextLayoutHelper.strToLen( "Top -> Bottom :> Right", 51 ) + "| |" + TextLayoutHelper.strToLen( "Bottom -> Top :> Left", 51 ) + "| |" + TextLayoutHelper.strToLen( "Bottom -> Top :> Right", 51 ) + "|\n";
@@ -404,7 +404,7 @@ public class MainView {
             public void mousePressed(MouseEvent e) {
                 TreePath selPath = pseudoTree.getPathForLocation(e.getX(), e.getY());
                 if( selPath != null && e.getClickCount() == 3 ) {
-                	// Setzt einen Breakpoint bei dreifachklick
+                    // Setzt einen Breakpoint bei dreifachklick
                     ((PseudoCodeNode)selPath.getLastPathComponent()).setBreakPoint( !((PseudoCodeNode)selPath.getLastPathComponent()).hasBreakPoint() );
                     if( !pseudoTree.isExpanded( selPath ) )
                     {
@@ -419,7 +419,7 @@ public class MainView {
                     pseudoTree.repaint();
                     frame.repaint();
                 }
-                // Erzeuge das Rechtsklick Menü für Collaps und Expand
+                // Erzeuge das Rechtsklick Men� f�r Collaps und Expand
                 if( e.getButton() == MouseEvent.BUTTON3 )
                 {
                     JPopupMenu menu = new JPopupMenu();
@@ -542,8 +542,8 @@ public class MainView {
         frame.setVisible( true );
 
         LegendView statusPanel = new LegendView();
-		statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
-		frame.add(statusPanel, BorderLayout.SOUTH);
+        statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
+        frame.add(statusPanel, BorderLayout.SOUTH);
 
         JLayeredPane layne = new JLayeredPane();
         layne.setLayout( new BorderLayout() );
@@ -552,7 +552,7 @@ public class MainView {
         pl.setLayout( grout );
         pl.setLocation( 0, 0 );
         pl.setSize( frame.getSize() );
-        // Erzeugt die Graph Views für die verschiedenen Layouts
+        // Erzeugt die Graph Views f�r die verschiedenen Layouts
         NodeView topLeft = createNodeView( graph, LayoutType.LEFTMOST_UPPER );
         NodeView topRight = createNodeView( graph, LayoutType.RIGHTMOST_UPPER );
         NodeView bottomLeft = createNodeView( graph, LayoutType.LEFTMOST_LOWER );
@@ -619,7 +619,7 @@ public class MainView {
         frame.addComponentListener(new ComponentAdapter()
         {
             public void componentResized(ComponentEvent evt) {
-            	// Aktualisiere die Höhe des Menüs
+                // Aktualisiere die H�he des Men�s
                 menue.setSize( menue.getWidth(), layne.getHeight() );
                 spane2.setSize( menue.getWidth() - 20, menue.getHeight() - 120 );
                 if( graph.getColor( null ) == null )
@@ -643,14 +643,14 @@ public class MainView {
                 layne.add( pl, 1 );
                 if( optionsDialog != null && optionsDialog.getLayerDisplayOption() == 1 && old != algorithm.getAlgorithmState() )
                 { // Es soll immer nur das aktuelle LAyout gezeichet werden und der Algorithmus hat ein neues Layout erreicht
-                	// Entferne die Layouts
+                    // Entferne die Layouts
                     pl.remove( topLeft );
                     pl.remove( topRight );
                     pl.remove( bottomLeft );
                     pl.remove( bottomRight );
                     pl.remove( combined );
                     switch( algorithm.getAlgorithmState() )
-                    { // füge das richtige Layout hinzu
+                    { // f�ge das richtige Layout hinzu
                     case CONFLICT_DETECTION:
                         pl.add( topLeft );
                         break;
@@ -693,7 +693,7 @@ public class MainView {
 
             @Override
             public void actionPerformed(ActionEvent e) {
-            	// Es wurden Optionen geändert
+                // Es wurden Optionen ge�ndert
                 controller.setStepOption( optionsDialog.getRunStepsOption() );
                 controller.setAutoCollapseOption( optionsDialog.getAutoCollapseOption() );
                 RenderHelper.font = new Font( "Monospaced", Font.PLAIN, optionsDialog.getFontSize() );
@@ -708,40 +708,40 @@ public class MainView {
                 layne.remove( combined );
                 if( optionsDialog.getLayerDisplayOption() == 0)
                 { // Es sollen alle Layouts angezeigt werden
-                	pl.setLayout( grout );
+                    pl.setLayout( grout );
                     pl.add( topLeft );
                     pl.add( topRight );
                     pl.add( bottomLeft );
                     pl.add( bottomRight );
-                	layne.add( combined, 0 );
+                    layne.add( combined, 0 );
                 }
                 else
                 { // Es soll nur das aktuelle Layout gezeichnet werden
                     pl.setLayout( new BorderLayout() );
                     switch( algorithm.getAlgorithmState() )
-	                { // füge das richtige layout hinzu
-	                case CONFLICT_DETECTION:
-	                    pl.add( topLeft );
-	                    break;
-	                case LEFTMOST_UPPER:
-	                    pl.add( topLeft );
-	                    break;
-	                case RIGHTMOST_UPPER:
-	                    pl.add( topRight );
-	                    break;
-	                case LEFTMOST_LOWER:
-	                    pl.add( bottomLeft );
-	                    break;
-	                case RIGHTMOST_LOWER:
-	                    pl.add( bottomRight );
-	                    break;
-	                case COMBINE:
-	                    pl.add( combined );
-	                    break;
+                    { // f�ge das richtige layout hinzu
+                    case CONFLICT_DETECTION:
+                        pl.add( topLeft );
+                        break;
+                    case LEFTMOST_UPPER:
+                        pl.add( topLeft );
+                        break;
+                    case RIGHTMOST_UPPER:
+                        pl.add( topRight );
+                        break;
+                    case LEFTMOST_LOWER:
+                        pl.add( bottomLeft );
+                        break;
+                    case RIGHTMOST_LOWER:
+                        pl.add( bottomRight );
+                        break;
+                    case COMBINE:
+                        pl.add( combined );
+                        break;
                     default:
                         assert false;
                         break;
-	                }
+                    }
                 }
                 pl.revalidate();
                 layne.revalidate();
@@ -754,7 +754,7 @@ public class MainView {
         processor.start(); // start running the algorithm
     }
 
-    // Erzeugt eine View für einen Graph
+    // Erzeugt eine View f�r einen Graph
     private NodeView createNodeView( LayeredGraphNode gNode, LayoutType lt )
     {
         NodeView graphView = new NodeView( gNode, lt, frame );

+ 7 - 7
src/view/NodeView.java

@@ -152,7 +152,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
      * @return the width
      */
     public int getOriginalWidth() {
-    	if( model.isDummyNode() )
+        if( model.isDummyNode() )
             return (int)(originalWidth / 3);
         return originalWidth;
     }
@@ -195,7 +195,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
 
     @Override
     public void doLayout() {
-    	// Aktualisiere die Größen der Knindknoten
+        // Aktualisiere die Gr��en der Knindknoten
         double minX = Double.POSITIVE_INFINITY;
         for( Component c : getComponents() )
         {
@@ -206,7 +206,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
         int x = 0;
         int y = 0;
         int padding = calculatePadding();
-        // Berechne die Skallierung so dass alles in die vorgesehene Zeichenfläche passt
+        // Berechne die Skallierung so dass alles in die vorgesehene Zeichenfl�che passt
         double scale = Math.min( (getWidth()-padding) / (double)getWidthOfNeededArea(), (getHeight()-padding) / (double)getHeightOfNeededArea());
         x += (getWidth()) / 2 - (getWidthOfNeededArea() * scale ) / 2;
         y += (getHeight()) / 2 - (getHeightOfNeededArea() * scale ) / 2;
@@ -215,7 +215,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
             if( !(c instanceof AnimatedView) )
                 continue;
             AnimatedView view = (AnimatedView)c;
-            // Setze die neue Position und Größe
+            // Setze die neue Position und Gr��e
             if( c instanceof NodeView )
             {
                 c.setLocation( getScaledX( ((NodeView)c).getVirtualX() - (int)minX ) + x, getScaledY( view.getVirtualY() ) + y);
@@ -237,7 +237,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
             return;
         updateTooltipText();
         double minX = Double.POSITIVE_INFINITY;
-        // Berechnet minimale X Koordinate für verschiebung bei negativen Koordinaten
+        // Berechnet minimale X Koordinate f�r verschiebung bei negativen Koordinaten
         for( Component c : getComponents() )
         {
             if( !(c instanceof AnimatedView) )
@@ -293,7 +293,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
         }
         boolean selected = model.isSelected( layout );
         if( selected )
-        { // Wenn Selected dann Schwarz färben
+        { // Wenn Selected dann Schwarz f�rben
             g.setColor( Color.BLACK );
             if( model.getContainedNodes().size() > 0 )
                 g.setColor( Color.GRAY );
@@ -303,7 +303,7 @@ public class NodeView extends JPanel implements AnimatedView, MouseListener {
         if( model.getRoot( layout ) != model || model.getContainedNodes().size() != 0  )
             linebor.paintBorder( this, g2, 0, 0, getWidth(), getHeight() ); // Falls Subgraph dann nur Rahmen zeichnen
         if( model.isMouseOver() && model.getContainedNodes().size() == 0 )
-        { // Falls maus über dem Knoten dann weiß markieren
+        { // Falls maus �ber dem Knoten dann wei� markieren
             g.setColor( Color.WHITE );
             g.fillOval( getWidth() / 4, getHeight() / 4, getWidth() / 2, getHeight() / 2 );
         }

+ 3 - 3
src/view/OptionsDialog.java

@@ -30,7 +30,7 @@ public class OptionsDialog extends JDialog {
     private int tempFSize = 12;
     
     private static class Options
-    { // Speichert die Optionen wie sie zuletzt waren (um zu prüfen ob was geändert wurde)
+    { // Speichert die Optionen wie sie zuletzt waren (um zu pr�fen ob was ge�ndert wurde)
         public int layoutDisplaySelection = 0;
         public int runStepsSelection = 0;
         public int autoCollapse = 0;
@@ -75,7 +75,7 @@ public class OptionsDialog extends JDialog {
             @Override
             public void actionPerformed(ActionEvent e) {
                 try {
-                	// prüfe auf änderungen
+                    // pr�fe auf �nderungen
                     boolean change = options.layoutDisplaySelection != display.getSelectedIndex() ||
                             options.runStepsSelection != run.getSelectedIndex() ||
                             tempFSize != options.fontSize ||
@@ -87,7 +87,7 @@ public class OptionsDialog extends JDialog {
                     if( change )
                     {
                         for( ActionListener l : listeners )
-                        { // benachrichtige die Listener über die Änderungen
+                        { // benachrichtige die Listener �ber die �nderungen
                             l.actionPerformed( new ActionEvent(this, 0, "Options changed" ) );
                         }
                     }

+ 1 - 1
src/view/PseudoCodeRenderer.java

@@ -19,7 +19,7 @@ import processor.Memory.Visibility;
  *
  */
 public class PseudoCodeRenderer extends DefaultTreeCellRenderer {
-	
+
     private static final long serialVersionUID = 1L;
     
     private Color specialColor = null;