Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to copy an element while keeping its layout?
How to copy an element while keeping its layout? [message #1833932] Wed, 28 October 2020 09:30 Go to next message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 44
Registered: March 2020
Member
Hi,

I am using Sirius to build an Eclipse RCP Application, and there's a need that my user wants to copy an element while keeping the element's owned sub-elements' layout.

For example, the following figure shows the problem I am facing. Chip A has a device A1 with two ports( Port 1 and Port 2), and the ports are both side of the device. When I hit Ctrl+C on Device A1 at left side of the chip and hit Ctrl+V pasting it to the right side, the copied device's ports' position are reset. Both ports are on the left side(which is the default position) on the copied device.

index.php/fa/39156/0/

Is there any method I can do to make the copied element keep the original layout? I search the forum and stackoverflow but found no solution. Any advice would be appreciated.

Thanks for you help very much!
Re: How to copy an element while keeping its layout? [message #1833988 is a reply to message #1833932] Thu, 29 October 2020 14:14 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 564
Registered: July 2009
Senior Member
Hi.

This is not currently supported. It is much more complex that it may look given the very open-ended nature of Sirius modelers.

It might be possible to create your own custom tool, say "Duplicate Element" with a more constrained semantic, add it as an entry in the context menu (see https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#popup_menu) and implement the tool through a Java service which duplicates both the graphical elements with their positions/sizes *and* the underlying semantic elements (adjusting the references between the copies of course).
It seems possible, but non trivial and requires some knowledge of the internal of Sirius (how the semantic models, the Sirius diagram elements and the GMF views relate to each other).

Regards,
Pierre-Charles


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to copy an element while keeping its layout? [message #1834005 is a reply to message #1833988] Fri, 30 October 2020 02:45 Go to previous message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 44
Registered: March 2020
Member
Thanks, it seems a very hard work. Would you tell me where I can get some study materials for this topic? Or any internal APIs that I might use? Thanks for your help very much!
Previous Topic:How to get an element based edge to show across hierarchies
Next Topic:How to access an EObject's position and size?
Goto Forum:
  


Current Time: Sat Apr 17 00:41:55 GMT 2021

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

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

Back to the top