- Add Graphical Elements (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_010):
The system shall be able to add new graphical elements in new diagrams or existing diagrams
- Add Graphical Compartments (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_011):
The developper can add new compartments from a existed graphical element.
- Add new nodes (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_012):
A developper can add new nodes in the diagram that no exist in the existed diagram or add element by reusing existed shape.
- Add new child label (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_013):
A developper can add new child labels ( element that can be contained in a list compartment) in the diagram that no exist in the existed diagram or add element by reusing existed child label.
- Add new border item (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_014):
A developper can add new border items ( element that can be installed around the shape) in the diagram that no exist in the existed diagram or add element by reusing existed border item.
- Add new links (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_015):
A developper can add new links in the diagram that no exist in the existed diagram or add element by reuse existed links.
- Reuse representations from diagram (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_016):
It must be able to reuse rperesentations from existed diagrams
- Drop of new Elements (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_020):
New Elements can be dropped from the model explorer.
- Assistant (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_030):
The new element must be created by using assistant mechanism
- Creation from the palette (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_040):
Elements can be created fom the palette
- Non impact on parent diagrams (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_050):
the inheridted diagram must not impact parent diagram by addin the new compartments.
- ExpransionModel (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_060):
The expansion of diagram has to be a model and be interpreted
- The model has to be well-built (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_061):
When the model is done, the ystem has to ensure that it can be correctly interpreted.
- Expanded diagrams viewed with original editor (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_070):
The original diagram must be view in original diagram, exteernal element must have a predefined shape.
It cannot be implemented for the version Mars
- CSS driven (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_080):
The added element must be driven by CSS
- View point relation (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_090):
The new specialization editor must benefit of all specializations.
- Loading at runtime (id=org.eclipse.papyrus.infra.gmfdiag.expansion.Req_0100):
An expansion model must be able to load during runtime, not only with extension point.
It allow to be tested by Junit Tests.
UseCaseDiagram
CommentDiagram
- traces to ExpransionModel
The developper can model the expansion of diagram.
In order to be able to edit this kind of model, the developper has to download the code of this editor.
To do that, click on menu File--> new-->Other
Choose "Example EMF models creation wizards" and select Expansion Model.
Then select as root Object a diagram expansion.
Create a new expansion model step 2
Create a new expansion model step 1
I has to be included inside plug-ins and fill the extension point: "org.eclipse.papyrus.infra.gmfdiag.common.diagramExpansion".
Note: If the model is not valid, the framework does not take in account your model expansion.
--> so valid it, and see your log error.
In order to add an expansion for a diagram, the developper has to wonder "Which diagram must be expanded?
To specify it the advanced user has to create a UseContext. The diagram type is the reference to your diagram, class diagram, composite diagram or your view point?
Set a UseContext
- traces to Reuse representations from diagram
It must be able to reuse reperesentations from existed diagrams
Reuse representation of existing diagram implies knowledge of each representation. A representation is composed by three concepts:
- the model (in our case this is the notation model or more see serailization of the diagram)
- the controler (in the context of GEF, it is named "EditPart"
- and the view ( the java Darw2d figure)
First indicate the visual ID that you want to overload (this id can be found in the code or in the gmfgen files)
So if you want to change the serialization of the new representation change the view factory
If you want to associate a new controler to the model notation change the editpart.
In order to have more detailled information see the MVC of GEF.
The name in this element is never used programmtically. It is used as an information.
Resuse class representation form class diagram
- traces to Add Graphical Elements
- traces to Add Graphical Compartments
A developper can add compartments inside a node. It can be XYlayout or list or other type of compartments.
- traces to Add new nodes
A developper can add new nodes in the diagram that no exist in the existed diagram or add element by reusing existed shape.
- traces to Add new child label
A developper can add new child labels ( element that can be contained in a list compartment) in the diagram that no exist in the existed diagram or add element by reusing existed child label.
- traces to Add new border item
A developper can add new border items ( element that can be installed around the shape) in the diagram that no exist in the existed diagram or add element by reusing existed border item.
- traces to Add new links
A developper can add new links in the diagram that no exist in the existed diagram or add element by reuse existed links.
The code is dispatched in several packages.
The infra.gmf.common contains the essential of the code.
One part has been generated from the UML model to design the structure of representation.
The second part has been coded manuaaly in order to interpret instances of models.
NewEcoreUMLClassDiagram
- specializes AbstractRepresentation
A representation is en element that is displyed on a diagram it is attached to a controler (see editpart) and to a notation structure( build bt the viewFactory)
- specializes AbstractRepresentation
An Induced Representation is a representation that is automatically created by its parent representation (compartment, label of a shape, label of link, label or border item)
The use context is the point used to extend a diagram, it indicate for wich diagram all representation will be added or extended.
This the root element model that can contain Use context or libraries.
An Id is associated in order to allow debbugging in the case of model is bad build.
- specializes Representation
A GMF_BasedRepresentation is reuse of an element generated by GMFT, for example well would to add compartments for class. we need to references class of class diagram. this element is used o this.
This Element is a library of Type of representation, for display as label, border item, classifier...
This is an abstract representation used to display shape or reused shape in diagram.
View Providers
This design contains classes to interpret model of expansion and create graphical elements from the palette.
Creation of InducedRepresentations
This design contains classes to interpret model of expansion and create induced representation ( compartments, labels...).
This class is a structure that is adapted for the code of provider not to describe compartments as the model
it satisfy #Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_060
- specializes RecordingCommand
Command to create the compartment displaying shapes for an element
see #Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_011
This factory is used to give an instance of the diagram expansion
This class is used to load all extension point call org.eclipse.papyrus.infra.gmfdiag.diagramexpansion
It gives the set of all Diagram expansion that has to be used
#Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_060
- specializes AbstractEditPartProvider
This class is a generic EditpartProvider that is enable to associate controler to new notation element by reading an expansion model
See Requirement #Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_010
- specializes CustomAbstractViewProvider
- realizes IViewProvider
This class is a generic ViewProvider that is enable to create notation element by reading an expansion model
See Requirement #Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_010
#Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_040
- realizes IGraphicalTypeRegistry
This class is used to know all graphical type that can be added in the diagram.
By default it accepts all. This is the ExpandViewProvider that verify the job
#Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_010
- specializes GraphicalEditPolicy
This edit policy can be apply only on {@link IPapyrusEditPart} in order to access to primary figure. the primary figure has to be a {@link IPapyrusNodeUMLElementFigure}.
It creates the compartment displaying shapes for an element by reading the expansion model
see #Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_011
- specializes AbstractProvider
- realizes IEditPolicyProvider
Edit policy provider to install InducedRepresentationPolicy in charge to create compartments displaying shapes for an element by reading the expansion model
see #Req org.eclipse.papyrus.infra.gmfdiag.expansion.Req_011
Test expansion model
The code coverage for:
- org.eclipse.papyrus.infra.gmfdiag.common.expansion is equals to 90,1 %.
- ExpansionElementDropStrategy.java 87,0 %
The function is coverage at 64%
The goal of this test is to know if a compartment can be added on existed node.
The goal of this test is to know if a child label can be added inside compartments.
The goal of this test is to know if a compartment can be added on existed node by using library of compartments.
The goal of this test is to know if a border item can be added on existed node.
The goal of this test is to know if a link can be added inside a diagram.
The goal of this test case is to ensure that the assistant can be used with the an expansion of model. It contains on test based on node.
It remains to add a test based on links.
Unsatisfied requirements (9 out of 17) :org.eclipse.papyrus.infra.gmfdiag.expansion.Req_020, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_030, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_040, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_050, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_061, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_070, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_080, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_090, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_0100
Unverified requirements (6 out of 17) :org.eclipse.papyrus.infra.gmfdiag.expansion.Req_040, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_050, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_061, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_070, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_080, org.eclipse.papyrus.infra.gmfdiag.expansion.Req_090