Can container components be skinned separately from normal components?

0 votes
asked Jan 9, 2018 in Wanted features by Rob Oxspring
By default containers components appear to be drawn black and white, but normal ones are pale yellow with the red border:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuU9ApiyjoCzBpIjHy2yjIIropiyhISpCIorIgEPIK418UkRbeKiYIpkYyPs0_5gkMYw7rBmKe3K0

If I add a skinparam targeting component then both container and normal components pick this up:

http://www.plantuml.com/plantuml/uml/NSwn3O0m34JHtbDub10gAcOmu28YiP7ZL8ZTWGOGvTVJIHUgatah6UgQP2EZWhEMJON5ezh2rcjMmoatXaTmR7wBE2LXmntmdU4WyiSlTx-ELnzmG61PhYSd

Is there any way to avoid that? I'd like to modify the normal component background color without affecting the container components.

1 Answer

0 votes
answered Jan 25, 2018 by Anthony-Gaudino (7,800 points)

You can use stereotypes and skinparam to do it:

@startuml
hide stereotype

show <<Inner>> stereotype

skinparam componentBorderColor<<Outer>> Yellow
skinparam componentBorderColor<<Inner>> Blue

component OuterContainer <<Outer>> {
  component InnerContainer <<Outer>> {
    component A <<Inner>>
    component B <<Inner>>
  }
}
@enduml

Generates: http://www.plantuml.com/plantuml/uml/XP0n2iCm34Ltdq87CI5DfawTEvfQa517Ch9CA2LtZp6qRWgbyt__VQG-gHFDIp3Jx16IeY3h8w8nQU8Lh3qJeNJTCRhF59su1MwyH2Oa7LWyoiY1nTfBrjgvOWYy_iLV4qF8HVvce6f69dLp0Q1vdmQQ2chz5_O9djevNybmI3QpcHx9bxVi

...