Is it possible to style REF element in sequence diagram?

0 votes
asked Mar 4, 2016 in Closed question / help by bond007 (400 points)

2 Answers

0 votes
answered Mar 4, 2016 by plantuml (279,680 points)
selected Mar 4, 2016 by bond007
 
Best answer

The documentation is not up to date...

Sorry about that.

You can have:

@startuml
skinparam sequenceReferenceBorderColor red
skinparam sequenceReferenceBackgroundColor yellow
skinparam sequenceReferenceHeaderBackgroundColor blue

Dummy -> Alice : foo1
ref over Alice, Bob : this is a reference over Alice and Bob
ref#7700FF over Alice, Other, Bob : this is a reference over Alice and Other

Other --> Alice : ok again

@enduml



Hope this helps!

commented Mar 4, 2016 by bond007 (400 points)
commented Dec 15, 2020 by Yucheng
Hello

but how to use different style for different ref element?
commented Dec 15, 2020 by The-Lu (49,760 points)

Hello Y.,

You can use style for that.

I will post an answer with an example.

Regards,
Th.

0 votes
answered Dec 15, 2020 by The-Lu (49,760 points)

Hello all,

How to use different style for different ref element?

Now (from 1.2019.9++) with new style functionality, we can change style during sequence as:

@startuml
<style>
  sequenceDiagram {
    reference {
      LineColor red
      BackGroundColor yellow
      LineThickness 2.0
    }
    referenceHeader {
      LineColor red
      BackGroundColor blue
      FontStyle bold
    }
}
</style>
Dummy -> Alice : foo1
ref over Alice, Bob : this is a reference over Alice and Bob
ref#7700FF over Alice, Other, Bob : this is a reference over Alice and Other

Other --> Alice : ok again
Alice -> Bob : new style
<style>
  sequenceDiagram {
    reference {
      LineColor blue
      BackGroundColor palegreen
    }
    referenceHeader {
      LineColor blue
      BackGroundColor green
      FontColor white
    }
}
</style>
ref over Alice, Bob : this is another1 reference over Alice and Bob

Alice <- Bob : another new style
<style>
  sequenceDiagram {
    reference {
      LineColor red
      BackGroundColor pink
    }
    referenceHeader {
      LineColor red
      BackGroundColor blue
    }
}
</style>
ref over Alice, Bob : this is another2 reference over Alice and Bob
@enduml


[See on PlantUML online server]


If that can help,
Regards,
Th.

commented Aug 14, 2021 by emalware (280 points)
is it possible to change the showdo and make it rounded, I tried to apply styles but looks like they are ignored
commented Aug 24, 2021 by The-Lu (49,760 points)

Hello E.,

You can now use this new functionality, see:

Enjoy.

Thanks to PlantUML team,
Regards,
Th.

...