bootstrapTomEMF.tex 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. %\begin{figure}[H]
  2. % Define the layers to draw the diagram
  3. \pgfdeclarelayer{tomgombackground}
  4. \pgfdeclarelayer{tombackground}
  5. \pgfsetlayers{tomgombackground,tombackground,main}
  6. % Define a new shape: page with a folded corner
  7. \makeatletter
  8. \pgfdeclareshape{flippedpage}{
  9. \inheritsavedanchors[from=rectangle] % this is nearly a rectangle
  10. \inheritanchorborder[from=rectangle]
  11. \inheritanchor[from=rectangle]{center}
  12. \inheritanchor[from=rectangle]{north}
  13. \inheritanchor[from=rectangle]{south}
  14. \inheritanchor[from=rectangle]{west}
  15. \inheritanchor[from=rectangle]{east}
  16. % ... and possibly more
  17. \backgroundpath{% this is new
  18. % store lower left in xa/ya and upper right in xb/yb
  19. \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
  20. \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
  21. % compute corner of ``flipped page''
  22. \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
  23. \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
  24. % diagonal path of the corner
  25. \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
  26. \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
  27. \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}
  28. \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
  29. \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
  30. \pgfpathclose
  31. % add little corner
  32. \pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}
  33. \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
  34. \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
  35. \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
  36. }
  37. }
  38. % Define block styles
  39. \tikzstyle{compiler}=[draw, fill=blue!20, text width=6em, text centered, minimum height=2.5em, rounded corners]
  40. %\tikzstyle{compiler2}=[diamond, aspect=2, draw, fill=blue!20, text centered, rounded corners=1]
  41. \tikzstyle{compiler2}=[diamond, aspect=2, draw, text centered, rounded
  42. corners=1, text width=5em]
  43. %\tikzstyle{code}=[draw,shape=flippedpage,text width=2.7em, text centered, minimum height=3.7em,fill=white]
  44. \tikzstyle{code}=[draw,shape=flippedpage,text width=3em, text centered,
  45. minimum height=4.2em,fill=white]
  46. \tikzstyle{texttitle}=[fill=white, rounded corners, draw=black!50, dashed]
  47. \tikzstyle{background}=[fill=yellow!20, rounded corners, draw=black!50, dashed]
  48. % \begin{center}
  49. \definecolor{myred}{HTML}{d01e1e}
  50. \definecolor{mygreen}{HTML}{129d1c}
  51. \definecolor{myblue}{HTML}{0000FF}
  52. %\begin{tikzpicture}[>=latex, node distance=3cm, on grid, auto]
  53. \begin{tikzpicture}[>=latex, on grid, auto, node distance=2.5cm, scale=1.0]
  54. % Draw diagram elements
  55. \node (tomemf) [compiler2] {\figcode{\textbf{{\tomemf}}}};
  56. \node (manualmapping) [code, above of=tomemf,xshift=-1.5cm] {\figcode{Ecore.tom (manuel)}};
  57. \node (emfmapping) [code, right of=tomemf,xshift=1.0cm] {\figcode{Ecore.tom}};
  58. \node (emfstruct) [code, left of=tomemf,xshift=-1.0cm] {\figcode{Ecore.jar}};
  59. %\node (emf) [compiler2, left of=emfstruct,xshift=-1.0cm] {\figcode{\textbf{{\emf}}}};
  60. %%%
  61. %\node (ecore) [above of=emf,text width=3em, text centered] {\figcode{Ecore.ecore}};
  62. %\node (mm1)[rectangle, minimum width=0.5cm, minimum height=0.5cm,draw,left of=ecore,yshift=0.8cm,xshift=2.2cm]{};
  63. %\node (mm2)[rectangle, minimum width=0.5cm, minimum height=0.5cm,draw,below of=mm1,yshift=1.4cm,xshift=-0.6cm]{};
  64. %\node (mm3)[rectangle, minimum width=0.5cm, minimum height=0.5cm,draw,right of=mm1,yshift=-0.3cm,xshift=-1.5cm]{};
  65. %\path[draw] (mm1) -- (mm2);
  66. %\path[draw] (mm1) -- (mm3);
  67. %%%
  68. % Draw arrows between elements
  69. %\path[->] (ecore) edge (emf);
  70. %\path[->] (emf) edge (emfstruct);
  71. \path[->] (emfstruct) edge (tomemf);
  72. \path[dashed,->] (manualmapping) edge (tomemf);
  73. \path[->] (tomemf) edge (emfmapping);
  74. \draw[dashed,->] (emfmapping) -- ++(0,1.5) -- ++(-3.5,0) -- (tomemf);
  75. \end{tikzpicture}
  76. % \end{center}
  77. % \caption{\emph{Bootstrap} de {\tomemf} : remplacement des ancrages algébriques \texttt{Ecore.tom} écrits manuellement par les ancrages générés}
  78. %\label{fig:bootstrapTomEMF}
  79. %\end{figure}