In pgf-umlcd manual the composition and aggregation line are 2 side arrowed. How can I draw one side arrowed that looks like-
These association are described in wikipedia class diagram
In pgf-umlcd manual the composition and aggregation line are 2 side arrowed. How can I draw one side arrowed that looks like-
These association are described in wikipedia class diagram
You'll need to redefine the \aggregation and \composition macros. Try adding
\renewcommand{\aggregation}[4]
{
\draw[umlcd style, -open diamond] (#1) -- (#4)
node[near end, above]{#2}
node[near end, below]{#3};
}
\renewcommand{\composition}[4]
{
\draw[umlcd style, fill=\umldrawcolor, -diamond] (#1) -- (#4)
node[near end, above]{#2}
node[near end, below]{#3};
}
to the preamble after loading pgf-umlcd. The default arrow tip specifications are open diamond-> and diamond->, respectively, so a diamond at the start of the line and a standard arrow tip at the end. With the above modification you'll get just a diamond at the end. If you need the diamonds at the start, use open diamond- and diamond-
\drawis from TikZ, and that package I've learned mainly from its manual and questions/answers on this site. But the code I showed above is simply copied frompgf-umlcd.sty, and then I changed\newcommandto\renewcommand, in addition to the change of the arrow tip specification. – Torbjørn T. Sep 15 '17 at 09:59