archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
944 stars 269 forks source link

No nesting relationship is created when pasting #745

Closed lvmm closed 3 years ago

lvmm commented 3 years ago

Version of Archi

4.8.1

Archi Plug-ins

none

Operating System

windows 10-64

Expected Behaviour

when an element is pasted inside another element a nesting relationship should be created and Archi should prompt for relationship type - like when it is dragged and dropped

Actual Behaviour

when an element is pasted into another element a nesting relationship is not created and there is no prompt

Steps to Reproduce the Behaviour

  1. create two independent application components
  2. select one and cut it to clipboard (^x)
  3. right-click inside another application component and select paste from the context menu
Phillipus commented 3 years ago

when an element is pasted inside another element a nesting relationship should be created and Archi should prompt for relationship type - like when it is dragged and dropped

An element is not pasted inside another element, it is pasted at the top level, so nesting relationships are not even valid for copy/paste.

This would become extremely complicated if several elements were copied and pasted. Doubtful this will be implemented, unless the Copy/Paste code has a big overhaul.

lvmm commented 3 years ago

Actually it is already complicated when multiple elements are being dragged and dropped: if they are dropped in such a way that only one is nested Archi will create nesting relationship for the whole bunch anyway and make those elements that didn't fit invisible. Personally I find it very confusing.

Phillipus commented 3 years ago

Actually it is already complicated when multiple elements are being dragged and dropped: if they are dropped in such a way that only one is nested Archi will create nesting relationship for the whole bunch anyway and make those elements that didn't fit invisible. Personally I find it very confusing.

That's how it works with DnD. The target element is where the mouse is at the drop point. Whatever elements are being dragged is what is assumed to be candidates for nesting. But feel free to contribute a patch if you can find a better way to do it.

Phillipus commented 3 years ago

I'll close this for now because elements are not pasted inside of other elements and so nesting is not an option. If we change how copy/paste works then we'll take a look at it.