如何在 Dia 中绘制关联类?

发布于 2024-11-10 01:23:32 字数 1539 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

少女净妖师 2024-11-17 01:23:32

您可以执行以下操作:

  • 确保您的关联是一条直线。
  • 在关联的顶部/下方,添加一个标准线对象。
  • 您将能够使用您选择的连接线连接到标准线对象的中间。

Here's what you could do:

  • Make sure that your association is one straight line.
  • On top/below your association, add a standard line object.
  • You'll be able to connect to the middle of the standard line object using a connection line of your choice.
十秒萌定你 2024-11-17 01:23:32

这是另一种选择,尽管只是史蒂芬方法的变体。

首先绘制两个关联的类,以及连接它们的关联对象。

然后绘制一个简单的 Line 对象,该对象与关联对象连接到相同的连接点。当然,现在您已经有了这条丑陋的额外线条,因此要修复该问题,请双击该线条(或右键单击“属性”),然后更改颜色以匹配背景颜色,从而有效地将其隐藏在视图中。

现在,关联线的中间有一个连接点,您可以在其中附加一条连接到关联类的虚线。

您可能需要确保在不可见线上使用菜单“对象”、“发送到底层”,以便它不会绘制在其他对象之上。

通过这种方法,您不必确保关联对象保持直线,您还可以四处移动对象,并且所有内容都将保持连接。

Here's another alternative, albeit merely a variation of Steffen's approach.

First draw your two associated classes, and the Association object connecting them.

Then draw a simple Line object that attaches to the same exact connection points as the association object. Of course now you've got this ugly extra line in there, so to fix that double-click the line (or right-click, Properties), and change the color to match the background color, effectively hiding it from view.

Now you have a connection point right at the middle of the association line where you can attach a dotted line connected to your Association Class.

You'll probably want to ensure you use menu Objects, Send to Back on your invisible line so that it doesn't get drawn over top of other objects.

With this approach, you don't have to ensure that your Association object stays as a straight line, and you can also move your objects all around and everything will stay connected.

天涯离梦残月幽梦 2024-11-17 01:23:32

好消息:UML 关联已得到改进,并将允许此类连接:http: //git.gnome.org/browse/dia/commit/?id=302d5038e755cabb5ce9292d66d0ab9113153e15
这项新功能将包含在即将发布的 0.98 版本中。在发布之前,您可以使用 Dia Development VM 来测试新功能:http://dia -installer.de/developer/index.html

Good news: The UML association has been improved and will allow for such connections: http://git.gnome.org/browse/dia/commit/?id=302d5038e755cabb5ce9292d66d0ab9113153e15
This new feature will be included in the upcoming version 0.98. Until it is released, you can use the Dia Development VM to testdrive the new functionalities: http://dia-installer.de/developer/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文