Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Capella/Viewpoints/Practice"

 
m (Replaced content with "This page has been moved to https://github.com/eclipse/capella/wiki/Tutorials Category:CapellaCategory:Kitalpha")
 
Line 1: Line 1:
This page explains how to develop a viewpoint for Capella with Capella Studio. It is illustrated with the Basic Mass viewpoint downloadable from the [https://polarsys.org/capella/download.html#vp Capella] website.
+
This page has been moved to https://github.com/eclipse/capella/wiki/Tutorials
 
+
= First Steps =
+
Three means enables to start working with a viewpoint in a workspace:
+
* Importing a viewpoint
+
* Creating a new viewpoint
+
* Reversing an ecore
+
 
+
The third option is not presented here.
+
 
+
 
+
== Option #1: Import of the Basic Mass viewpoint ==
+
This first option is to import the viewpoint as depicted below from the Plug-ins view, with the "Import As"/"Source Project" command.
+
[[File:Viewpoint-BasicMass-Import-01.png|none|left|350px|]]
+
 
+
After the import of the viewpoint plugins, open the model folder in the vpdsl plugin.
+
[[File:Viewpoint-BasicMass-Workspace-01.png|none|left|200px|]]
+
 
+
Open a vptext file by double-click. If an error occurs, this means that the vptext is not recognized automatically. In this case, on the vptext file, right-click and Open With Data / User Interface / Diagram / Configuration for the data / ui / diagram / conf vptext files.
+
 
+
 
+
== Viewpoint description: Model and text equivalence ==
+
The viewpoint description with Kitalpha is stored in a model (.vpdesc file) and edited with a set of editors dedicated by aspect.
+
[[File:Viewpoint-BasicMass-vpdesc2xtext-equivalence.png|none|left|600px|]]
+
 
+
 
+
== Option #2: Creation of viewpoint ==
+
Instead of importing the viewpoint, it is possible to create it from scratch:
+
# First Step: apply the commands: File/New…/Project – Viewpoint DSL Project
+
# Second Step: Set the name, choose Capella
+
[[File:Viewpoint-BasicMass-Creation-03.png|none|left|900px|]]
+
 
+
 
+
To create a new aspect, in the mass.spec.vptext:
+
# CTRL+Space: choose the new aspect to be created
+
# Modify the name of the aspect file and Finish
+
[[File:Viewpoint-BasicMass-Edition-UICreation-01.PNG|none|left|350px|]]
+
 
+
 
+
= Viewpoint Aspects =
+
== Data ==
+
The Data aspect is essential because information of some other aspects (e.g., UI, Diagram) is deducted from the data description.
+
[[File:Viewpoint-BasicMass-Edition-Data-01.png|none|left|350px|]]
+
 
+
In this figure, the classes Mass and PartMass have attributes and no association.
+
=== Inheritance ===
+
Inheritance is identified by the key word ''superClass'', such as for PartMass.
+
Mass has no inheritance. Due to the "Capella" Target Application, during the generation of the ecore file (Cf. org.polarsys.capella.vp.mass plugin), a class without superclass inherits from the Capella NamedElement class.
+
 
+
The mechanism of inheritance enables to a have complete inheritance at the viewpoint level, not only from the data but also for the diagrams for instance.
+
 
+
=== Extension ===
+
An extension creates extension elements in an extended element. For Basic Mass, PartMass extends (Capella) Part. All the PartMass elements are contained by a Part element.
+
[[File:Viewpoint-BasicMass-Edition-Data-02.png|none|left|650px|]]
+
 
+
== User Interface ==
+
The UI contents is empty at the beginning. Populate it by CTRL-Space and selection of the "UI - Generate User Interface for all classes" option in the menu. The generated contents is deduced from the data description. The generation is not incremental. This means that when the Data aspect part evolves, a new generation is produced apart and ignores the previous one.
+
 
+
By CTRL-Mouse on an attribute (e.g. mass.data.Mass.value), it is possible to navigate toward the attribute defined in the Data aspect.
+
[[File:Viewpoint-BasicMass-Edition-UI-02.png|none|left|700px|]]
+
 
+
 
+
== Diagram ==
+
A diagram is made of three parts: 1) the diagram extension when a diagram extends an existing one, 2) the mapping of the data onto diagram elements, 3) the actions applicable on the diagram.
+
[[File:Viewpoint-BasicMass-Edition-Diagram-01.png|none|left|700px|]]
+
 
+
 
+
 
+
'''To be continued'''
+
 
+
  
 
[[Category:Capella]][[Category:Kitalpha]]
 
[[Category:Capella]][[Category:Kitalpha]]

Latest revision as of 04:57, 29 October 2021

This page has been moved to https://github.com/eclipse/capella/wiki/Tutorials

Back to the top