简体   繁体   English

Eclipse插件-节点和连接+代码生成

[英]Eclipse plugin - nodes and connection + code generation

I'd like to create an Eclipse extension modelling a decision tree/diagram. 我想创建一个对决策树/图表进行建模的Eclipse扩展。 The actual modelling would be done using a graphical interface (nodes, connections etc). 实际的建模将使用图形界面(节点,连接等)完成。 I'd like this plugin to generate code based on nodes and their interconnections. 我希望该插件根据节点及其互连生成代码。 I have basic model classes ready; 我已经准备好了基本的模型课程。 however, my diagrams are very large and it's difficult to manage all the connections only through code. 但是,我的图非常大,仅通过代码很难管理所有连接。 I imagine I would build the whole diagram using GUI. 我想我会使用GUI构建整个图。 When I double-click on a connection, I'd like to be able to override some of its methods, thus creating an anonymous subclass. 当我双击一个连接时,我希望能够覆盖其某些方法,从而创建一个匿名子类。

I found GEF used in similar plugins. 我发现GEF用于类似的插件。 Is my goal plugin "doable" in GEF? 我的目标插件在GEF中是否“可行”? Do you have any advice? 您有什么建议吗?

Yes. 是。 GEF is the foundation for building any graphical editor in Eclipse. GEF是在Eclipse中构建任何图形编辑器的基础。 It has basic support for moving nodes, placing connection, palette, etc. Other frameworks sit on top of GEF to make the task of creating a graphical editor even easier if your requirements fit with their supported scenarios. 它对移动节点,放置连接,调色板等具有基本支持。其他框架位于GEF之上,以使创建图形编辑器的任务更加轻松,只要您的要求适合其支持的方案即可。 Take a look at Eclipse Graphiti project. 看一下Eclipse Graphiti项目。

I would say that GMF is something that would help your life. 我想说,GMF可以帮助您改善生活。 GMF generates quite big parts for free, and also includes EMF. GMF免费生成相当大的部分,其中还包括EMF。

Also GMF is highly extendeable, so if you don't like something it has generated, you can just override those parts. 而且GMF具有高度的可扩展性,因此,如果您不喜欢它生成的内容,则可以覆盖这些部分。

There are good GMF tutorial here: http://wiki.eclipse.org/Graphical_Modeling_Framework/Tutorial 这里有很好的GMF教程: http//wiki.eclipse.org/Graphical_Modeling_Framework/Tutorial

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

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