4

I want to draw thisenter image description here

With the light gray shadow (not black) and round corners. Here is what I have

enter image description here

Can anyone show me how to change it? Another points, when I have text that is very long, how can I break it to many lines so they dont go out of the borders?

Here is my MWV

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,shadows}
\usepackage{pgf-umlsd}

\begin{document}

\begin{sequencediagram}
\newthread[white]{u}{User}
\newinst[3]{b}{Browser}


\begin{call}{u}{Long messagessssssssssssssss here!!!}{b}{}
\end{call}

\end{sequencediagram}

\end{document}
4

You can use

\tikzset{inststyle/.append style={
        drop shadow={top color=gray, bottom color=white}, 
        rounded corners=2.0ex
}

to change the style of the \newinst. Here it is shown applied only to the Browser:

enter image description here

Notes:

  • I don't know the official pgf-umlsd way to wrap the text, but using a \parbox sure works.
  • I added the \tikzset within a brace group so that any subsequent \newinst would not be affected as I thought perhaps you would want to change only one of the \newinst. If you desire all the \newinst to have the gray shadow box and rounded corner move the above \tikzset to be in the preamble before \begin{document}.

Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,shadows}
\usepackage{pgf-umlsd}

\begin{document}

\begin{sequencediagram}
\newthread[white]{u}{User}

{\tikzset{inststyle/.append style={
        drop shadow={top color=gray, bottom color=white}, 
        rounded corners=2.0ex
    }
}
\newinst[3]{b}{Browser}%
}%

\begin{call}{u}{\parbox[b]{4.0cm}{\raggedright Long messagess sssss sssssssss here!!!}}{b}{}
\end{call}

\end{sequencediagram}

\end{document}
  • Thank you! Do you happen how to reshape the boxes? To make them rounded corners? – wererabit Oct 6 '14 at 18:18
  • @wererabit: Updated solution to include rounded corners. – Peter Grill Oct 6 '14 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.