Controlling text on "lollipop" interfaces

0 votes
asked Feb 13, 2015 in Wanted features by anonymous
Is there a way to control where the interface name/text is placed in component diagrams? I.e. to say that I want the text to appear above or to the left or right of the lollipop, rather than below it? Also, can the text be hidden completely?

- Toralf

1 Answer

0 votes
answered Feb 15, 2015 by plantuml (295,000 points)
Hello,

It would be nice if you could give us a real and concrete example so that we can discuss about it.

Thanks!
commented Feb 16, 2015 by anonymous
OK, consider the following simplified diagram - based on an example from one of my other questions (id 3117)

@startuml

component Something {
  component Provider
  Provider -() Interface
}

component SomethingElse {
  component User
  Interface )-- User
}
@enduml

The question is if there is a way to move the text "Interface" to, say, the right-hand-side of the circle next to "Provider". Or alternatively, hide the text completely. I can get an interface with no text by adding

  interface " " as Interface

but it looks like the whitespace is still rendered, in that there will be a gap between the lollipop and connecting socket.
commented Feb 16, 2015 by plantuml (295,000 points)
In the following beta, https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

we've made some slight modifications so that white/blank interface are not displayed.
Meaning, you can have:

component Something {
  component Provider
  interface " " as Interface
  Provider -() Interface
}

component SomethingElse {
  component User
  Interface )-- User
}
@enduml

The syntax is quite ugly, but right now, this is the best we can have.
Does it fit your needs ?

PS:
The other option (that is, moving "Interface" text) is something that is also possible, but right now, we will not be working on this.
commented Feb 16, 2015 by anonymous
This certainly helps. I can then also put a text on the interface "link" instead, as in

component Something {
  component Provider
  interface " " as Interface
  Provider - Interface: Interface
}

component SomethingElse {
  component User
  Interface )- User
}

That raises another question, though: Is there a way to control how texts on connection lines are placed?
...