答案1
您需要重新定义\aggregation
和\composition
宏。尝试添加
\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};
}
加载后添加到前言中pgf-umlcd
。默认箭头提示规格分别为open diamond->
和diamond->
,因此行首为菱形,行尾为标准箭头提示。通过上述修改,您将在行尾获得菱形。如果您需要行首的菱形,请使用open diamond-
和diamond-