Sirius is an Eclipse project which allows you to easily create your own graphical modeling workbench by leveraging the Eclipse Modeling technologies, including EMF and GMF.It provides a generic workbench for model-based architecture engineering that could be easily tailored to fit specific needs.Based on a viewpoint approach, Sirius makes it possible to equip teams who have to deal with complex architectures on specific domains.

BasicFamily Tutorial

This tutorial explains how to use Eclipse Sirius to create graphical editors for visually describing a family.

①使用EcoreTools创建BasicFamily元模型(右键创建的项目设置运行配置)

image-20210203125130793

运行建立好的BasicFamily元模型,创建实例验证元模型

image-20210203141257288

tips上图的图标改变是在建立BasicFamily时改变的,操作如下

image-20210203141452769

③创建 Viewpoint Specification 项目

image-20210203141634190

④双击viewpoint设置视点属性,如下

image-20210203150352352

image-20210203150720154

⑤打开项目的MANIFEST.MF文件,然后在“必需插件”列表添加定义元模型的插件

image-20210203151116118

⑥在视点中添加图,并且关联定义此图使用的类型的元模型(定义图的属性) 如下

image-20210203151639533

image-20210203151943473

image-20210203152344296

⑦在图中添加节点并设置属性

image-20210203152421396

image-20210203152727566

⑧为节点设置样式

image-20210203153335638

image-20210203153619356

image-20210203153658426

image-20210204151202568

⑨测试自己定义的图

image-20210203153905404

image-20210203153911741

image-20210203153921892

image-20210204150953663

⑩改善节点样式

image-20210204150857311

image-20210204151022387

⑪、添加基于关系的边

image-20210204151241331

image-20210204151312620

image-20210204151405555

image-20210204151417097

⑫、在调色板中添加可以创建元素的工具

image-20210204151551084

image-20210204151612828

image-20210204151759152

⑬、定义由“创建节点”工具执行的操作

image-20210204151946139

image-20210204152020979

image-20210204152050396

image-20210204152118046

image-20210204152159117

image-20210204152236605

效果如下

image-20210204152316406

⑭、边线创建工具

image-20210204161850940

image-20210204161911039

然后定义每次用户单击该工具时将由该工具执行的操作。这些操作可以使用Sirius自动设置的四个变量:

image-20210204162124778

image-20210204162216315

image-20210204162305349

image-20210204162408811

为了防止用户创建一个人与人或其子女之一的父亲关系,您可以添加前提条件表达式

image-20210204162636291

此表达式使用两个新变量:

⑮、重新连接边线工具

image-20210204162907508

image-20210204162937929

该工具带有六个变量:

⑯、删除元素工具

image-20210204163541871

image-20210204163554766

image-20210204163644119

⑰、直接编辑标签工具

image-20210204210642271

image-20210204210658258

image-20210204210727964

效果如下

image-20210204211033848

⑱、风格定制

image-20210204212453104

image-20210204212505794

image-20210204212604514

⑲、创建两个图层

image-20210206154555138

image-20210206154628502

image-20210206154649158

创建第二个图层, Women然后拖放与“女人”类型相关的所有元素。效果如下

image-20210206154732990

image-20210206154747013

⑳、筛选器

image-20210206170023215

image-20210206170040457

image-20210206170102123

image-20210206170202877

㉑、验证规则

image-20210206174323727

image-20210206174425045

image-20210206174530437

image-20210206174605013

验证效果如下

image-20210206174747226

㉒、快速修复(可以向用户提供修复程序,以自动解决问题)

例如,上个问题,我们可以建议取消两个父亲关系之一。

image-20210206175927362

image-20210206180019727

效果如下

image-20210206181004915

image-20210206181014905

㉓、以对象为中心的图

image-20210206190703680

image-20210206190718247

image-20210206190743797

image-20210206190808471

㉔、容器

image-20210206191239137

image-20210206191301132

image-20210206191354214

image-20210206191410681

image-20210206191425590

image-20210206191443143

㉕、子节点

image-20210206191624318

image-20210206191645715

image-20210206191705941

image-20210206191842680

image-20210206192255147

image-20210206192327692

㉖、边界节点

image-20210206192506920

image-20210206192520236

image-20210206193100867

㉗、容器之间的边线

image-20210206193703685

image-20210206193734119

image-20210206193750201

image-20210206193819842

㉘、Double Click

image-20210206193907990

image-20210206193935595

image-20210206193955228

image-20210206194011085

效果如下

image-20210206195300282

image-20210206195321991

㉙、表

image-20210206195428111

image-20210206195446444

image-20210206195510094

image-20210206195524801

image-20210206200324025

image-20210206200339688

image-20210206200403891

image-20210206200420716