Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use custom images for UML items in plantUML?

Tags:

plantuml

PlantUML is very powerful when you would like to create standard UML diagrams.

But I currently think about using PlantUML to document EIP routes (like the routes on these images: https://www.google.de/search?q=camel+route&safe=off&source=lnms&tbm=isch).

This would be pretty easy if you could specify another image instead of normal boxes for a class. Something like an SVG or WMF image or a shape script as in Sparx Enterprise Architect.

The only custom images I found in the documentation where those tiny sprites...

like image 248
rdmueller Avatar asked Dec 18 '15 21:12

rdmueller


People also ask

How do you use sprites in PlantUML?

A Sprite is a small graphic element that can be used in diagrams. In PlantUML, sprites are monochrome and can have either 4, 8 or 16 gray level. To define a sprite, you have to use a hexadecimal digit between 0 and F per pixel. Then you can use the sprite using <$XXX> where XXX is the name of the sprite.

Is PlantUML free?

PlantUML is free and open source and will always be. So PlantUML can occasionally display sponsored or advertising messages. Those messages are usually generated on welcome or error images and never on fonctional diagrams.


2 Answers

From PlantUML's Language Reference Guide

    11.6 Legacy HTML
    Some HTML tags are also working:
    <img:file>  : the file must be accessible by the filesystem
    <img:http://url>   : the URL must be available from the Internet

It appears that it shouldn't be a problem. There is also a PlantUML Word Plug-in, that would possibly enable you to paste images over the default ones otherwise.

The following PlantUML code renders a simple diagram - the referenced images have to be in the proper location...

object "inbound message" as m1
object "XML Splitter" as s1

m1 : <img:MessageIcon.gif>
s1 : <img:SplitterIcon.gif>
m2 : <img:MessageIcon.gif>

m1 -> s1
s1 -> m2

enter image description here

like image 131
Curt Snellgrove Avatar answered Oct 31 '22 15:10

Curt Snellgrove


plantuml-icon-font-sprites allows using font-awesome icons within plantuml. It's awesome!

like image 31
kctang Avatar answered Oct 31 '22 15:10

kctang