custom participants shapes

0 votes
asked Jul 4, 2013 in To be sorted by anonymous
hi,

Many thanks for plantuml - great software and really useful.

I would like to define my own participants (with shape). So, I can use "database" as a participant currently. So I would like to extend that to "file", or some other thing ...

Is there a way to do this please ?

thanks again

Roger

1 Answer

0 votes
answered Jul 4, 2013 by plantuml (295,000 points)

Creating custom shape would require code modification.

So it's not possible today.

The closest feature that you could use is sprite : http://plantuml.sourceforge.net/sprite.html

For example, you can have :

@startuml
sprite $bug [15x15/16z] PKzR2i0m2BFMi15p__FEjQEqB1z27aeqCqixa8S4OT7C53cKpsHpaYPDJY_12MHM-BLRyywPhrrlw3qumqNThmXgd1TOterAZmOW8sgiJafogofWRwtV3nCF
sprite $printer [15x15/8z] NOtH3W0W208HxFz_kMAhj7lHWpa1XC716sz0Pq4MVPEWfBHIuxP3L6kbTcizR8tAhzaqFvXwvFfPEqm0
sprite $disk {
   444445566677881
   436000000009991
   43600000000ACA1
   53700000001A7A1
   53700000012B8A1
   53800000123B8A1
   63800001233C9A1
   634999AABBC99B1
   744566778899AB1
   7456AAAAA99AAB1
   8566AFC228AABB1
   8567AC8118BBBB1
   867BD4433BBBBB1
   39AAAAABBBBBBC1
}
 
title Use of sprites (<$printer>, <$bug>...)
actor Alice
participant "<$disk>" as disk
Alice -> disk : save
@enduml

It's not exactly what you are looking for, but we can enhance this feature to fullfill your need. Any idea ?


 

commented Jul 4, 2013 by anonymous
hi.
Thanks for the prompt answer.

Sprites seems quite useful, and they go some way to what I want. For the application I have in mind, it would be better if the whole shape was replaced, but, I can live with the 'imported shape' is inside the participant rectangle. I got a reasonable result with using the <img> tag to do this. The main problem was the lack of vector output in a printed result ...

I wonder if it would be possible to use a SVG as a src for a sprite or <img> ?

regards
Roger
commented Jul 4, 2013 by plantuml (295,000 points)
It's not highly tested, but you can use a .svg file in img :

 @startuml
 Alice -> Bob : hello
 note over Alice, Bob
     This is hosted by <img:file.svg>
 end note
 @enduml

The .svg extension has to be in lowercase, and this works only if you generate a svg file  (you cannot generate png file than uses a svg image)
commented Jul 4, 2013 by anonymous
That's great.
the height and width parameters needed explicitly specifying, but the overall result is pretty good. Thanks!
...