IS there a possiblity to align the text over the arrow for example to be aligned centered

+1 vote
asked Jan 23, 2013 by anonymous
Pleae consider the below example

@startuml

a -> b : very long message so it will have many new lines as \n and \n and \n

b-> a : another very long message \n so we need to align the text centered

@enduml

2 Answers

+1 vote
answered Jan 23, 2013 by plantuml (131,770 points)

Maybe it's not exactly what you are looking for, but you can have this:

@startuml
skinparam SequenceMessageAlign center
a -> b : very long message so it will have many new lines as \n and \n and \n
b-> a : another very long message \n so we need to align the text centered
@enduml

commented Jan 27, 2013 by anonymous
But this aligned the text as a whole over the arrow which is useful by the way but I want to align the text it self as centered, can't it be a required featured to be implemented next release?
commented Jan 27, 2013 by plantuml (131,770 points)
This has been implemented in release 7953. Enjoy!
commented Oct 5, 2016 by anonymous
Can you say how it's been implemented?  Sorry I know this is an old post but I can't find this anywhere.
commented Oct 5, 2016 by anonymous
Thank you!  Did the trick.
commented Oct 5, 2016 by anonymous
Actually, I see now that this changes the alignment for the entire diagram.  I was looking to selectively change the text alignment depending on the arrow.  For full disclosure, i'd like text over -> to be left aligned, and text over <- to be right aligned, and I have several of each.
commented Oct 5, 2016 by plantuml (131,770 points)
Ok. This is not possible yet.
We will implement a new setting:

skinparam SequenceMessageAlign direction

that does what you are expecting

And also a skinparam SequenceMessageAlign reserveDirection that does the opposite.

This will be available in next beta (in a week or two). We'll post a message here when ready.

Thanks for the suggestion!
0 votes
answered Oct 7, 2016 by plantuml (131,770 points)

With last beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can have:

@startuml
skinparam SequenceMessageAlign direction
Alice -> Bob : hello
return ok
@enduml



or

@startuml
skinparam SequenceMessageAlign reverseDirection
Alice -> Bob : hello with long text
Alice -> Bob : hello
return ok
@enduml


Is this what you are expecting ?
Thanks
 

...