Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mdt-papyrus.dev] Drag and drop into papyrus

Hi, 

I have added the drag and drop for the class diagram. 

In order to execute the drag and drop, the designer has to create
several classes

- CustomGraphicalNodeEditPolicy 

the algo of this class is generic but I cannot put in in the
diagram.common, because it refers classes that exists only in generated
code. I think so it could be generated.

- ClassDiagramDragDropEditPolicy, this is a more specific class to
allows adding your own algorithm to drop element, I my case i write code
to drop multi association dependencies, associationClass.

-> this class is very specific, and has to be written by hands.

- LinkMappingHelper

this is a class that show the semantic target and semantic source for a
link. There is an equivalent in the gmf code, but it impossible to use
it. view or target has to exist before and it done a lot of loop in the
model in order to find source and target.

- ClassLinkMappingHelper this is specific class for the class diagram. I
think that is class can be generated, because the information is the
mapping already exist in the gen model.

In order to have a successful drag and drop the specific policy for the
drag and drop has to be added in diagrams edit policy (in the gmf gen)
and you have to pay attention about the order of the element in the gen
model. First more specific and last more general. Why? in the
visualRegistry , gmf use the operator "instanceof ". The error that you
can obtain is to drop a usage and your obtain the editpart of the
dependency that is not the same.

Patrivk
PS I will add it in the cook-book and I add task to generate code (do
that when we have time). 
 
 
---------------------------------------------------------
Patrick Tessier
Research Engineer
DRT LIST/DTSI/SOL/LISE CEA-Saclay
91191 Gif sur Yvette Cedex
Tel: 01 69 08 48 63
www.papyrusuml.org <http://www.papyrusuml.org/> 
---------------------------------------------------------
BEGIN:VCARD
VERSION:2.1
N:TESSIER;Patrick
FN:TESSIER Patrick 202707 (Patrick.TESSIER@xxxxxx)
ORG:;SOL/LLSP
TITLE:Ingénieur Chercheur
TEL;WORK;VOICE:(01) 69 08 48 63
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;B=E2t. 451 Pce 9;CEA SACLAY=0D=0ADRT/DTSI;GIF/YVETTE CEDEX;;91191;FRANCE
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:B=E2t. 451 Pce 9=0D=0ACEA SACLAY=0D=0ADRT/DTSI=0D=0AGIF/YVETTE CEDEX 91191=
=0D=0AFRANCE
EMAIL;PREF;INTERNET:Patrick.TESSIER@xxxxxx
REV:20071011T094630Z
END:VCARD

Back to the top