tomSystemContrib.tex 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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{compiler}=[diamond, aspect=2, draw, fill=blue!20, text centered, rounded corners=1]
  41. \tikzstyle{compiler2}=[diamond, aspect=2, draw, text centered, rounded corners=1]
  42. %\tikzstyle{code}=[draw,shape=flippedpage,text width=2.7em, text centered, minimum height=3.7em,fill=white]
  43. \tikzstyle{code}=[draw,shape=flippedpage,text width=3em, text centered,
  44. minimum height=4.2em,fill=white]
  45. \tikzstyle{texttitle}=[fill=white, rounded corners, draw=black!50, dashed]
  46. \tikzstyle{background}=[fill=yellow!20, rounded corners, draw=black!50, dashed]
  47. \begin{center}
  48. \begin{tikzpicture}
  49. % Draw diagram elements
  50. \node (mapping) [code, dashed] {\figcode{Ancrages algébriques}};
  51. \path (mapping.east)+(3,-2.5) node (datastruct)[code]
  52. {\figcode{Java EMF (MM)}};
  53. \path (mapping.west)+(-3,2.5) node (tomcode)[code, dashed]
  54. {\figcode{Tom \\ + \\ Java}};
  55. \path (tomcode.east)+(3,0) node (tomcomp)[compiler2, dashed]
  56. {\figcode{Compilateur {\tom}}};
  57. \path (mapping.east)+(3,2.5) node (javacode)[code]
  58. {\figcode{Code Java}};
  59. \path (mapping.east)+(6,2.5) node (javacomp)[compiler2]
  60. {\figcode{Compilateur Java}};
  61. \path (mapping.east)+(9,2.5) node (bytecode)[code]
  62. {\figcode{110010}\\\figcode{101110}\\\figcode{010100}};
  63. \path (mapping.east)+(3,0.5) node (trace)[code, dashed]
  64. {\figcode{MM de\\ lien}};
  65. % Draw gom side
  66. \path (datastruct.west)+(-3,0) node (emfcomp)[compiler2, dashed]
  67. {\figcode{Tom-EMF}};
  68. % Draw arrows between elements
  69. \path [draw, ->] (emfcomp.north) -- node [below] {} (mapping);
  70. \path [draw, ->] (mapping.north) -- node [below] {} (tomcomp);
  71. \path [draw, ->] (datastruct.west) -- node [right] {} (emfcomp);
  72. \path [draw, ->] (datastruct) -- ++(3.0,0) -- node [below] {} (javacomp);
  73. \path [draw, ->] (tomcode.east) -- node [left] {} (tomcomp);
  74. \path [draw, ->] (tomcomp.east) -- node [left] {} (javacode);
  75. \path [draw, ->] (javacode.east) -- node [left] {} (javacomp);
  76. \path [draw, ->] (javacomp.east) -- node [left] {} (bytecode);
  77. \path [draw, dashed, ->] (tomcomp) -- node [left] {} (trace);
  78. \path [draw, ->] (trace) -- node [left] {} (javacomp);
  79. \end{tikzpicture}
  80. \end{center}
  81. \caption{Contributions au système {\tom}}
  82. \label{fig:tomSystemContrib}
  83. \end{figure}