# tikz-uml creating components diagrams

I'm trying to setup UML components diagrams, using tikz-uml package. In cause of chujowa documentation I have some question's to you.

1. How can I place provided interface at specified place on specified side of component.
2. How can I name interface with specified name, not just COMPONENT-west-interface
3. How can connect two required interfaces to one provided interface.

Here is a MWE:

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz-uml}

\begin{document}
\begin{tikzpicture}
\umlbasiccomponent{A}
\umlprovidedinterface{A}
\end{tikzpicture}
\end{document}

-
Can you add a small minimal working example (MWE) example to play with? –  percusse Dec 23 '12 at 14:22
@percusse of course –  Meter Dec 23 '12 at 14:45

1. OK I have no idea what a package interface, component etc. (or even UML) is so I'm just following the manual. It looks like it's not possible to change the interface location. It's to the right for provided and to the left for required (might change it but seems unnecessary since the connectors might be enough). I can see in the code that they are hard coded as east and west. But the connectors are open for any kind of path declaration as can be seen from the manual example \umlassemblyconnector (I can't copy it here because the code parts of the manual is not allowing me copy/paste without a lot of cleaning up)
2. This is normally done via the node option alias=... but since tikz-uml is not accepting unrelated options we can enforce it via lower level command \pgfnodealias{newname}{oldname}. Example:

\documentclass{standalone}
\usepackage{tikz-uml}

\begin{document}
\begin{tikzpicture}
\begin{umlcomponent}{Some name}
\umlbasiccomponent[x=2]{A}
\umlprovidedinterface{A}
\umlrequiredinterface[interface=C]{A}
\end{umlcomponent}
\draw[blue,ultra thick] (newname) -- (0,-1); %<- using new name
\end{tikzpicture}
\end{document}


3. This one has more than one right answers. Here I did a quick hack but can be made a little more formal. I've drawn an assembly connector (again no idea!) by supplying an empty text just to fool the code that I've provided a text for the interface (for some reason interface= option is required to draw that symbol) then I've used regular TikZ syntax to draw the line from C. But if I don't use the angle 60 then it points directly to the middle and that's a shame. However, this can also be drawn properly by using a different strategy.

\documentclass{standalone}
\usepackage{tikz-uml}

\begin{document}
\begin{tikzpicture}

\umlbasiccomponent[x=-2]{A}
\umlbasiccomponent[x=4]{B}
\umlbasiccomponent[x=4,y=3]{C}
\umlassemblyconnector[interface={\space},name=abconn]{A}{B}
\draw (C) -| (abconn-interface.60);

\end{tikzpicture}
\end{document}


One last note: you seem to have very particular needs from UML diagram packages (as far as I understand from your other questions) but they are completely unavailable to us. So if you can better formulate your question with a concrete piece of code, I'm sure it would be much faster and easier to reach to a conclusion. As you see it doesn't take too much effort to provide small MWEs however they are instrumental to make a point. Hence, I would encourage you to ask specific working questions. It would be great if you can ask one question at a time because that keeps the scope limited. It would also encourage us to have a go with it.

-
Thank you for your answer, as I see it isn't good package. Some people suggest me to use it, but i wasn't good advice. –  Meter Dec 24 '12 at 10:02
@Meter I don't think so. It looks pretty complete but since I don't know what UMLs are I can't judge its flexibility. –  percusse Dec 24 '12 at 12:14