天天看点

GMF:示例Mindmap 练习一

生成一个领域模型

生成一个图形定义模型和工具定义模型,定义编辑用的图形元素

生成一个图形映射模型,定义领域模型和图形元素之间的映射

生成图形编辑器

编写代码扩充图形编辑器功能

这些步骤,可以通过GMF Dashboard来完成:

图形定义模型包含一些图形元素信息,但是并没有直接与领域模型关联,它定义figures、nodes、links等显示在图形上的元素。

<a href="http://wiki.eclipse.org/Image:Cheatsheet_graph2.png"></a>

<a href="http://wiki.eclipse.org/Image:Cheatsheet_tool.png"></a>

<a href="http://wiki.eclipse.org/Image:Cheatsheet_map.png"></a>

<a href="http://wiki.eclipse.org/Image:Label_mapping.png"></a>

<a href="http://wiki.eclipse.org/images/a/ad/Generation.png">Generation Model</a>

<a href="http://wiki.eclipse.org/Image:Basic_mindmap.png"></a>

注:在做的过程中,我的设计器运行时,发现虽然有Topic图例,但是不能拖拽到画板上,后来使用GMF Dashboard再次生成代码后就正常了,原因不明:)

 本文转自 jingen_zhou 51CTO博客,原文链接:http://blog.51cto.com/zhoujg/517023,如需转载请自行联系原作者

继续阅读