|
@@ -20,65 +20,70 @@ The structure is as follows:
|
|
|
\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}.
|
|
|
\item An edge has the attributes that are displayed in table~\ref{table:edge-attributes}.
|
|
|
+ \item Any additional attributes not listed here are ignored.
|
|
|
+ For example they can be used as comment fields, to make the file more readable.
|
|
|
\end{itemize}
|
|
|
For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is used.
|
|
|
The classes for reading and writing those JSON files are displayed in figure~\ref{fig:io}.
|
|
|
The internal representation of graphs is further explained in the section~\ref{sec:model}.
|
|
|
|
|
|
\centering
|
|
|
-\begin{longtable}{|p{1.8cm}|p{2.3cm}|p{1.7cm}|p{8.5cm}|}
|
|
|
+\begin{longtable}{|l|l|l|p{8.5cm}|}
|
|
|
\hline
|
|
|
Attribute & Type & Optional & Explanation \\\hline\hline
|
|
|
name & string & yes & If not omitted, this must be unique for a given parent node. \\\hline
|
|
|
width & integer & yes & The minimum width of the node.
|
|
|
- The node can be wider if it contains other nodes that need more space. \\\hline
|
|
|
+ The node can be wider if it contains other nodes that need more space.
|
|
|
+ If the whole layout is too large, it is resized, such that all nodes are proportionately shrunk: In that case the minimum width can be undercut.
|
|
|
+ Default 40.\\\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
|
|
|
+ The node can be higher if it contains other nodes that need more space.
|
|
|
+ If the whole layout is too large, it is resized, such that all nodes are proportionately shrunk: In that case the minimum height can be undercut.
|
|
|
+ Default 40.\\\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}
|
|
|
+ layers & < < node > > & yes & The layers of nodes inside this node (Hierarchy). \\\hline
|
|
|
+ edges & < edge > & yes & The edges between nodes whose parent node is this node. \\\hline
|
|
|
+ \caption{Node Attributes. < \emph{element type} > is a list.}
|
|
|
\label{table:node-attributes}
|
|
|
\end{longtable}
|
|
|
+\raggedright
|
|
|
|
|
|
-\begin{figure}[tp]
|
|
|
+\begin{figure}[htp]
|
|
|
\centering
|
|
|
- \includegraphics[width=\linewidth, trim={0 20cm 0 0}]{img/IO.pdf}
|
|
|
- \caption[Class diagram of the \enquote{IO} package]{Class diagram of the \enquote{IO} package, containing utilities for reading and writing graphs.}
|
|
|
+ \includegraphics[width=\linewidth,trim=0 20cm 0 0,clip]{img/io.pdf}
|
|
|
+ \caption[Class diagram of the \enquote{graph.io} package]{Class diagram of the \enquote{graph.io} package, containing utilities for reading and writing graphs.}
|
|
|
\label{fig:io}
|
|
|
\end{figure}
|
|
|
|
|
|
-\newpage
|
|
|
-
|
|
|
-\TODO{attribute for dummy nodes}
|
|
|
-\begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
|
|
|
- \hline
|
|
|
- Attribute & Type & Optional & Explanation \\\hline\hline
|
|
|
- source & string & no & The name of the source of this edge.
|
|
|
- Must be a node with the same parent node as the node specified by the \enquote{target} attribute. \\\hline
|
|
|
- target & string & no & The name of the target of this edge.
|
|
|
- Must be a node with the same parent node as the node specified by the \enquote{source} attribute. \\\hline
|
|
|
+\begin{table}[htp]
|
|
|
+ \centering
|
|
|
+ \begin{longtable}{|l|l|l|p{8.5cm}|}
|
|
|
+ \hline
|
|
|
+ Attribute & Type & Optional & Explanation \\\hline\hline
|
|
|
+ source & string & no & The name of the source of this edge.
|
|
|
+ Must be a node with the same parent node as the node specified by the \enquote{target} attribute. \\\hline
|
|
|
+ target & string & no & The name of the target of this edge.
|
|
|
+ Must be a node with the same parent node as the node specified by the \enquote{source} attribute. \\\hline
|
|
|
+ \end{longtable}
|
|
|
\caption{Edge Attributes}
|
|
|
\label{table:edge-attributes}
|
|
|
-\end{longtable}
|
|
|
-\raggedright
|
|
|
+\end{table}
|
|
|
|
|
|
-%\begin{figure}[tp]
|
|
|
+%\begin{figure}[htp]
|
|
|
% \centering
|
|
|
% \includegraphics[width=0.9\textwidth]{img/json.png}
|
|
|
% \caption[Input file format]{Input file format illustrated as a HERM diagram}
|
|
|
% \label{fig:iff}
|
|
|
%\end{figure}
|
|
|
|
|
|
-\TODO{Kante in beispielJSON}
|
|
|
\begin{figure}
|
|
|
- \begin{lstinputlisting}[language=json,emph={}]{img/graph.json}
|
|
|
+ \begin{lstinputlisting}[language=json,emph={}]{src/graph.json}
|
|
|
\end{lstinputlisting}
|
|
|
\caption[Example Input File]{Example Input file that is understood by \appname.}
|
|
|
\label{fig:json-example}
|
|
|
\end{figure}
|
|
|
|
|
|
-\section{Internal graph representation, \enquote{Model}}\label{sec:model}
|
|
|
+\section{Internal graph representation, \enquote{graph}}\label{sec:model}
|
|
|
One feature that is important to us, is to be able to work with hierarchical graphs (cf.\ chapter~\ref{ch:progress}).
|
|
|
Therefore a node not only has edges to other nodes, but also it can contain other nodes and edges.
|
|
|
So far this is similar to what we described in section~\ref{sec:inputFileFormat}.
|
|
@@ -97,31 +102,35 @@ Similarly, edges have additional attributes:
|
|
|
\item \enquote{bindPoints} is a list of bend points for the edge, including the beginning and end point of the edge.
|
|
|
\end{itemize}
|
|
|
|
|
|
-A class diagram of the package \enquote{Model} is displayed in figure~\ref{fig:model}.
|
|
|
+A class diagram of the package \enquote{graph} is displayed in figure~\ref{fig:model}.
|
|
|
|
|
|
-\begin{figure}[tp]
|
|
|
+\begin{figure}[htp]
|
|
|
\centering
|
|
|
- \includegraphics[width=\linewidth, trim={0 6cm 0 0}]{img/Model.pdf}
|
|
|
- \caption{Class diagram of the \enquote{Model} package.}
|
|
|
+ \includegraphics[width=\linewidth,trim=0 6cm 0 0,clip]{img/model.pdf}
|
|
|
+ \caption{Class diagram of the \enquote{graph} package.}
|
|
|
\label{fig:model}
|
|
|
\end{figure}
|
|
|
|
|
|
-\begin{longtable}{|p{2.8cm}|p{10cm}|}
|
|
|
- \hline
|
|
|
- Attribute & Explanation \\\hline\hline
|
|
|
- root & The root node of the block of this node.
|
|
|
- Unique for all nodes in the same block. \\\hline
|
|
|
- sink & The topmost sink in the block graph that can be reached from the block that this node belongs to.
|
|
|
- Only used for nodes that are the root of a block.
|
|
|
- Unique for all nodes in the same class. \\\hline
|
|
|
- shift & The shift of the class that this node belongs to.
|
|
|
- Only used for nodes that are a sink of a class. \\\hline
|
|
|
+
|
|
|
+\begin{table}[htp]
|
|
|
+ \begin{longtable}{|l|p{10cm}|}
|
|
|
+ \hline
|
|
|
+ Attribute & Explanation \\\hline\hline
|
|
|
+ root & The root node of the block of this node.
|
|
|
+ Unique for all nodes in the same block. \\\hline
|
|
|
+ sink & The topmost sink in the block graph that can be reached from the block that this node belongs to.
|
|
|
+ Only used for nodes that are the root of a block.
|
|
|
+ Unique for all nodes in the same class. \\\hline
|
|
|
+ shift & The shift of the class that this node belongs to.
|
|
|
+ Only used for nodes that are a sink of a class. \\\hline
|
|
|
+ \end{longtable}
|
|
|
\caption{Variables also used by Brandes and Köpf~\cite{brandes_fast_2001}}
|
|
|
\label{table:bk-variables}
|
|
|
-\end{longtable}
|
|
|
+\end{table}
|
|
|
|
|
|
\section{The actual algorithm}\label{sec:theActualAlgorithm}
|
|
|
-This section assumes that the reader is familiar with the node placement algorithm by Brandes and Köpf~\cite{brandes_fast_2001}.
|
|
|
+This section expects the reader to be familiar with the node placement algorithm by Brandes and Köpf~\cite{brandes_fast_2001}.
|
|
|
+We recommend section 3.2.1 of Carstens~\cite{carstens_node_2012} for a detailed explanation.
|
|
|
|
|
|
A \enquote{stage} of the algorithm, interface \enquote{AlgorithmStage}, is an interval during which each step of the algorithm is performed in a similar way.
|
|
|
Each time such a step is performed it returns whether the stage is already finished.
|
|
@@ -142,10 +151,11 @@ This works the following:
|
|
|
\item The algorithm potentially calls the step function of other alogrithms while executing one step.
|
|
|
\end{enumerate}
|
|
|
|
|
|
-\begin{figure}[tp]
|
|
|
+\TODO{outdated}
|
|
|
+\begin{figure}[htp]
|
|
|
\centering
|
|
|
- \includegraphics[width=\linewidth, trim={0 9cm 0 0}]{img/Algorithms_Animated.pdf}
|
|
|
- \caption{Class diagram of the package \enquote{Algorithms.Animated}.}
|
|
|
+ \includegraphics[width=\linewidth,trim=0 9cm 0 0,clip]{img/algorithms_animated.pdf}
|
|
|
+ \caption{Class diagram of the package \enquote{algorithms.animated}.}
|
|
|
\label{fig:animated}
|
|
|
\end{figure}
|
|
|
|
|
@@ -158,5 +168,5 @@ The distinguish two kinds of views:
|
|
|
\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.
|
|
|
+ For this they have to know about which part of the graph and which layout they belong to.
|
|
|
\end{itemize}
|