简体   繁体   English

GEF连接和PropertyChangeListener

[英]GEF Connection and PropertyChangeListener

I'm writing on a eclipse plugin based on RCP and GEF that displays streetmaps. 我正在写一个基于RCP和GEF的eclipse插件,用于显示街道地图。 Nodes are the cities and Connections are supposed to be the streets. 节点是城市,而连接应该是街道。 My Connections have several options like width, color or name and they can be changed over the property panel. 我的连接有几个选项,例如宽度,颜色或名称,可以在属性面板上进行更改。 My problem is, that AbstractConnectionEditPart doesn't implements the PropertyChangeListener and is generally handled in a different way than the nodes. 我的问题是,AbstractConnectionEditPart不实现PropertyChangeListener,并且通常以与节点不同的方式进行处理。 I've found out, that GEF has a abstract class named ConnectionHandle but I've no idea how to "connect" it to my controller of the connection. 我发现GEF有一个名为ConnectionHandle的抽象类,但我不知道如何将其“连接”到我的连接控制器。

Does anybody has further information or can provide a working code snippet? 是否有人有进一步的信息或可以提供工作代码段?

Thanks. 谢谢。

GEF edit parts don't implement any kind of listener by default. 默认情况下,GEF编辑部件不实现任何类型的侦听器。 It is you job to either subclass the EditPart and implement a listener, or create an external listener to your model and update the EditPart when the model changes. 您可以对EditPart进行子类化并实现侦听器,或者为模型创建外部侦听器并在模型更改时更新EditPart You can check out my tutorials for more information on how this can be done (and sorry for the self-promotion, but the solution is there, so no need to write it again here). 您可以查看我的教程 ,以获取有关如何完成此操作的更多信息(对不起自我推广,但是有解决方案,因此无需在此处再次编写)。

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

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