Drag&Drop without moving the Node ... [message #1303461] |
Sat, 19 April 2014 04:54  |
Eclipse User |
|
|
|
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 #1384807 is a reply to message #1384801] |
Mon, 02 June 2014 04:30  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05994 seconds