extend annotation support on class diagrams

0 votes
asked Nov 24, 2020 in Wanted features by mwwhited (120 points)

Could you extend annotation in the class diagram to support having fields and methods just like classes?  As well as could we get a visibility 

@startuml
class Nmea0183Device {
    {static} @SerialPort(9600,N,8,1)
}


class SerialPort << (@,#FF7700) >> {
    +Baud : int
    +Parity : ParityTypes
    +DataBits: int
    +StopBits: StopBitTypes
    +ctor(Baud, Parity, DataBits, StopBits)
}

enum ParityTypes {
    None  {N}
    Odd   {O}
    Even  {E}
    Mark  {M}
    Space {S}
}
SerialPort *-- ParityTypes

enum StopBitTypes {
    None         {0}
    One          {1}
    Two          {2}
    OnePointFive {1.5}
}
SerialPort *-- StopBitTypes
@enduml




1 Answer

0 votes
answered Nov 25, 2020 by Serge Wenger Work (14,000 points)

I'm not sure what you want exactly but you can embedded a class in a note like this:

See on PlantUML Server

commented Nov 25, 2020 by mwwhited (120 points)

what I want is to be able to do this...

annotation SerialPort {
    +Baud : int
    +Parity : ParityTypes
    +DataBits: int
    +StopBits: StopBitTypes
    +ctor(Baud, Parity, DataBits, StopBits)
}

and have the 

@SerialPort(...) show up with an orange dot instead of the @ character within the class definition.

commented Nov 25, 2020 by Serge Wenger Work (14,000 points)
Please make a drawing (with Paint or anything else) and put in the message to really understand your needs.
...