如何在 DSL Tools 图中嵌套形状?
我有一个包含两个主要域类的 DSL:区域和实体。 区域由 GeometryShape 直观地表示,而实体由 CompartmentShape 表示。 实体可以嵌入到区域中,也可以不嵌入(在这种情况下,实体嵌入到根对象中,根对象是一种区域)。 实体之间,包括不同领域的实体之间,可能存在关系。 区域不能嵌入其他区域,实体也不能嵌入其他实体。
我的问题是我无法从图中获得我想要的行为。 区域中实体的嵌入在模型级别工作得非常好,但视觉表示的行为却不稳定。 例如,如果我拖动在该区域之外的区域中创建的实体,它不再响应鼠标单击(我有执行重新父子关系的代码,但不知何故,图表方面被破坏了)。
我到处寻找如何做到这一点的示例,但一无所获。 我在网络上找到的每个示例都通过“引用”关系模拟嵌套,而我正在执行域类(及其关联的形状类)的真正嵌入。
有人有如何执行此操作的示例吗?
当我发泄时,我是唯一一个认为图表/形状类的记录严重不足的人吗?
I have a DSL containing two main domain classes: Area and Entity. Areas are represented visually by a GeometryShape, whereas entities are represented by a CompartmentShape. Entities can be embedded in an Area, or not (in this case they are embedded in the root object, which is a kind of Area). There may be relationships between entities, including between entities in different areas. Areas cannot be embedded inside of other areas, nor entities embedded inside of other entities.
My problem is that I cannot get the behavior I want from the diagram. The embedding of entities in areas works perfectly well at the model level, but the visual representation behaves erratically. For example, if I drag an entity that was created in an area outside of that area, it no longer responds to mouse clicks (I have code that performs the re-parenting, but somehow the diagram side of things is broken).
I have searched high and low for samples of how to do this, and come up empty. Every example I've found on the web simulates nesting via "references" relationships, whereas I am performing true embedding of the domain classes (and therefore of their associated shape classes).
Does anyone have an example of how to do this?
While I'm venting, am I the only one who thinks the diagram/shape classes are massively under-documented?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 使用 Visual Studio DSL 工具进行特定领域开发。 另外,您可能想询问 Visual Studio 扩展性论坛。
I believe there's an example of this in Domain-Specific Development with Visual Studio DSL Tools. Also, you might want to ask on the Visual Studio Extensibility forum.