Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to synchronize layouts between 2 representations?(Need to synchronize 2 layouts. When changing a layout (in diagram editor), the other layout is chnaged automatically)
How to synchronize layouts between 2 representations? [message #1481746] Fri, 21 November 2014 07:33 Go to next message
Sann Tran is currently offline Sann TranFriend
Messages: 15
Registered: November 2014
Junior Member
I have 2 representations R1 & R2 that represent the same model.

The 2 representations are already opened in two diagram editors, and user can see 2 editor at the same time.
What I need is to synchronize layout of R2 with R1. If layout of R1 is changed, layout of R2 have to be changed automatically.

It took me several days to find a solution to do that. And I still have no solution. So please tell me How can I do that?

Thank you very much!
Re: How to synchronize layouts between 2 representations? [message #1486716 is a reply to message #1481746] Tue, 25 November 2014 08:31 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 236
Registered: August 2010
Senior Member
Hello,

See my answers below.

On 11/21/2014 08:33 AM, Sann Tran wrote:
> I have 2 representations R1 & R2 that represent the same model.
> The 2 representations are already opened in two diagram editors, and
> user can see 2 editor at the same time.
> What I need is to synchronize layout of R2 with R1. If layout of R1 is
> changed, layout of R2 have to be changed automatically.

Why do you need to keep those diagrams synchronised?

>
> It took me several days to find a solution to do that. And I still have
> no solution. So please tell me How can I do that?

You could provide a
org.eclipse.sirius.business.api.session.ModelChangeTrigger to the
org.eclipse.sirius.business.api.session.SessionEventBroker. The
SessionEventBroker is registered as a precommit listener and will
delegate the job to the ModelChangeTriggers. The idea is to react to the
GMF Bounds changes and update the other diagram.

You can obtain the SessionEventBroker from
org.eclipse.sirius.business.api.session.Session.getEventBroker().

>
> Thank you very much!
>


--
Florian - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to synchronize layouts between 2 representations? [message #1493947 is a reply to message #1486716] Mon, 01 December 2014 04:12 Go to previous message
Huy Le is currently offline Huy LeFriend
Messages: 18
Registered: November 2014
Junior Member
Hello Florian,

Thank you for your advice. The context of layou sync is already posted at forums/index.php?t=msg&th=864786&goto=1486420&#msg_1486420
I also posted the current solution that I & Sann Tran implemented.

Regards

Huy


Previous Topic:Create new instances via context menu in model explorer
Next Topic:NullPointerException on subnode - default icon replaced by red square
Goto Forum:
  


Current Time: Sat Apr 04 23:04:33 GMT 2020

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

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

Back to the top