3

I want to connect UML classes both on the east side with pst-uml. Sadly the documentation is french and /usr/share/texmf-dist/tex/latex/pst-uml did not help neither.

Concept (Dia)

Concept

Current status (pst-uml, texlive-pstricks 2011.22586-1)

Current status

Source

\documentclass[a4paper,12pt]{article}

\usepackage{fullpage}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{pst-uml}

\begin{document}

\begin{center}
\begin{pspicture}(10,3)\psgrid
    \rput[r](4,1){\rnode{lorem}{
        \umlClass{LoremText}{}
    }}

    \rput[l](6,2){\rnode{ipsum}{
        \umlClass{IpsumText}{}
    }}

    \rput[l](6,1){\rnode{dolor}{
        \umlClass{DolorText}{}
    }}

    \ncEVE[armA=1]{lorem}{ipsum}
    \ncputicon{umlHerit}

    \ncline{lorem}{dolor}
    \ncputicon{umlHerit}

    \ncEXN[armA=1]{ipsum}{dolor} % update me
    \nbput[npos=0]{1}
    \naput[npos=3]{0..*}
    \naput{do sth.}
    \ncputicon{umlAgreg}
\end{pspicture}
\end{center}

\end{document}

Please ignore the multiplicity (above/below line), because I did not adjust it on the concept.

0

3 Answers 3

3

Modify the ipsum to dolor node connection to

\ncEXN[armA=1,angleB=0]{ipsum}{dolor} % update me

enter image description here

The node connection between ipsum and dolor is given by \ncangles with default options angleA=0 and angleB=-90. The above code overrides the latter angle (angleB) to 0, making the connection enter "from the east side."

For completeness, here is an MWE:

\documentclass{article}
\usepackage{pst-uml}% http://ctan.org/pkg/pst-uml
\begin{document}
\begin{center}
\begin{pspicture}(10,3)\psgrid
\rput[r](4,1){\rnode{lorem}{
    \umlClass{LoremText}{}
}}

\rput[l](6,2){\rnode{ipsum}{
    \umlClass{IpsumText}{}
}}

\rput[l](6,1){\rnode{dolor}{
    \umlClass{DolorText}{}
}}

\ncEVE[armA=1]{lorem}{ipsum}
\ncputicon{umlHerit}

\ncline{lorem}{dolor}
\ncputicon{umlHerit}

\ncEXN[armA=1,angleB=0]{ipsum}{dolor} % update me
\nbput[npos=0]{1}
\naput[npos=3]{0..*}
\naput{do sth.}
\ncputicon{umlAgreg}
\end{pspicture}
\end{center}
\end{document}
2
\documentclass{article}
\usepackage{pst-uml}
\def\UML[#1](#2)#3#4{\rput[#1](#2){\rnode{#3}{#4}}}
\begin{document}

\begin{pspicture}%[showgrid]
  (10,3)
    \UML[r](4,1){lorem}{\umlClass{LoremText}{}}
    \UML[l](6,2.5){ipsum}{\umlClass{IpsumText}{}}
    \UML[l](6,1){dolor}{\umlClass{DolorText}{}}
    \ncEVE[armA=1]{lorem}{ipsum}
    \ncputicon{umlHerit}
    \ncline{lorem}{dolor}
    \ncputicon{umlHerit}
    \ncEXN[armA=1,angleB=0]{ipsum}{dolor}
    \naput[npos=0.6]{1}
    \nbput[npos=3]{0..*}
    \naput{do sth.}
    \ncputicon{umlAgreg}
\end{pspicture}

\end{document}

enter image description here

0

Thank you for your helpful answers. I did some research after i understood the usage of angleA and angleB and now i know the trick:

To get the desired result i just have to replace

\ncEXN[armA=1]{ipsum}{dolor} % update me

with

\ncEVW[armA=1]{admin}{customer}

because of: EVW means draw right (East) then vertical (Vertical) then left (West). The codes represent the relative draw direction to two objects and not the connector positions.

It is easier to understand when looking at the definition (eg. /usr/share/texmf-dist/tex/latex/pst-uml) in :

\newpsobject{ncEVW}{ncangles}{angleA=0,angleB=0}
1
  • Since you have received some response in addition to your own, that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count. This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). Note that in case of a self-answer one has to wait 48 hours (after the question was posted) before accepting.
    – Werner
    Commented Dec 26, 2011 at 16:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .