| <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| </head> |
| <body> |
| <h1 id="Architecture_of_Papyrus-SiriusDiag">Architecture of Papyrus-SiriusDiag</h1> |
| <p>This framework has been developed to be used only when a sirius diagram is opened.</p> |
| <h2 id="Git_Architecture">Git Architecture</h2> |
| <ul> |
| <li> |
| <b>plugins/infra/siriusdiag</b> |
| <ul> |
| <li> |
| <b>modelexplorer</b>:contains code allowing to display and use sirius diagram in the papyrus model explorer |
| </li> |
| <li> |
| <b>properties</b>: contains code to visualize the properties of sirius diagrams |
| </li> |
| <li> |
| <b>representation</b>: contains the code to create sirius diagram views |
| </li> |
| <li> |
| <b>representation.architecture</b>: contains the code to create specific sirius diagram |
| </li> |
| <li> |
| <b>representation.edit</b>: plugin defining sirius diagram prototype |
| </li> |
| <li> |
| <b>sirius</b>: plugin containing sirius services to handle session |
| </li> |
| <li> |
| <b>siriusdiag.ui</b>: plugin handling sirius diagram views and session management |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul> |
| <li> |
| <b>plugins\uml\sirius</b> |
| <ul> |
| <li> |
| <b>clazz.diagram</b>: contains class diagram description and services |
| </li> |
| <li> |
| <b>common.diagram</b>: contains all the common services that can be used by all diagrams |
| </li> |
| <li> |
| <b>diagram.architecture</b>: contains all the common services that can be used by all diagrams |
| </li> |
| <li> |
| <b>sequence.diagram</b>: contains sequence diagram description and services |
| </li> |
| <li> |
| <b>statemachine.diagram</b>: contains statemachine diagram description and services |
| </li> |
| <li> |
| <b>xtext.integration.ui</b>: contains customization to add xtext on label edition |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <h1 id="Sirius_viewpoint">Sirius viewpoint</h1> |
| <p>Each new diagram contribution is added in a new plugin, which contains the description of the mapping, the filters and the tools available for this diagram.</p> |
| <p>For more information about viewpoint description, you can have a look at the sirius documentation available here: |
| |
| <a href="https://www.eclipse.org/sirius/doc/specifier/general/Specifying_Viewpoints.html">https://www.eclipse.org/sirius/doc/specifier/general/Specifying_Viewpoints.html</a> |
| </p> |
| <p>Note that each viewpoint shall reuse:</p> |
| <ul> |
| <li>The common layer which is a mandatory layer defining the common concept of all diagrams (Hyperlink and Benpoint).</li> |
| <li>The common tool, for navigation, deletion, etc.</li> |
| <li>Common and specific java services. </li> |
| </ul> |
| <h1 id="Adding_a_new_diagram_to_the_architecture_file">Adding a new diagram to the architecture file</h1> |
| <p>The editor provided to edit the DocumentStructureTemplate metamodel is not exactly the version generated by EMF. We customized it in order to use a TransactionalEditingDomain (to ease the Papyrus integration). </p> |
| <p>When we add a new Sirius diagram, we shall create a new Sirius diagram prototype:</p> |
| <p> |
| <img border="0" src="../../../image/dev/1_ViewCreation.png"/> |
| </p> |
| <p>Once the Sirius Diagram Prototype has been created, it shall be defined as in the following picture:</p> |
| <p> |
| <img border="0" src="../../../image/dev/5_DefineRepresentation.png"/> |
| </p> |
| <p>To be able to reference the corresponding Diagram Description, it shall first be loaded in order to reference it. This can be done as in the following image:</p> |
| <p> |
| <img border="0" src="../../../image/dev/2_LoadViewpoint.png"/> |
| </p> |
| <p>And select the corresponding *.odesign file using the Browse Workspace:</p> |
| <p> |
| <img border="0" src="../../../image/dev/2_SelectOdesign.png"/> |
| </p> |
| <p>Once the Sirius Diagram Prototype has been created. We shall select on which viewpoint this representation shall be allowed. To do this, select the viewpoint and add a Representation Kinds:</p> |
| <p> |
| <img border="0" src="../../../image/dev/4_AddRespresentation.png"/> |
| </p> |
| <p>And simply select the diagram prototype that was created on the previous step.</p> |
| <p> |
| <img border="0" src="../../../image/dev/3_RegisterRepresentation.png"/> |
| </p> |
| <p>This shall be done for both Analysis and Design viewpoint.</p> |
| <h2 id="Adding_the_creation_command">Adding the creation command</h2> |
| <p>In the org.eclipse.papyrus.infra.siriusdiag.representation.architecture plugin, a new class extending the AbstractCreateSiriusDiagramEditorCommand shall be created. This class will manage the condition of the creation of the diagram and the action to execute before creating it depending on the context.</p> |
| <p>For example, a sequence diagram can be created directly under an interaction without prior action, but if we want to create it under a Model, an interaction shall be created before and defined as the root of the diagram.</p> |
| <h1 id="Sirius_session_management">Sirius session management</h1> |
| <p>To use the same transactional editing domain than other papyrus services, we had to override the default sirius session and creation. This is done by the PapyrusSessionFactory which allows to create PapyrusSession (which are just sirius session with the right TransactionalEditingDomain).</p> |
| <p>For new services using session, it is recommanded to use the SessionService provided in the org.eclipse.papyrus.infra.siriusdiag.ui plugin. </p> |
| <h1 id="Common_Diagram">Common Diagram</h1> |
| <h2 id="Common_concepts">Common concepts</h2> |
| <h3 id="Bendpoints">Bendpoints</h3> |
| <p>Benpoints mapping is used to draw a Benpoint node at the intersection of edges when the Benpoints filter is activated.</p> |
| <h3 id="Hyperlink">Hyperlink</h3> |
| <p>Hyperlink node is used to add a node in the diagram that allows to navigate to other representation.</p> |
| <h3 id="Refresh_provider">Refresh provider</h3> |
| <p>In some sirius diagrams, for several purpose (region management, bendpoints and sequence diagram reorder), the post refresh behavior of sirius diagrams have been overriden.</p> |
| <p>To override this behavior, we have used the following extension point org.eclipse.sirius.refreshExtensionProvider.</p> |
| <h3 id="Common_services">Common services</h3> |
| <ul> |
| <li>PapyrusSiriusTabbarContributor allows to enable or deactivate tools in the sirius tabbar.</li> |
| </ul> |
| <p> |
| <img border="0" src="../../../image/dev/6_SiriusTabbar.png"/> |
| </p> |
| <ul> |
| <li>AbstractDiagramServices is used to manage Label node label, node creation and node drag and drop tools.</li> |
| </ul> |
| <ul> |
| <li>AddElementToDiagramServices handles precondition for creation tool.</li> |
| </ul> |
| <ul> |
| <li>LabelServices handles direct edition of labels.</li> |
| </ul> |
| <ul> |
| <li>TooltipServices helps to provide a tooltip for each tools of the palette.</li> |
| </ul> |
| <ul> |
| <li>DeleteFromModelHandler handles the deletion of semantic element.</li> |
| </ul> |
| <ul> |
| <li>Hyperlink and Shortcut services handles navigation, creation of hyperlink and shortcut.</li> |
| </ul> |
| <h1 id="Class_Diagram">Class Diagram</h1> |
| <p>The class diagram code is located in the |
| org.eclipse.papyrus.uml.sirius.clazz.diagram plugin.</p> |
| <h2 id="Services">Services</h2> |
| <ul> |
| <li>ClassDiagramServices handles services used by tools of the class diagram for creation, reconnection, etc.</li> |
| </ul> |
| <h2 id="Description">Description</h2> |
| <p>The diagram description is located in the papyrus_class.odesign:</p> |
| <p>The Class layer defines all the mapping and tools specific to the class diagram:</p> |
| <ul> |
| <li>NodeContainer, Node, Edge and BorderedNode mapping.</li> |
| <li>The style of each node</li> |
| <li>The Nodes tool section define the Nodes palette tools behavior, which are mostly creation tools.</li> |
| <li>The Edges tool section define the Edges palette tools behavior, which are mostly creation tools.</li> |
| <li>The Features tool section define the drag and drop from model and from representations, tools for the label edition and tools for deletion. </li> |
| <li>The Relationships tool section define the reconnection tools and some deletion tools.</li> |
| </ul> |
| <h1 id="State_Machine_Diagram">State Machine Diagram</h1> |
| <p>The State Machine diagram code is located in the |
| org.eclipse.papyrus.uml.sirius.statemachine.diagram plugin.</p> |
| <h2 id="Services_2">Services</h2> |
| <p>To handle the specific behavior of Region, since both VerticalStack or HorizontalStack children presentations could not handle the mixed behavior of region (sometimes vertical and sometimes horizontal). Hence, the Freeform children presentation is used combined to a manageRegionPresentation and setChildRepresentation method that allows to chose between either horizontal and vertical.</p> |
| <h2 id="Description_2">Description</h2> |
| <p>The diagram description is located in the papyrus_statemachine.odesign:</p> |
| <p>The State Machine layer defines all the mapping and tools specific to the state machine diagram:</p> |
| <ul> |
| <li>NodeContainer, Node, Edge and BorderedNode mapping.</li> |
| <li>The style of each node.</li> |
| <li>The Nodes tool section define the Nodes palette tools behavior (mostly creation tools), drag and drop from model or from representation tools, label edition tools and deletion tools.</li> |
| <li>The Edges tool section define the Edges palette tools behavior (mostly creation tools) and reconnection tools.</li> |
| </ul> |
| <h1 id="Sequence_Diagram">Sequence Diagram</h1> |
| <p>The Sequence diagram code is located in the |
| org.eclipse.papyrus.uml.sirius.sequence.diagram plugin.</p> |
| <h2 id="Services_3">Services</h2> |
| <ul> |
| <li>Each services available in org.eclipse.papyrus.uml.sirius.sequence.diagram.services refers to one kind of element and handles the creation, reconnection and precondition for tools linked to this element.</li> |
| </ul> |
| <ul> |
| <li>ReorderSequenceRegistry, ReorderService and RefreshSequenceExtensionProvider are used to handle the reordering of all the diagram when moving elements.</li> |
| </ul> |
| <h2 id="Description_3">Description</h2> |
| <p>The diagram description is located in the papyrus_sequence.odesign:</p> |
| <p>The Sequence layer defines all the mapping and tools specific to the Sequence diagram:</p> |
| <ul> |
| <li>InstanceRole, NodeContainer, Node, Edge, BorederedNode, Execution, State, CombinedFragment, InteractionUse and ObservationPoint mapping.</li> |
| <li>The style of each mapping.</li> |
| <li>The Nodes tool section define the Nodes palette tools behavior (mostly creation tools) and label edition tools.</li> |
| <li>The Edges tool section define the Edges palette tools behavior (mostly creation tools).</li> |
| <li>The Tools tool section define reconnection tools, reodering tools, label edition tools and deletion tools.</li> |
| </ul> |
| <h1 id="Xtext_integration">Xtext integration</h1> |
| <p>Code in org.eclipse.papyrus.uml.sirius.xtext.integration.ui override classic editpart to add an xtext parser on each label edition.</p> |
| <h1 id="Test_coverage">Test coverage</h1> |
| <p>The common method to create new tests for sirius diagram is located in org.eclipse.papyrus.siriusdiag.junit.utils. In this plugin, the SiriusDiagramEditorFixture provide all the method to load model, ope session, tests tools that will be used in the several test case.</p> |
| <p>Each specific diagram is tested in a specific plugin. Those tests include:</p> |
| <ul> |
| <li>Diagram creation</li> |
| <li>Diagram deletion</li> |
| <li>Creation tools tests</li> |
| <li>Drag and Drop tools tests</li> |
| <li>Deletion</li> |
| </ul> |
| </body> |
| </html> |