【问题标题】:PlantUML and notes on packagesPlantUML 和包注释
【发布时间】:2020-01-27 16:11:13
【问题描述】:

我想弄清楚 PlantUML 如何管理笔记。下面你可以看到一个小例子,其中的行为似乎有问题。

@startuml

package package{
    'note bottom : this seems to be the correct place, but brings an error

    artifact system
    note right : this links to the system as it should
}
note bottom: This should link to the \npackage, not the last element\nin the package list.

note "Link to the package" as test
test .- package

@enduml

这段代码编译成下图:

如您所见,我想为一组元素添加注释。根据维基2,您可以使用

note bottom

将注释附加到最后定义的元素。当我在打开包后立即尝试此操作时,我得到一个编译错误,因为没有任何东西可以附加注释。因此,我尝试在包装关闭后直接添加注释底部。在这种情况下,注释附加到包内创建的最后一个元素。

我知道我可以创建注释并将它们链接到每个元素,如上一个示例所示。但是这里我不能使用right,left,top,bottom关键字来管理位置。有人知道这是一个错误还是我必须将我的注释放在代码中的其他位置?

【问题讨论】:

    标签: uml plantuml


    【解决方案1】:

    您(和一些文档)似乎缺少of,如note bottom of package

    @startuml
    package package {
        'note bottom : this seems to be the correct place, but brings an error
    
        artifact system
        note right : this links to the system as it should
    }
    note bottom of package: This should link to the \npackage, not the last element\nin the package list.
    
    
    note "Link to the package" as test
    test .- package
    @enduml
    

    【讨论】:

    • 感谢您的意见。虽然这有效,但它不是我想要的。正如您在我的示例 (node right : this links to the system...) 和“Notes and stereotypes”下的 wiki 中看到的,有一种方法可以将注释附加到最后定义的对象。我的问题是元素被认为是“最后一个”的行为似乎很奇怪。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-30
    • 1970-01-01
    • 2010-10-15
    • 2014-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多