picturemmodel.tex 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. %\begin{tikzpicture}[scale=0.7,transform shape]
  2. \begin{tikzpicture}[scale=1,transform shape]
  3. \begin{class}{GeoPicture}{-1,4}
  4. \attribute{name : String}
  5. \end{class}
  6. \begin{class}[text width=2.5cm]{Segment}{4.5,-0.5}
  7. \end{class}
  8. \begin{abstractclass}{Shape}{-2,0}
  9. \attribute{color : Color}
  10. \end{abstractclass}
  11. \begin{class}{Pentagon}{-3,-3}
  12. \inherit{Shape}
  13. \end{class}
  14. \begin{class}{Triangle}{-6,-3}
  15. \inherit{Shape}
  16. \end{class}
  17. \begin{class}{Hexagon}{0,-3}
  18. \inherit{Shape}
  19. \end{class}
  20. \begin{class}{Square}{3,-3}
  21. \inherit{Shape}
  22. \end{class}
  23. \begin{class}{Circle}{6,-3}
  24. \inherit{Shape}
  25. \end{class}
  26. \begin{enum}[text width=2cm]{Color}{5,3}
  27. \attribute{red}
  28. \attribute{green}
  29. \attribute{blue}
  30. \end{enum}
  31. \composition{GeoPicture}{shapes}{0..*}{Shape}
  32. \unidirectionalAssociation{Shape}{picture}{1}{GeoPicture}
  33. \composition{GeoPicture}{segments}{0..*}{Segment}
  34. \unidirectionalAssociation{Segment}{picture}{1}{GeoPicture}
  35. %\association{Segment}{source}{1}{Shape}{0..*}{outgoings}
  36. % \myassociation{Shape}{outgoings}{0..*}{Segment}{1}{source}{0.5,0}{0}
  37. \draw [umlcd style, fill=white] (Segment) --
  38. node[near start, above, anchor=210, xshift=-0.3cm, yshift=-0.15cm]{outgoings}
  39. node[near start, below, anchor=150, xshift=-0.1cm, yshift=-0.05cm]{0..*}
  40. (1.0,0) -- (Shape)
  41. node[near end, below, xshift=-0.35cm, yshift=0.3cm]{1}
  42. node[near end, above, xshift=0.2cm, yshift=0.15cm]{source};
  43. \draw [umlcd style, fill=white] (Segment) --
  44. node[near start, above, anchor=210, xshift=-0.15cm, yshift=-0.35cm] {0..*}
  45. node[near start, above, anchor=150, xshift=-0.7cm, yshift=-0.1cm]{incomings}
  46. (1,-1.2) -- (Shape)
  47. node[near end, below, xshift=-0.35cm, yshift=0.45cm]{1}
  48. node[near end, above, xshift=0.3cm, yshift=-0.1cm]{target};
  49. % \association{Segment}{0..*}{incomings}{Shape}{1}{target}
  50. %\myassociation{Shape}{incomings}{0..*}{Segment}{1}{target}{0.5,-1}{1}
  51. %\draw [umlcd style, fill=white] (Segment) --
  52. %node[near start, below, anchor=150, xshift=-0.5cm]{target}
  53. %node[near start, above, anchor=210, yshift=0.1cm]{1}
  54. %(0.5,-1) -- (Shape)
  55. %node[near end, above, yshift=0.1cm]{0..*}
  56. %node[near end, below, xshift=0.5cm, yshift=0.1cm]{incomings};
  57. \end{tikzpicture}