Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Drag&Drop without moving the Node ... ( "misplaces" the Node in the old container)
Drag&Drop without moving the Node ... [message #1303461] Sat, 19 April 2014 08:54 Go to next message
Nikolay Manolov is currently offline Nikolay ManolovFriend
Messages: 15
Registered: June 2012
Junior Member
I have the following metaclass

class Element
    REFERS Fake_Container[] referred_by OPPOSITE referred_elements

class Container
    CONTAINS Element[] contained_elements

class Fake_Container
    REFERS Element[] referred_elements OPPOSITE referred_by


As you can see Elements are placed in Container and can be referred to from Fake_Container.

I have defined a Diagram as follows

Diagram
   Default (layout)
      Container1 (freeForm container mapped to class Container)
         Node1 (Node mapped to class Element, from contained_elements )
      Container2 (list container mapped to class Fake_Container)
         Node2 (Node mapped to class Element, from referred_elements. This is a second representation for class Element)
      Tools
         Container Drop ( of Node1 and Node2 onto Container2)
            ... SetValue ( referred_by = newSemanticContainer. This also updates referred_elements of the container because they are defined as opposite in the metamodel)


What happens is I have 2 types of containers in my diagram. In Container1 the Nodes are represented as squares and can be moved around. In Container2 Nodes are represented as list entries with their names. I can drag a Node both from Container1 or from Container2 onto Container2 and the Node will be added to the target container as a reference and will be displayed there in addition to its previous container.
If the Node, however, is dragged from Container1 it will remain there but will be placed in the upper left corner and thus break the layout ... Can anything be done so that the Node remains in its original position?
My guess is that due to the drag and drop action the respective Node is removed from the diagram and then added to all the container and because of that previous information about its placement in the diagram is lost. can we avoid this somehow?
Re: Drag&Drop without moving the Node ... [message #1311155 is a reply to message #1303461] Wed, 23 April 2014 16:31 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 66
Registered: May 2011
Member
Hello,

I reproduced your issue using an Ecore model. My "real containers" are represented by EPackages containing EClasses. My "fake container" are EClasses displaying their "eSuperTypes" in a list container. Then, my drag and drop tool simple updates the eSuperType reference.
I need to investigate a little but that looks like a bug. As the dragged element is still displayed in its initial container, we should not remove and recreated it.

Regards,
Steve
Re: Drag&Drop without moving the Node ... [message #1312338 is a reply to message #1311155] Thu, 24 April 2014 08:22 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 66
Registered: May 2011
Member
Hello,

I have created the bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=433362 for this issue.

Regards,
Steve
Re: Drag&Drop without moving the Node ... [message #1384801 is a reply to message #1312338] Mon, 02 June 2014 07:51 Go to previous messageGo to next message
Nikolay Manolov is currently offline Nikolay ManolovFriend
Messages: 15
Registered: June 2012
Junior Member
Drag N Drop in general has two functions. One is "move" and the other is "copy".
The described case above kind of falls into the second category and as such I think it should be considered a bug.

A nice enhancement would be to have the drag N drop not just for containers but also for nodes, so that elements can be associated with each other or values/references can be set.
Re: Drag&Drop without moving the Node ... [message #1384807 is a reply to message #1384801] Mon, 02 June 2014 08:30 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 108
Registered: July 2009
Senior Member
Hi,

Le 02/06/2014 09:51, Nikolay Manolov a écrit :
> Drag N Drop in general has two functions. One is "move" and the other is
> "copy".
> The described case above kind of falls into the second category and as
> such I think it should be considered a bug.

The enhancement https://bugs.eclipse.org/bugs/show_bug.cgi?id=433362
has been created to dealt with this issue.

>
> A nice enhancement would be to have the drag N drop not just for
> containers but also for nodes, so that elements can be associated with
> each other or values/references can be set.

It is already the case, in the VSM editor, you can specify drag and drop
tools with Nodes or Containers as dragged elements and Nodes, Containers
or Diagram as drop targets.


Regards

Maxime
Previous Topic:Graphical Container with No Semantic Container
Next Topic:Representing nodes from imported model
Goto Forum:
  


Current Time: Wed Nov 26 20:56:25 GMT 2014

Powered by FUDForum. Page generated in 0.01622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software