Styling of qualified associations

0 votes
asked Oct 10 in Question / help by Mike Kravets
Hi guys,

Having this diagram

@startuml
    interface Map<K,V>
    class HashMap<Long,Customer>

    Map <|.. HashMap
    Shop [customerId: long] ---> "customer\n1" Customer
    HashMap [id: Long] -r-> "value" Customer
@enduml

Is it possible to style blocks under `<...>` and `[...]`? What tags / skinparams should be used?

Thanks!

2 Answers

0 votes
answered Oct 13 by The-Lu (74,900 points)

Hello M.,

It is not yet possible; You are right...
It is not yet implemented...

1/ But for example cardinality and qualified associations inherited of arrow style... as:

@startuml
<style>
arrow {
  FontColor Blue
  FontSize 14
  FontStyle bold
  BackgroundColor pink
}
</style>

    interface Map<K,V>
    class HashMap<Long,Customer>

    Map <|.. HashMap
    Shop [customerId: long] ---> "customer\n1" Customer
    HashMap [id: Long] -r-> "value" Customer

@enduml

2/ But that can be a good wanted feature...

If that can help,

Regards,
Th.

0 votes
answered Nov 19 by The-Lu (74,900 points)

Hello M.,

FYI that is now implemented on v1.2024.8:

- Thanks PlantUML team for your work.

@startuml
<style>
document {
  BackgroundColor palegreen
}
arrow {
  FontColor Blue
  FontSize 14
  FontStyle bold
  cardinality {
    BackgroundColor tan
  FontColor orange
  }
}
class {
  BackgroundColor yellow
  generic {
  BackgroundColor pink
  }
  qualified {
  BackgroundColor green
  FontColor ivory
  }
}
</style>
    interface Map<K,V>
    class HashMap<Long,Customer>
    Map <|.. HashMap
    Shop [customerId: long] ---> "customer\n1" Customer : Shopping
    HashMap [id: Long] -r-> "value" Customer
@enduml

Ref.:

Enjoy,
Regards,
Th.

...