[Style][Object] Allow style on Object diagram

0 votes
asked Sep 15, 2021 in Wanted features by The-Lu (37,800 points)

Hello PlantUML team,

  • Could you allow style on Object diagram?

Especially to correct some theme (e.g. see 'Object with amiga theme'), without adding skinparam in them.

Here are some example:

Code Output
@startuml
skinparam ObjectFontColor red
skinparam ObjectAttributeFontColor red
skinparam ObjectBackgroundColor palegreen

object o1
object user {
  name = "Dummy"
  id = 123
}

o1  -> user
@enduml

header: OK
label/attribute: OK
background: OK
@startuml
<style>
root {
  FontColor Red
  BackgroundColor palegreen
}
</style>

object o1
object user {
  name = "Dummy"
  id = 123
}

o1  -> user
@enduml

header: KO
label/attribute: KO
object background: ~KO
@startuml
<style>
objectDiagram {
  FontColor Red
  BackgroundColor palegreen
}
</style>

object o1
object user {
  name = "Dummy"
  id = 123
}

o1  -> user
@enduml

header: KO
label/attribute: KO
object background: KO
......

Some open question...

How to differentiate, on style:

  • header (ObjectFontColor)
  • and attribute/member (ObjectAttributeFontColor) ?


Thanks for your works,
Regards,
Th.

1 Answer

0 votes
answered Sep 16, 2021 by plantuml (264,940 points)

With last beta http://beta.plantuml.net/plantuml.jar you can now have:

and

Does is help ?

commented Sep 16, 2021 by The-Lu (37,800 points)

Hi,

Yes it helps... it's a good start.yes

Then: to continue...wink
Is it possible to manage BackGroundColor of all space:

  • header
  • fields
  • methods

Here are examples:

CodeOutput
@startuml
<style>
root {
  FontColor Red
  BackgroundColor palegreen
}
object {
  FontColor blue
  BackgroundColor yellow
    header {
      FontColor violet
      FontSize 20
      BackgroundColor DarkOliveGreen
    }
}
</style>

object o1
object user {
  name = "Dummy"
  id = 123
}

o1  -> user
@enduml
@startuml
<style>
root {
  FontColor Red
  BackgroundColor palegreen
}
classDiagram {
  class {
    FontColor blue
    BackgroundColor yellow
      header {
        FontColor violet
        FontSize 20
        BackgroundColor DarkOliveGreen
      }
      fields {
        FontColor violet
        FontSize 20
        BackgroundColor DarkSalmon
      }
      methods {
        FontColor violet
        FontSize 20
        BackgroundColor DarkKhaki
      }
  }
}
</style>

class o1
class user {
  name = "Dummy"
  id = 123
  myMethods()
}

o1  -> user
@enduml

If is possible without too much effort?

Thanks a lot for your improvements,
Regards,
Th.

...