简体   繁体   English

如何始终在前台显示 Sirius Label

[英]How to always show Sirius Label in foreground

For the context, I'm working with Capella, an Eclipse RCP application based on Sirius (hence, EMF, GMF and draw2d).对于上下文,我正在使用 Capella,这是一个基于 Sirius(因此,EMF、GMF 和 draw2d)的 Eclipse RCP 应用程序。 This application is used for MBSE, that basically means diagram representations for industrial systems.此应用程序用于 MBSE,这基本上意味着工业系统的图表表示。

I'm developping an add-on (viewpoint) to display custom labels next to diagram elements.我正在开发一个附加组件(观点)来在图表元素旁边显示自定义标签。 These diagram elements are, to put it simply, boxes inside boxes.这些图表元素,简单地说,就是盒子里面的盒子。 My problem is that usually the label text is larger than the space between a box and its container, so the label gets hidden.我的问题是通常标签文本大于框与其容器之间的空间,因此标签被隐藏。 What I need is these labels to always be in foreground.我需要的是这些标签总是在前台。 As I'm more used to web development, what I'm looking for would be the equivalent of the z-index CSS property.由于我更习惯于 Web 开发,因此我正在寻找相当于z-index CSS 属性的内容。

Currently I have no idea of how to achieve this, I'm using a custom .odesign that allows me to control some rendering options, like labels text, the color of some elements or to add decoration, but I dont think its the way to go for my problem.目前我不知道如何实现这一点,我正在使用自定义.odesign ,它允许我控制一些渲染选项,如标签文本、某些元素的颜色或添加装饰,但我不认为这是去解决我的问题。 Maybe I should use a custom EditPart or a custom StyleConfiguration (I already used these components for other projects) but I have no clue where to start for this issue.也许我应该使用自定义 EditPart 或自定义StyleConfiguration (我已经将这些组件用于其他项目),但我不知道从哪里开始解决这个问题。

Any leads will be greatly appreciated.任何线索将不胜感激。

We recently did this kind of changes to keep some labels in Sirius Sequence diagrams always on top: the combined fragments are placed behind the lifelines (z order) but we wanted to keep the labels of the CombinedFragments visible event their bounds intersects Lifelines, Executions or States).我们最近进行了这种更改,以使 Sirius 序列图中的一些标签始终位于顶部:组合片段放置在生命线后面(z 顺序),但我们希望将 CombinedFragments 的标签保持可见事件,它们的边界与生命线、执行或状态)。

This has been handled in Bug 564239 for Sirius 6.3.2 (used in Capella 1.4.1).这已在 Sirius 6.3.2(在 Capella 1.4.1 中使用)的Bug 564239 中处理。 You could find some hints the bugzilla (Gerrits and commits can be retrieved from the See also section).您可以在 bugzilla 中找到一些提示(可以从另请参阅部分检索 Gerrits 和提交)。

In Sirius Sequence diagram , we use org.eclipse.sirius.diagram.sequence.ui.tool.internal.layout.SequenceZOrderingRefresher to control the z-order of CombinedFragments : all the figures that composes them comes from some expressions in the odesign, and synchronization with the Capella model for exemple.在 Sirius 序列图中,我们使用 org.eclipse.sirius.diagram.sequence.ui.tool.internal.layout.SequenceZOrderingRefresher 来控制 CombinedFragments 的 z-order :组成它们的所有图形都来自 odesign 中的一些表达式,并且例如,与 Capella 模型同步。

But in your case you want to control only the label, so it must not be dealt on the edit par level, but on the figure one.但是在您的情况下,您只想控制标签,因此不能在编辑标准级别上处理,而应在图一上处理。 The "overlay" layer and figure lead might be a good one. “叠加”层和图形引导可能是一个不错的选择。

Do not forget another thing: in GMF/GEF, the labels of an element is displayed/shown/rendered/visible if it fits to the visible area of the parent container: in the case of a node in a container with scrollbar, the visible are will impact the visibility of the sub nodes (extended to their border nodes, edges, labels, ...)不要忘记另一件事:在 GMF/GEF 中,如果元素的标签适合父容器的可见区域,则显示/显示/渲染/可见:如果容器中的节点带有滚动条,则可见将影响子节点的可见性(扩展到它们的边界节点、边、标签等)

Regards问候

Maxime马克西姆

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM