是否可以在 plantUML 中为 UML 项目使用自定义图像?

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

当您想创建标准 UML 图时,PlantUML 非常强大。

但我目前正在考虑使用 PlantUML 来记录 EIP 路由(如这些图像上的路由:https://www.google.de/search?q=camel+route&safe=off&source=lnms&tbm=isch)。

如果您可以为 class 指定另一个图像而不是普通框,这将非常容易。类似于 Sparx Enterprise Architect 中的 SVG 或 WMF 图像或形状脚本。

我在文档中找到的唯一自定义图像,其中那些小精灵...

来自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

看来应该问题不大。还有一个 PlantUML Word Plug-in,可以让您将图像粘贴到默认图像上。

以下 PlantUML 代码呈现了一个简单的图表 - 引用的图像必须位于正确的位置...

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

plantuml-icon-font-sprites 允许在 plantuml 中使用 font-awesome 图标。太棒了!

如果您要构建图表,请在代码顶部包含 allow_mixing