|
@@ -6,8 +6,12 @@ The following assumptions are made for the implementation of the node placement
|
|
|
\item There are no labels.
|
|
|
\item There are no cross-hierarchy edges.
|
|
|
\item No edges over multiple layers (the previous phases should have added dummy nodes).
|
|
|
+ \item Graphs are connected (maybe we will get rid of this assumption later, see~\ref{ch:progress}).
|
|
|
\end{itemize}
|
|
|
|
|
|
+\section{Components}\label{sec:components}
|
|
|
+\TODO{rough architecture}
|
|
|
+
|
|
|
\section{Input File Format}\label{sec:inputFileFormat}
|
|
|
The input to \appname is a JSON file.
|
|
|
An example is displayed in figure~\ref{fig:json-example}.
|
|
@@ -30,6 +34,7 @@ The internal representation of graphs is further explained in the section~\ref{s
|
|
|
The node can be wider if it contains other nodes that need more space. \\\hline
|
|
|
height & integer & yes & The minimum height of the node.
|
|
|
The node can be higher if it contains other nodes that need more space. \\\hline
|
|
|
+ dummy & boolean & yes & Iff this is set to yes, then the node is a dummy node. \\\hline
|
|
|
layers & list of lists of nodes & yes & The layers of nodes inside this node (Hierarchy). \\\hline
|
|
|
edges & list of edges & yes & The edges between nodes whose parent node is this node. \\\hline
|
|
|
\caption{Node Attributes}
|
|
@@ -83,6 +88,7 @@ Additionally, there are multiple attributes that are used during the computation
|
|
|
They are summarized in table~\ref{table:bk-variables}.
|
|
|
\item The \enquote{parent} of a node is the node that contains it in the hierarchy.
|
|
|
\item The attributes $x$ and $y$ are the coordinates of the node relative to its parent node.
|
|
|
+ There is one coordinate for each of the four extremal layouts and on coordinate for the combined layout.
|
|
|
\end{itemize}
|
|
|
Similarly, edges have additional attributes:
|
|
|
\begin{itemize}
|
|
@@ -124,6 +130,18 @@ All the stages are displayed in class diagram~\ref{fig:animated}.
|
|
|
|
|
|
To be able to undo a step each stage needs to implement methods for both forward and backward steps.
|
|
|
|
|
|
+Note that the \enquote{AnimationController} is not a controller in the MVC sense that it processes user input, but in the sense that it \enquote{controls} the execution of steps/stages.
|
|
|
+This works the following:
|
|
|
+\begin{enumerate}
|
|
|
+ \item The main view creates a node placement algorithm (only \enquote{BKNodePlacement} available).
|
|
|
+ It sends a controller as a parameter for the constructor.
|
|
|
+ \item The algorithm concurrently asks the AnimationController if it should do a forward or backward step.
|
|
|
+ \item The AnimationController waits until it knows which action to take (for example if the user pressed the right arrow key).
|
|
|
+ Alternatively, if the animation is not paused, then it waits until a specific delay has passed.
|
|
|
+ Then it returns to the algorithm which step to take next.
|
|
|
+ \item The algorithm potentially calls the step function of other alogrithms while executing one step.
|
|
|
+\end{enumerate}
|
|
|
+
|
|
|
\begin{figure}[tp]
|
|
|
\centering
|
|
|
\includegraphics[width=\linewidth, trim={0 9cm 0 0}]{img/Algorithms_Animated.pdf}
|
|
@@ -135,4 +153,10 @@ To be able to undo a step each stage needs to implement methods for both forward
|
|
|
This section only covers the software architecture regarding the views.
|
|
|
For an explanation of what is actually displayed, see chapter~\ref{ch:ui}
|
|
|
|
|
|
-\TODO{Kolja ausfragen}
|
|
|
+The distinguish two kinds of views:
|
|
|
+\begin{itemize}
|
|
|
+ \item The main window displays four regions for the different extremal layouts while also forwarding keyboard commands to the AnimationController.
|
|
|
+ For this we use a JFrame from the Swing library.
|
|
|
+ \item \enquote{EdgeView} and \enquote{NodeView} are JPanels, which means they can be drawn onto the JFrame.
|
|
|
+ For this they have to know about which part of the model and which layout they belong to.
|
|
|
+\end{itemize}
|