Kolja Strohm 7 years ago
parent
commit
ad8bb7e3af

+ 10 - 3
doc/chapter/1introduction.tex

@@ -1,3 +1,10 @@
-\TODO{some cool first sentences}
-\TODO{relevance}
-\TODO{related work}
+The phase of placing the nodes is known to be one of the most complicated and hardest to understand from all the phases of the Sugiyama approach~\cite{sugiyama_methods_1981} for graph drawing.
+Still it is one of the most important ones: Here the actual $x$ and $y$ coordinates are assigned to all the nodes.
+Thus we develop an application that not only executes this phase, but also presents intermediate results to the user.
+
+\enquote{\appname} takes as input a hierarchical graph, where all nodes have been assigned to ordered layers.
+Then each stage of the node placing algorithm by Brandes and Köpf~\cite{brandes_fast_2001} can be executed step by step, either on user input or automatically with a certain delay.
+After each step the current progress of the algorithm is displayed visually.
+
+In chapter~\ref{ch:architecture} we provide an overview over the \appname 's architecture and chapter~\ref{ch:progress} lists the main features and their progress.
+\TODO{mention chapter 4?}

+ 10 - 9
doc/chapter/2architecture.tex

@@ -1,6 +1,4 @@
-\TODO{some text}
-
-\section{Assumptions}
+\section{Assumptions}\label{sec:assumptions}
 The following assumptions are made for the implementation of the node placement algorithm:
 \begin{itemize}
     \item There are no hyperedges.
@@ -15,9 +13,10 @@ An example is displayed in figure~\ref{fig:json-example}.
 The structure is as follows:
 \begin{itemize}
     \item The object in the JSON file is a node.
-    \item A node has the attributes that are displayed in table~\ref{table:node-attributes}. \TODO{remove x and y from implementation}
+    \item A node has the attributes that are displayed in table~\ref{table:node-attributes}.
     \item An edge has the attributes that are displayed in table~\ref{table:edge-attributes}.
 \end{itemize}
+For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is used.
 
 
 \centering
@@ -35,7 +34,6 @@ The structure is as follows:
 \label{table:node-attributes}
 \end{longtable}
 
-\centering
 \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
     \hline
     Attribute & Type & Optional & Explanation \\\hline\hline
@@ -46,6 +44,7 @@ The structure is as follows:
 \caption{Edge Attributes}
 \label{table:edge-attributes}
 \end{longtable}
+\raggedright
 
 %\begin{figure}[tp]
 %    \centering
@@ -55,8 +54,7 @@ The structure is as follows:
 %\end{figure}
 
 \begin{figure}
-    %    \lstinputlisting[language=Python,emph={Conv2D,MaxPooling2D,Dropout,Flatten,Sequential,Dense}]{src/keras_example_conv.py}
-    \begin{lstlisting}[language=json,emph={Conv2D,MaxPooling2D,Dropout,Flatten,Sequential,Dense}]
+    \begin{lstlisting}[language=json,emph={}]
     {
        "layers":[
           [
@@ -88,5 +86,8 @@ The structure is as follows:
     \label{fig:json-example}
 \end{figure}
 
-\section{Class Diagrams}\label{sec:classDiagrams}
-\TODO{run vpp}
+\section{Internal graph representation}\label{sec:internalGraphRepresentation}
+\TODO{some class diagram}
+
+\section{TODO: More Class Diagrams}\label{sec:classDiagrams}
+\TODO{maybe even into appendix}

+ 7 - 5
doc/chapter/3progress.tex

@@ -1,12 +1,14 @@
 The following features are either \planned{planned}, \inprogress{under construction} or \done{done}:
 \begin{itemize}
     \item \done{Reading from an input file as described in section~\ref{sec:inputFileFormat}.}
-    \item \inprogress{Drawing a graph with specified node sizes and positions.}
-    \item \inprogress{Running the BK node placement algorithm.}\TODO{cite and refer to in introduction}
-    \item \done{Illustrating the progress of the BK node placement algorithm while it is running.}
-    \item \inprogress{Running the algorithm step by step manually (by pushing a button labeled \enquote{Step}).}
+    \item \done{Drawing a graph with specified node sizes and positions.}
+    \item \inprogress{Running the node placement algorithm by Brandes and Köpf~\cite{brandes_fast_2001}.}
+    \item \done{Illustrating the progress while the algorithm is running.}
+    \item \done{Running the algorithm step by step manually (by pushing a button labeled \enquote{Step}).}
     \item \inprogress{Running the algorithm step by step with configurable delay.}
-    \item \planned{Configuring the verbosity of the animation.}
+    \item \planned{Using debugger-like commands such as \enquote{step into}, \enquote{step over}, \enquote{step out}.}
     \item \done{Working with hierarchical graphs.}
     \item \done{Scaling the display with the (adjustable) window size.}
+    \item \planned{Creating ElkNode~\cite{noauthor_elk:_2018} objects from LayeredNode (\ref{sec:internalGraphRepresentation}) objects}
+    \item \planned{Creating LayeredNode (\ref{sec:internalGraphRepresentation}) objects from ElkNode~\cite{noauthor_elk:_2018} objects (low priority)}
 \end{itemize}

+ 1 - 0
doc/chapter/4retrospection.tex

@@ -0,0 +1 @@
+\TODO{Under construction}

+ 54 - 0
doc/doc.bib

@@ -0,0 +1,54 @@
+
+@incollection{brandes_fast_2001,
+	series = {Lecture {Notes} in {Computer} {Science}},
+	title = {Fast and {Simple} {Horizontal} {Coordinate} {Assignment}},
+	isbn = {978-3-540-43309-5 978-3-540-45848-7},
+	abstract = {We present a simple, linear-time algorithm to determine horizontal coordinates in layered layouts subject to a given ordering within each layer. The algorithm is easy to implement and compares well with existing approaches in terms of assignment quality.},
+	language = {english},
+	urldate = {2018-06-09},
+	booktitle = {Graph {Drawing}},
+	publisher = {Springer, Berlin, Heidelberg},
+	author = {Brandes, Ulrik and Köpf, Boris},
+	month = sep,
+	year = {2001},
+	doi = {10.1007/3-540-45848-4_3},
+	pages = {31--44},
+	file = {Full Text PDF:C\:\\Users\\Eren\\Zotero\\storage\\C6DKECDB\\Brandes and Köpf - 2001 - Fast and Simple Horizontal Coordinate Assignment.pdf:application/pdf}
+}
+
+@misc{leary_json-java:_2018,
+	title = {{JSON}-java: {A} reference implementation of a {JSON} package in {Java}},
+	copyright = {MIT},
+	shorttitle = {{JSON}-java},
+	url = {https://github.com/stleary/JSON-java},
+	urldate = {2018-06-09},
+	author = {Leary, Sean and Crockford, Douglas},
+	month = jun,
+	year = {2018},
+	note = {original-date: 2010-12-21T17:46:09Z}
+}
+
+@article{sugiyama_methods_1981,
+	title = {Methods for {Visual} {Understanding} of {Hierarchical} {System} {Structures}},
+	volume = {11},
+	issn = {0018-9472},
+	doi = {10.1109/TSMC.1981.4308636},
+	abstract = {Two kinds of new methods are developed to obtain effective representations of hierarchies automatically: theoretical and heuristic methods. The methods determine the positions of vertices in two steps. First the order of the vertices in each level is determined to reduce the number of crossings of edges. Then horizontal positions of the vertices are determined to improve further the readability of drawings. The theoretical methods are useful in recognizing the nature of the problem, and the heuristic methods make it possible to enlarge the size of hierarchies with which we can deal. Performance tests of the heuristic methods and several applications are presented.},
+	number = {2},
+	journal = {IEEE Transactions on Systems, Man, and Cybernetics},
+	author = {Sugiyama, K. and Tagawa, S. and Toda, M.},
+	month = feb,
+	year = {1981},
+	keywords = {Computer displays, Constraint theory, Engineering drawings, Flowcharts, Hierarchical systems, Image recognition, Information science, Processor scheduling, Programming, Testing},
+	pages = {109--125}
+}
+
+@misc{noauthor_elk:_2018,
+	title = {{ELK}: {Eclipse} {Layout} {Kernel} - {Automatic} layout for {Java} applications},
+	copyright = {EPL-1.0},
+	shorttitle = {{ELK}},
+	url = {https://github.com/eclipse/elk},
+	publisher = {Eclipse Foundation},
+	month = jun,
+	year = {2018}
+}

+ 3 - 0
doc/doc.tex

@@ -235,6 +235,9 @@ frame=tb}
     \chapter{Current Progress}\label{ch:progress}
     \input{chapter/3progress}
 
+    \chapter{Retrospection}
+    \input{chapter/4retrospection}
+
     \appendix
     \chapter{Appendix}\label{ch:appendix}
     \input{chapter/appendix}

+ 0 - 0
doc/zotero_backup/.keep


+ 180 - 0
doc/zotero_backup/NodePlacementAnimation/NodePlacementAnimation.rdf

@@ -0,0 +1,180 @@
+<rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:z="http://www.zotero.org/namespaces/export#"
+ xmlns:dcterms="http://purl.org/dc/terms/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:bib="http://purl.org/net/biblio#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+ xmlns:link="http://purl.org/rss/1.0/modules/link/"
+ xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/">
+    <bib:BookSection rdf:about="urn:isbn:978-3-540-43309-5%20978-3-540-45848-7">
+        <z:itemType>bookSection</z:itemType>
+        <dcterms:isPartOf>
+            <bib:Book>
+                <dcterms:isPartOf>
+                    <bib:Series>
+                       <dc:title>Lecture Notes in Computer Science</dc:title>
+                    </bib:Series>
+                </dcterms:isPartOf>
+                <dc:identifier>ISBN 978-3-540-43309-5 978-3-540-45848-7</dc:identifier>
+                <dc:title>Graph Drawing</dc:title>
+            </bib:Book>
+        </dcterms:isPartOf>
+        <dc:publisher>
+            <foaf:Organization>
+               <foaf:name>Springer, Berlin, Heidelberg</foaf:name>
+            </foaf:Organization>
+        </dc:publisher>
+        <bib:authors>
+            <rdf:Seq>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Brandes</foaf:surname>
+                        <foaf:givenname>Ulrik</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Köpf</foaf:surname>
+                        <foaf:givenname>Boris</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+            </rdf:Seq>
+        </bib:authors>
+        <link:link rdf:resource="#item_1052"/>
+        <bib:pages>31-44</bib:pages>
+        <dc:date>2001/9/23</dc:date>
+        <dc:description>DOI: 10.1007/3-540-45848-4_3</dc:description>
+        <dcterms:dateSubmitted>2018-06-09 01:12:32</dcterms:dateSubmitted>
+        <z:language>english</z:language>
+        <dcterms:abstract>We present a simple, linear-time algorithm to determine horizontal coordinates in layered layouts subject to a given ordering within each layer. The algorithm is easy to implement and compares well with existing approaches in terms of assignment quality.</dcterms:abstract>
+        <dc:title>Fast and Simple Horizontal Coordinate Assignment</dc:title>
+    </bib:BookSection>
+    <z:Attachment rdf:about="#item_1052">
+        <z:itemType>attachment</z:itemType>
+        <rdf:resource rdf:resource="files/1052/Brandes and Köpf - 2001 - Fast and Simple Horizontal Coordinate Assignment.pdf"/>
+        <dc:identifier>
+            <dcterms:URI>
+                <rdf:value>https://link.springer.com/content/pdf/10.1007%2F3-540-45848-4_3.pdf</rdf:value>
+            </dcterms:URI>
+        </dc:identifier>
+        <dcterms:dateSubmitted>2018-06-09 01:12:33</dcterms:dateSubmitted>
+        <dc:title>Full Text PDF</dc:title>
+        <z:linkMode>1</z:linkMode>
+        <link:type>application/pdf</link:type>
+    </z:Attachment>
+    <bib:Data rdf:about="https://github.com/stleary/JSON-java">
+        <z:itemType>computerProgram</z:itemType>
+        <z:programmers>
+            <rdf:Seq>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Leary</foaf:surname>
+                        <foaf:givenname>Sean</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Crockford</foaf:surname>
+                        <foaf:givenname>Douglas</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+            </rdf:Seq>
+        </z:programmers>
+        <dc:identifier>
+            <dcterms:URI>
+               <rdf:value>https://github.com/stleary/JSON-java</rdf:value>
+            </dcterms:URI>
+        </dc:identifier>
+        <dc:rights>MIT</dc:rights>
+        <dc:date>2018-06-08T16:01:34Z</dc:date>
+        <dc:description>original-date: 2010-12-21T17:46:09Z</dc:description>
+        <dcterms:dateSubmitted>2018-06-09 01:27:34</dcterms:dateSubmitted>
+        <z:libraryCatalog>GitHub</z:libraryCatalog>
+        <z:programmingLanguage>Java</z:programmingLanguage>
+        <dc:title>JSON-java: A reference implementation of a JSON package in Java</dc:title>
+        <z:shortTitle>JSON-java</z:shortTitle>
+    </bib:Data>
+    <bib:Article rdf:about="#item_1059">
+        <z:itemType>journalArticle</z:itemType>
+        <dcterms:isPartOf rdf:resource="urn:issn:0018-9472"/>
+        <bib:authors>
+            <rdf:Seq>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Sugiyama</foaf:surname>
+                        <foaf:givenname>K.</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Tagawa</foaf:surname>
+                        <foaf:givenname>S.</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+                <rdf:li>
+                    <foaf:Person>
+                        <foaf:surname>Toda</foaf:surname>
+                        <foaf:givenname>M.</foaf:givenname>
+                    </foaf:Person>
+                </rdf:li>
+            </rdf:Seq>
+        </bib:authors>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Computer displays</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Constraint theory</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Engineering drawings</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+           <z:AutomaticTag><rdf:value>Flowcharts</rdf:value></z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Hierarchical systems</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Image recognition</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Information science</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+            <z:AutomaticTag>
+               <rdf:value>Processor scheduling</rdf:value>
+            </z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+           <z:AutomaticTag><rdf:value>Programming</rdf:value></z:AutomaticTag>
+        </dc:subject>
+        <dc:subject>
+           <z:AutomaticTag><rdf:value>Testing</rdf:value></z:AutomaticTag>
+        </dc:subject>
+        <bib:pages>109-125</bib:pages>
+        <dc:date>February 1981</dc:date>
+        <z:libraryCatalog>IEEE Xplore</z:libraryCatalog>
+        <dcterms:abstract>Two kinds of new methods are developed to obtain effective representations of hierarchies automatically: theoretical and heuristic methods. The methods determine the positions of vertices in two steps. First the order of the vertices in each level is determined to reduce the number of crossings of edges. Then horizontal positions of the vertices are determined to improve further the readability of drawings. The theoretical methods are useful in recognizing the nature of the problem, and the heuristic methods make it possible to enlarge the size of hierarchies with which we can deal. Performance tests of the heuristic methods and several applications are presented.</dcterms:abstract>
+        <dc:title>Methods for Visual Understanding of Hierarchical System Structures</dc:title>
+    </bib:Article>
+    <bib:Journal rdf:about="urn:issn:0018-9472">
+        <prism:volume>11</prism:volume>
+        <prism:number>2</prism:number>
+        <dc:title>IEEE Transactions on Systems, Man, and Cybernetics</dc:title>
+        <dc:identifier>ISSN 0018-9472</dc:identifier>
+        <dc:identifier>DOI 10.1109/TSMC.1981.4308636</dc:identifier>
+    </bib:Journal>
+</rdf:RDF>

BIN
doc/zotero_backup/NodePlacementAnimation/files/1052/Brandes and Köpf - 2001 - Fast and Simple Horizontal Coordinate Assignment.pdf


+ 37 - 0
src/Algorithms/Animated/AlgorithmStage.java

@@ -0,0 +1,37 @@
+package Algorithms.Animated;
+
+import Algorithms.Animated.BK.BlockCalc;
+
+/**
+ * Represents a specific stage of the algorithm.
+ * Example calculating the blocks, see {@link BlockCalc}.
+ * 
+ * @author kolja
+ *
+ */
+public interface AlgorithmStage {
+    /**
+     * Indicates whether the whole stage is finished.
+     * @author kolja
+     *
+     */
+	public static enum StageStatus
+	{
+		UNFINISHED,
+		FINISHED
+	}
+	
+	/**
+	 * perform one atomic step of the algorithm
+	 * @return whether the whole stage is finished.
+     * For example if all steps are reverted, then {@code FINISHED} is returned.
+	 */
+	public StageStatus forwardStep();
+    
+    /**
+     * undo one atomic step of the algorithm
+     * @return whether the whole stage is finished in backwards direction. 
+     * For example if all steps are reverted, then {@code FINISHED} is returned.
+     */
+	public StageStatus backwardStep();
+}

+ 0 - 13
src/Algorithms/Animated/AlgorithmStep.java

@@ -1,13 +0,0 @@
-package Algorithms.Animated;
-
-public interface AlgorithmStep {
-
-	public static enum StepStatus
-	{
-		UNFINISHED,
-		FINISHED
-	}
-	
-	public StepStatus forwardStep();
-	public StepStatus backwardStep();
-}

+ 1 - 1
src/Algorithms/Animated/AnimatedAlgorithm.java

@@ -2,7 +2,7 @@ package Algorithms.Animated;
 
 import Model.LayeredGraphNode;
 
-public abstract class AnimatedAlgorithm extends Thread implements AlgorithmStep {
+public abstract class AnimatedAlgorithm extends Thread implements AlgorithmStage {
 
 	protected AnimationController ac;
 	protected LayeredGraphNode graph;

+ 24 - 19
src/Algorithms/Animated/BK/BKNodePlacement.java

@@ -1,10 +1,15 @@
 package Algorithms.Animated.BK;
 
-import Algorithms.Animated.AlgorithmStep;
+import Algorithms.Animated.AlgorithmStage;
 import Algorithms.Animated.AnimatedAlgorithm;
 import Algorithms.Animated.AnimationController;
 import Model.LayeredGraphNode;
 
+/**
+ * The main stage of the BK node placement algorithm.
+ * @author kolja
+ *
+ */
 public class BKNodePlacement extends AnimatedAlgorithm {
 
 	/*
@@ -21,69 +26,69 @@ public class BKNodePlacement extends AnimatedAlgorithm {
 	}
 	
 	private State state;
-	private Layout layouts[];
+	private ExtremalLayoutCalc layouts[];
 	private Combine combine;
 	
 	public BKNodePlacement(AnimationController controller, LayeredGraphNode graph) {
 		super(controller, graph);
 		state = State.LAYOUT1;
-		layouts = new Layout[ 4 ];
-		layouts[ 0 ] = new Layout( Layout.LayoutType.TOP_BOTTOM_LEFT, graph );
-		layouts[ 1 ] = new Layout( Layout.LayoutType.TOP_BOTTOM_RIGHT, graph );
-		layouts[ 2 ] = new Layout( Layout.LayoutType.BOTTOM_TOP_LEFT, graph );
-		layouts[ 3 ] = new Layout( Layout.LayoutType.BOTTOM_TOP_RIGHT, graph );
+		layouts = new ExtremalLayoutCalc[ 4 ];
+		layouts[ 0 ] = new ExtremalLayoutCalc( ExtremalLayoutCalc.LayoutType.TOP_BOTTOM_LEFT, graph );
+		layouts[ 1 ] = new ExtremalLayoutCalc( ExtremalLayoutCalc.LayoutType.TOP_BOTTOM_RIGHT, graph );
+		layouts[ 2 ] = new ExtremalLayoutCalc( ExtremalLayoutCalc.LayoutType.BOTTOM_TOP_LEFT, graph );
+		layouts[ 3 ] = new ExtremalLayoutCalc( ExtremalLayoutCalc.LayoutType.BOTTOM_TOP_RIGHT, graph );
 		combine = new Combine( graph );
 	}
 
 	@Override
-	public StepStatus forwardStep() {
+	public StageStatus forwardStep() {
 		switch( state )
 		{
 		case LAYOUT1:
-			if( layouts[ 0 ].forwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 0 ].forwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT2;
 			break;
 		case LAYOUT2:
-			if( layouts[ 1 ].forwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 1 ].forwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT3;
 			break;
 		case LAYOUT3:
-			if( layouts[ 2 ].forwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 2 ].forwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT4;
 			break;
 		case LAYOUT4:
-			if( layouts[ 3 ].forwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 3 ].forwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.COMBINE;
 			break;
 		case COMBINE:
 			return combine.forwardStep();
 		}
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 
 	@Override
-	public StepStatus backwardStep() {
+	public StageStatus backwardStep() {
 		switch( state )
 		{
 		case LAYOUT1:
 			return layouts[ 0 ].backwardStep();
 		case LAYOUT2:
-			if( layouts[ 1 ].backwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 1 ].backwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT1;
 			break;
 		case LAYOUT3:
-			if( layouts[ 2 ].backwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 2 ].backwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT2;
 			break;
 		case LAYOUT4:
-			if( layouts[ 3 ].backwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( layouts[ 3 ].backwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT3;
 			break;
 		case COMBINE:
-			if( combine.backwardStep() == AlgorithmStep.StepStatus.FINISHED )
+			if( combine.backwardStep() == AlgorithmStage.StageStatus.FINISHED )
 				state = State.LAYOUT4;
 			break;
 		}
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 }

+ 21 - 16
src/Algorithms/Animated/BK/BlockCalc.java

@@ -3,12 +3,17 @@ package Algorithms.Animated.BK;
 import java.awt.Color;
 import java.util.ArrayList;
 
-import Algorithms.Animated.AlgorithmStep;
+import Algorithms.Animated.AlgorithmStage;
 import Algorithms.Animated.BackwardAction;
 import Model.LayeredGraphEdge;
 import Model.LayeredGraphNode;
 
-public class BlockCalc implements AlgorithmStep {
+/**
+ * The stage of the BK node placement algorithm where the blocks are computed.
+ * @author kolja
+ *
+ */
+public class BlockCalc implements AlgorithmStage {
 
 	private int layerIndex;
 	private int nodeIndex;
@@ -37,15 +42,15 @@ public class BlockCalc implements AlgorithmStep {
 	}
 	
 	@Override
-	public StepStatus forwardStep() {
+	public StageStatus forwardStep() {
 		LayeredGraphNode current = graph.getContainedLayers().get( layerIndex ).get( nodeIndex );
 		current.setSelected();
 		if( current.getContainedNodes().size() > 0 )
 		{
 			if( subgraphAlgs.get( layerIndex ).get( nodeIndex ) == null )
 				subgraphAlgs.get( layerIndex ).set( nodeIndex, new BKNodePlacement( null, current ) );
-			if( subgraphAlgs.get( layerIndex ).get( nodeIndex ).forwardStep() == StepStatus.UNFINISHED )
-				return StepStatus.UNFINISHED;
+			if( subgraphAlgs.get( layerIndex ).get( nodeIndex ).forwardStep() == StageStatus.UNFINISHED )
+				return StageStatus.UNFINISHED;
 		}
 		ArrayList< LayeredGraphEdge > incommingEdges = current.getIncomingEdges();
 		if( incommingEdges.size() == 0 )
@@ -107,12 +112,12 @@ public class BlockCalc implements AlgorithmStep {
 		return calcNextState();
 	}
 	
-	private StepStatus calcNextState()
+	private StageStatus calcNextState()
 	{
 		if( layerIndex >= graph.getContainedLayers().size() - 1 )
 		{
 			if( nodeIndex >= graph.getContainedLayers().get( layerIndex ).size() -1 )
-				return StepStatus.FINISHED;
+				return StageStatus.FINISHED;
 		}
 		nodeIndex++;
 		if( nodeIndex >= graph.getContainedLayers().get( layerIndex ).size() )
@@ -125,23 +130,23 @@ public class BlockCalc implements AlgorithmStep {
 			   this.r = oldR;
 			});
 		}
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 
 	@Override
-	public StepStatus backwardStep() {
+	public StageStatus backwardStep() {
 		if( subgraphAlgs.get( layerIndex ).get( nodeIndex ) != null )
 		{
-			if( subgraphAlgs.get( layerIndex ).get( nodeIndex ).backwardStep() == StepStatus.UNFINISHED )
+			if( subgraphAlgs.get( layerIndex ).get( nodeIndex ).backwardStep() == StageStatus.UNFINISHED )
 			{
 				LayeredGraphNode current = graph.getContainedLayers().get( layerIndex ).get( nodeIndex );
 				current.setSelected();
 				//current.update();
-				return StepStatus.UNFINISHED;
+				return StageStatus.UNFINISHED;
 			}
 		}
-		StepStatus status = calcBeforeState();
-		if( status == StepStatus.FINISHED )
+		StageStatus status = calcBeforeState();
+		if( status == StageStatus.FINISHED )
 			return status;
 		LayeredGraphNode current = graph.getContainedLayers().get( layerIndex ).get( nodeIndex );
 		current.setSelected();
@@ -154,12 +159,12 @@ public class BlockCalc implements AlgorithmStep {
 		return status;
 	}
 	
-	private StepStatus calcBeforeState()
+	private StageStatus calcBeforeState()
 	{
 		if( layerIndex == 0 )
 		{
 			if( nodeIndex == 0 )
-				return StepStatus.FINISHED;
+				return StageStatus.FINISHED;
 		}
 		nodeIndex--;
 		if( nodeIndex < 0 )
@@ -169,6 +174,6 @@ public class BlockCalc implements AlgorithmStep {
 	        backwards.remove( 0 );
 			nodeIndex = graph.getContainedLayers().get( layerIndex ).size() - 1;
 		}
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 }

+ 9 - 4
src/Algorithms/Animated/BK/Combine.java

@@ -1,9 +1,14 @@
 package Algorithms.Animated.BK;
 
-import Algorithms.Animated.AlgorithmStep;
+import Algorithms.Animated.AlgorithmStage;
 import Model.LayeredGraphNode;
 
-public class Combine implements AlgorithmStep {
+/**
+ * The stage of the combination of the four extremal layouts.
+ * @author kolja
+ *
+ */
+public class Combine implements AlgorithmStage {
 
 	public Combine( LayeredGraphNode graph )
 	{
@@ -11,13 +16,13 @@ public class Combine implements AlgorithmStep {
 	}
 	
 	@Override
-	public StepStatus forwardStep() {
+	public StageStatus forwardStep() {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
-	public StepStatus backwardStep() {
+	public StageStatus backwardStep() {
 		// TODO Auto-generated method stub
 		return null;
 	}

+ 13 - 8
src/Algorithms/Animated/BK/Compaction.java

@@ -2,11 +2,16 @@ package Algorithms.Animated.BK;
 
 import java.util.ArrayList;
 
-import Algorithms.Animated.AlgorithmStep;
+import Algorithms.Animated.AlgorithmStage;
 import Algorithms.Animated.BackwardAction;
 import Model.LayeredGraphNode;
 
-public class Compaction implements AlgorithmStep{
+/**
+ * The stage of compacting the layout.
+ * @author kolja
+ *
+ */
+public class Compaction implements AlgorithmStage{
 
 	private enum CompactionState
 	{
@@ -46,7 +51,7 @@ public class Compaction implements AlgorithmStep{
 	}
 	
 	@Override
-	public StepStatus forwardStep() {
+	public StageStatus forwardStep() {
 		int acSize = actions.size();
 		if( state == CompactionState.PLACE_BLOCKS )
 		{
@@ -206,20 +211,20 @@ public class Compaction implements AlgorithmStep{
 			} );
 			vIndex++;
 			if( vIndex >= graph.getContainedNodes().size() )
-				return StepStatus.FINISHED;
+				return StageStatus.FINISHED;
 		}
 		if( actions.size() != acSize + 1 )
 			System.out.println( "ERROR" );
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 
 	@Override
-	public StepStatus backwardStep() {
+	public StageStatus backwardStep() {
 		if( actions.size() == 0 )
-			return StepStatus.FINISHED;
+			return StageStatus.FINISHED;
 		actions.get( 0 ).reverse();
 		actions.remove( 0 );
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 
 }

+ 15 - 10
src/Algorithms/Animated/BK/Layout.java → src/Algorithms/Animated/BK/ExtremalLayoutCalc.java

@@ -1,9 +1,14 @@
 package Algorithms.Animated.BK;
 
-import Algorithms.Animated.AlgorithmStep;
+import Algorithms.Animated.AlgorithmStage;
 import Model.LayeredGraphNode;
 
-public class Layout implements AlgorithmStep {
+/**
+ * The stage where the for extremal layouts are computed.
+ * @author kolja
+ *
+ */
+public class ExtremalLayoutCalc implements AlgorithmStage {
 
 	public enum LayoutType{
 		TOP_BOTTOM_LEFT,
@@ -24,7 +29,7 @@ public class Layout implements AlgorithmStep {
 	private LayoutState status;
 	
 	
-	public Layout( LayoutType typ, LayeredGraphNode graph )
+	public ExtremalLayoutCalc( LayoutType typ, LayeredGraphNode graph )
 	{
 		status = LayoutState.BLOCK_CALCULATION;
 		this.typ = typ;
@@ -33,30 +38,30 @@ public class Layout implements AlgorithmStep {
 	}
 	
 	@Override
-	public StepStatus forwardStep() {
+	public StageStatus forwardStep() {
 		if( status == LayoutState.BLOCK_CALCULATION )
 		{
-			if( bc.forwardStep() == StepStatus.FINISHED )
+			if( bc.forwardStep() == StageStatus.FINISHED )
 			{
 				status = LayoutState.COMPACTION;
 			}
-			return StepStatus.UNFINISHED;
+			return StageStatus.UNFINISHED;
 		}
 		if( status == LayoutState.COMPACTION )
 			return cp.forwardStep();
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 
 	@Override
-	public StepStatus backwardStep() {
+	public StageStatus backwardStep() {
 		if( status == LayoutState.BLOCK_CALCULATION )
 			return bc.backwardStep();
 		if( status == LayoutState.COMPACTION )
 		{
-			if( cp.backwardStep() == StepStatus.FINISHED )
+			if( cp.backwardStep() == StageStatus.FINISHED )
 				status = LayoutState.BLOCK_CALCULATION;
 		}
-		return StepStatus.UNFINISHED;
+		return StageStatus.UNFINISHED;
 	}
 
 }

+ 9 - 1
src/Algorithms/Animated/BackwardAction.java

@@ -1,6 +1,14 @@
 package Algorithms.Animated;
 
+/**
+ * An action that reverts another Action.
+ * For example this is used to go one step backwards in the node placement algorithm.
+ * @author kolja
+ *
+ */
 public interface BackwardAction {
-
+    /**
+     * Undo another action.
+     */
 	public void reverse();
 }

+ 5 - 4
src/View/EdgeView.java

@@ -13,11 +13,12 @@ import javax.swing.JPanel;
 
 import Model.LayeredGraphEdge;
 
+/**
+ * A drawable representation of an edge.
+ * @author kolja
+ *
+ */
 public class EdgeView extends JPanel {
-
-    /**
-     * 
-     */
     private static final long serialVersionUID = 1L;
 
     private LayeredGraphEdge model;

+ 12 - 1
src/View/MainView.java

@@ -13,11 +13,22 @@ import IO.Writer;
 import Model.LayeredGraphEdge;
 import Model.LayeredGraphNode;
 
+/**
+ * The main window of the application.
+ * @author kolja
+ *
+ */
 public class MainView {
-
+    /**
+     * The 'frame' of the main window.
+     */
 	public static JFrame frame;
 	AnimationController controller;
 	
+	/**
+	 * Initialize the window and its contents.
+	 * @param graph the graph that is displayed in this window.
+	 */
 	public MainView( LayeredGraphNode graph )
 	{
 		controller = new AnimationController();

+ 5 - 4
src/View/NodeView.java

@@ -11,11 +11,12 @@ import javax.swing.*;
 
 import Model.LayeredGraphNode;
 
+/**
+ * A drawable representation of a node.
+ * @author kolja
+ *
+ */
 public class NodeView extends JPanel {
-
-	/**
-	 * 
-	 */
 	private static final long serialVersionUID = 1L;
 	private LayeredGraphNode model;
 	

+ 11 - 1
src/View/RenderHelper.java

@@ -5,8 +5,18 @@ import java.awt.Polygon;
 import java.awt.Shape;
 import java.awt.geom.AffineTransform;
 
+/**
+ * Contains helper functions for the views.
+ * @author kolja
+ *
+ */
 public class RenderHelper {
-
+    /**
+     * creates an arrow shape to draw it, for example as an edge.
+     * @param fromPt the starting point of the arrow
+     * @param toPt the destination point of the arrow
+     * @return the shape
+     */
     public static Shape createArrowShape(Point fromPt, Point toPt) {
         Polygon arrowPolygon = new Polygon();
         arrowPolygon.addPoint(-3,6);