Customize Stereotype display

0 votes
asked Mar 19, 2019 in Wanted features by javabien (120 points)

When building a diagram the Stereotype title always display the << and >> ... is there a way to remove these or customize these?

The only hack I found is to put a :

skinparam StereotypeFontSize 0

Then I rewrite the title by myself, but then I cannot customize the FontSize.

My suggestion would be to have something like:

skinparam StereotypeTitleOpening [
skinparam StereotypeTitleClosing ]

If the value is left "empty", then nothing would be displayed.


2 Answers

0 votes
answered Mar 20, 2019 by zimchaa (1,020 points)
Hi, it is possible to hide the stereotype using: ``hide stereotype`` at the top of the script, which is close to what you're asking - it's covered here:
commented Mar 20, 2019 by javabien (120 points)
Yes, it's close to what I did as a workaround:

skinparam StereotypeFontSize 0

While the official way to do it is:

hide stereotype

But it's not really solving my issue, if I want to put a different FontSize on the Stereotype, than the regular FontSize, but I don't want to print the ugly << and >> then I'm screwed.
I have to hide the Stereotype, but then I cannot change the FontSize or the Color.

In other word, I still see value to have a Stereotype, I just don't understand why we get automatically a formatting for use which we cannot disable (I'm talking about the << and >>).

commented Mar 20, 2019 by plantuml (257,900 points)
Right now, there is no way of doing what you want.
It's because << / >> are the standard way of printing Stereotype.

There is one skinparam which somehow changes this :

skinparam guillemet false
class foo <<stereotype>>

But this is still not what you are looking for.

If you really want to, we could add another value (for example none), so that

skinparam guillemet none
class foo <<stereotype>>
Would print stereotype, but without the << and >>.
Is this what you are looking for ?
commented Mar 20, 2019 by javabien (120 points)
Yes, that's what I wanted, but what I suggested was even more flexible, because maybe some people want to keep a special formatting for the stereotypes, they just don't want this one.

So instead of:
<< stereotype >>
We could want:
[ stereotype ]
It's just in my case, I want
... because in my case, anyway, I just prefer to put a line:
0 votes
answered Mar 22, 2019 by plantuml (257,900 points)

Ok, so with last beta you can now have:

skinparam guillemet none
class foo <<stereotype>>
skinparam guillemet [ ]
class foo <<stereotype>>
skinparam guillemet $$ $$
class foo <<stereotype>>

Is it what you are expecting ?

commented Mar 23, 2019 by anonymous
Thanks, that's what I was suggesting

The problem is, it works well with the examples you provided, but in my case, I replaced class by usecase and it doesn't work with "none"

    at net.sourceforge.plantuml.Guillemet.manageGuillemet(
    at net.sourceforge.plantuml.cucadiagram.Stereotype.getLabel(
    at net.sourceforge.plantuml.svek.image.EntityImageUseCase.<init>(
    at net.sourceforge.plantuml.svek.GeneralImageBuilder.createEntityImageBlock(
    at net.sourceforge.plantuml.svek.GeneralImageBuilder.printEntityInternal(
    at net.sourceforge.plantuml.svek.GeneralImageBuilder.printEntity(
    at net.sourceforge.plantuml.svek.GeneralImageBuilder.printEntities(
    at net.sourceforge.plantuml.svek.GeneralImageBuilder.buildImage(
    at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(
    at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(
    at net.sourceforge.plantuml.cucadiagram.CucaDiagram.exportDiagramInternal(
    at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(
    at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(
    at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(
    at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(
    at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(
    at net.sourceforge.plantuml.Run.manageFileInternal(
    at net.sourceforge.plantuml.Run.processArgs(
    at net.sourceforge.plantuml.Run.manageAllFiles(
    at net.sourceforge.plantuml.Run.main(

Could you double check please?
commented Mar 23, 2019 by plantuml (257,900 points)
Thanks for the feedback.
This is solved in last beta
Tell us if you find other issues : this has been only slightly tested.