tomEMF.tex 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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=5.8em]
  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 (tomcomp) [compiler2] {\figcode{\textbf{Compilateur {\tom}}}};
  56. \node (tomcode) [myblue, code, left of=tomcomp,xshift=-1.0cm] {\figcode{Tom
  57. \\ \color{black}{+} \\ \color{myred}{Java}}};
  58. \node (emfmapping) [myblue,code, above of=tomcomp] {\figcode{Ancrages algébriques}};
  59. \node (tomemf) [compiler2, above of=javacode,yshift=1.5cm] {\figcode{\textbf{{\tomemf}}}};
  60. \node (emfstruct) [myred,code, above of=javacomp,yshift=3cm] {\figcode{Structures Java EMF}};
  61. \node (emf) [compiler2, above of=emfmapping,yshift=0.5cm] {\figcode{\textbf{{\emf}}}};
  62. \node (ecore) [mygreen,left of=emf,xshift=-1.5cm,text width=3em, text centered] {\figcode{MM .ecore}};
  63. \node (mm1)[mygreen,rectangle, minimum width=0.5cm, minimum height=0.5cm,draw,left of=ecore,yshift=0.8cm,xshift=2.2cm]{};
  64. \node (mm2)[mygreen,rectangle, minimum width=0.5cm, minimum height=0.5cm,draw,below of=mm1,yshift=1.4cm,xshift=-0.6cm]{};
  65. \node (mm3)[mygreen,rectangle, minimum width=0.5cm, minimum height=0.5cm,draw,right of=mm1,yshift=-0.3cm,xshift=-1.5cm]{};
  66. \path[mygreen,draw] (mm1) -- (mm2);
  67. \path[mygreen,draw] (mm1) -- (mm3);
  68. \node (javacode) [myred,code, right of=tomcomp,xshift=1.0cm] {\figcode{Code Java}};
  69. \node (javacomp) [compiler2, right of=javacode,xshift=1.0cm] {\figcode{\textbf{Compilateur {\java}}}};
  70. %\node (bytecode) [code, right of=javacomp,xshift=1.0cm] {\figcode{110010}\\\figcode{101110}\\\figcode{010100}};
  71. \node (bytecode) [code, below of=javacomp] {\figcode{110010}\\\figcode{101110}\\\figcode{010100}};
  72. \path[->] (javacomp) edge (bytecode);
  73. % Draw arrows between elements
  74. \path[->] (mapping) edge (tomcomp);
  75. \path[->] (tomemf) edge (emfmapping);
  76. \path[->] (emfmapping) edge (tomcomp);
  77. \path[->] (emfstruct) edge (tomemf);
  78. \path[->] (tomcode) edge (tomcomp);
  79. \path[->] (tomcomp) edge (javacode);
  80. \path[->] (javacode) edge (javacomp);
  81. \path[->] (emf) edge (emfstruct);
  82. \path[->] (ecore) edge (emf);
  83. %\draw[->] (emfstruct) -- ++(3.5,0) -- (javacomp);
  84. \draw[->] (emfstruct) edge (javacomp);
  85. \end{tikzpicture}
  86. % \end{center}
  87. % \caption{Processus de compilation d'une transformation de modèles {\tomemf}}
  88. %\label{fig:tomEMF}
  89. %\end{figure}