]> git.uio.no Git - ifi-stolz-refaktor.git/commitdiff
Thesis: adding first try on listing to explain text selections
authorErlend Kristiansen <erlenkr@ifi.uio.no>
Wed, 26 Mar 2014 19:43:10 +0000 (20:43 +0100)
committerErlend Kristiansen <erlenkr@ifi.uio.no>
Wed, 26 Mar 2014 19:43:10 +0000 (20:43 +0100)
thesis/master-thesis-erlenkr.tex

index 10a327b88fd4d73673ed755186399c649ca4a933..6c1466ef151a724516ab1dc98b5dc232c4739504 100644 (file)
@@ -1720,6 +1720,46 @@ temporary set. Then the temporary set of selections is added to the set of
 generated text selections. The result of adding two text selections is a new 
 text selection spanned out by the two addends. 
 
+\begin{listing}[h]
+\def\charwidth{5.7pt}
+\def\indent{4*\charwidth}
+\def\lineheight{\baselineskip}
+\def\mintedtop{\lineheight}
+
+\begin{tikzpicture}[overlay, yscale=-1]
+  \tikzstyle{overlaybox}=[fill=lightgray,opacity=0.2]
+
+  \draw[overlaybox] (2*\charwidth,\mintedtop) rectangle 
+  +(18*\charwidth,\lineheight);
+
+  \draw[overlaybox] (2*\charwidth,\mintedtop+\lineheight) rectangle 
+  +(18*\charwidth,\lineheight);
+
+  \draw[overlaybox] (2*\charwidth,\mintedtop+3*\lineheight) rectangle 
+  +(18*\charwidth,\lineheight);
+
+  \draw[overlaybox] (\indent-3*\charwidth,\mintedtop) rectangle 
+  +(20*\charwidth,2*\lineheight);
+
+  \draw[overlaybox] (3*\charwidth,\mintedtop+\lineheight) rectangle 
+  +(16*\charwidth,3*\lineheight);
+
+  \draw[overlaybox] (\indent,\mintedtop) rectangle 
+  +(14*\charwidth,4*\lineheight);
+\end{tikzpicture}
+\begin{minted}{java}
+    statement one;
+    statement two;
+    ...
+    statement k;
+\end{minted}
+\caption{Example of how the text selections generator would generate text 
+  selections based on a lists of statements. Each highlighted rectangle 
+represents a text selection.}
+\label{lst:textSelectionsExample}
+\end{listing}
+\todoin{fix \myref{lst:textSelectionsExample}}
+
 \paragraph{Finding the candidate} for the refactoring is done by analyzing all 
 the generated text selection with the \type{ExtractAndMoveMethodAnalyzer} 
 \see{extractAndMoveMethodAnalyzer}. If the analyzer generates a useful result,