【发布时间】:2020-12-09 06:47:47
【问题描述】:
在随附的 UML 图中有 5 个类,我想了解 A、B 和 C 类的顶部如何垂直对齐,而子类保持对齐。请在下面找到我的 UML 代码和屏幕截图。
非常感谢您的支持! :)
目前的样子:
它应该是什么样子(油漆编辑):
UML - 代码:
@startuml TestClassDiagram
scale 800 width
skinparam SameClassWidth true
skinparam ClassFontSize 15
class classA {
{field} - attribute1 : int
{field} - attribute2 : int
{method} + method1(void)
{method} + method2(void)
{method} + method3(void)
{method} + method4(void)
{method} + method5(void)
}
class classB {
{field} - attribute1 : int
{field} - attribute2 : int
{method} + method1(void)
{method} + method2(void)
}
class classBchild {
{method} + method1(void)
}
class classC {
{field} - attribute1 : int
{field} - attribute2 : int
{field} - attribute3 : int
{field} - attribute4 : int
{method} + method1(void)
{method} + method2(void)
{method} + method3(void)
{method} + method4(void)
{method} + method5(void)
}
class classCchild {
{method} + method1(void)
}
classB <|-- classBchild
classC <|-- classCchild
@enduml
【问题讨论】:
-
从网上查到的其他问题看来是不可能的。
-
感谢阿尔伯特,您的快速回复!这很难过:-P
标签: uml class-diagram plantuml