Skip to main content



      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 02:33 Go to next message
Eclipse UserFriend
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 03:31 Go to previous messageGo to next message
Eclipse UserFriend
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] Sun, 30 November 2014 23:12 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 18:36:32 EDT 2025

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

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

Back to the top