...
- Create a new Empty EMF Project named
de.cau.cs.rtprak.login.turingmodel
. Remember to create the project in your Git repository if you're working with one. Once you click the Finish button, the Empty EMF Project wizard creates a new plug-in project for you, complete with asrc
folder for Java source files, theMANIFEST.MF
file we have encountered before, and, most importantly, a models folder that you will store your modeling files in. If you open the manifest file in the Plugin Manifest Editor, you will see that the wizard already added a dependency toorg.eclipse.emf.ecore
, which all EMF projects depend on. - Create a new Ecore diagram in the models folder by right-clicking the folder and clicking New -> Other..., and then selecting Ecore Diagram from the Ecore Tools category. Note that the category Other also contains an entry Ecore Diagram. However, the editor we will be using has more features and is more user-friendly than the one in the Other category.
- In the New Ecore Diagram wizard, check Create a new model and choose
turingmachine.ecore
as the Domain file name. Once you click Finish, the wizard will generate two files for you:turingmachine.ecore
contains the information about the data structures in your Turing Machine models. In effect, it is your metamodel in Ecore format.turingmachine.ecorediag
is the diagram you're editing and contains things like coordinates of the different data structures, and bend points of the relations between them – in short, everything the graphical editor needs to know to display the diagram.
- You will need the Properties view to edit your model properly. This view shows detailed information about the currently selected model element and lets you edit them. It also shows general information about the model if no specific element it selected. Summon the Properties view now by right-clicking into your diagram and selecting Show Properties View.
- Now that the Properties view is visible, switch to its Model tab and set the following properties:
- Name: Model elements are grouped into packages, and this is the package name. Set to
turingmachine
. - Ns Prefix: Namespace prefix that will be used in the XML representation of your models later on. Use something short, e.g.
turing
. - Ns URI: While the package name need not be unique, namespace URI's are used to uniquely identify stuff. The usual convention is to use a name following the format
http://project_name_part/packagename
. Thus, set this to something likehttp://de.cau.cs.rtprak.login/turingmachine
.
- Name: Model elements are grouped into packages, and this is the package name. Set to
...